@ancha-labs/cli 0.4.40 → 0.4.42

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.
@@ -27,6 +27,9 @@ Add `--json` to every command. Runs print NDJSON events that end with `run_finis
27
27
  ```
28
28
  - To name the command yourself: `ancha init --agent "<the command that starts your agent>"`.
29
29
  - To name its tools yourself (NetSuite, Slack, ...): `ancha init --tools netsuite,slack`.
30
+ - **Composio agents.** Init detects Python `composio` / `composio_client` and TypeScript `@composio/core`, and finds tools from explicit toolkit lists and tool slugs. It writes each available Composio route under `agent.routes` and adds `COMPOSIO_API_KEY` to `agent.pass_env`, preserving existing settings. The world of each test decides which routed tools answer there.
31
+ - When init asks which tools the agent reaches through Composio, ask the user which tools they use. Set `agent.routes.<tool>: composio` for each routed tool (for example, `agent.routes.quickbooks: composio`) and add `COMPOSIO_API_KEY` to `agent.pass_env` in `ancha.yaml`. Configure the Composio client to read `COMPOSIO_BASE_URL` from the attempt environment.
32
+ - For a routed agent with no tests or traces, init writes a starter test that reads from each routed tool, plus the QuickBooks examples when the agent uses QuickBooks. Routed tests run in the cloud: with `COMPOSIO_API_KEY` in your shell, the steps below store it, upload the agent and run the tests.
30
33
  3. **Point the agent at Ancha's tools.** In a test, the agent calls Ancha instead of production:
31
34
  - Its clients for Slack, GitHub and the other tools Ancha replicates take the URLs and credentials Ancha supplies: `ancha connect <tool>` prints the settings.
32
35
  - Its own functions: wrap them with `wrapTools` from `@ancha-labs/tools` (`ancha.wrap_tools` in Python), or serve them over MCP.
@@ -39,7 +42,7 @@ Add `--json` to every command. Runs print NDJSON events that end with `run_finis
39
42
  ancha agent upload
40
43
  ```
41
44
  - The install follows the project's own manifests and lockfiles; `agent.install` in `ancha.yaml` sets the command instead.
42
- 6. **Without production traces.** For an agent that uses NetSuite, `ancha init` writes a NetSuite world of a private-equity portfolio company (four subsidiaries, two currencies, thousands of transactions) and 25 tests: 10 read tasks and 15 write workflows.
45
+ 6. **Without production traces.** For an agent that calls NetSuite directly, `ancha init` writes a NetSuite world of a private-equity portfolio company (four subsidiaries, two currencies, thousands of transactions) and 25 tests: 10 read tasks and 15 write workflows. For an agent that uses QuickBooks, it writes Pellmont Building Services' 2025 books and two tests: `pellmont-duplicates` reports the duplicate vendors, the invoices and bills entered twice and the money at stake without changing the books, and `pellmont-approved-merge` merges the three duplicate vendor pairs as approved and changes nothing else.
43
46
  - Your data: `ancha world import netsuite <your exports> --id <id>` reads REST record JSON, SuiteQL results and saved search CSV into `ancha/worlds/<id>.yaml`; check it with `ancha world validate`. To write the seed yourself, `ancha twins seed netsuite` lists its fields.
44
47
  - Your evals: `ancha test import <file>` (JSONL, JSON, CSV or YAML with a question and an expected answer) writes tests for the only world in `ancha/worlds/`, or the one `--world <id>` names; with none, `ancha init --on local --template starter` adds one.
45
48
  - One test from a sentence: `ancha test new "<sentence>" --world <id>`.
@@ -12,6 +12,9 @@
12
12
  ```
13
13
  - To name the command yourself: `ancha init --agent "<the command that starts your agent>"`.
14
14
  - To name its tools yourself (NetSuite, Slack, ...): `ancha init --tools netsuite,slack`.
15
+ - **Composio agents.** Init detects Python `composio` / `composio_client` and TypeScript `@composio/core`, and finds tools from explicit toolkit lists and tool slugs. It writes each available Composio route under `agent.routes` and adds `COMPOSIO_API_KEY` to `agent.pass_env`, preserving existing settings. The world of each test decides which routed tools answer there.
16
+ - When init asks which tools the agent reaches through Composio, ask the user which tools they use. Set `agent.routes.<tool>: composio` for each routed tool (for example, `agent.routes.quickbooks: composio`) and add `COMPOSIO_API_KEY` to `agent.pass_env` in `ancha.yaml`. Configure the Composio client to read `COMPOSIO_BASE_URL` from the attempt environment.
17
+ - For a routed agent with no tests or traces, init writes a starter test that reads from each routed tool, plus the QuickBooks examples when the agent uses QuickBooks. Routed tests run in the cloud: with `COMPOSIO_API_KEY` in your shell, the steps below store it, upload the agent and run the tests.
15
18
  3. **Point the agent at Ancha's tools.** In a test, the agent calls Ancha instead of production:
16
19
  - Its clients for Slack, GitHub and the other tools Ancha replicates take the URLs and credentials Ancha supplies: `ancha connect <tool>` prints the settings.
17
20
  - Its own functions: wrap them with `wrapTools` from `@ancha-labs/tools` (`ancha.wrap_tools` in Python), or serve them over MCP.
@@ -24,7 +27,7 @@
24
27
  ancha agent upload
25
28
  ```
26
29
  - The install follows the project's own manifests and lockfiles; `agent.install` in `ancha.yaml` sets the command instead.
27
- 6. **Without production traces.** For an agent that uses NetSuite, `ancha init` writes a NetSuite world of a private-equity portfolio company (four subsidiaries, two currencies, thousands of transactions) and 25 tests: 10 read tasks and 15 write workflows.
30
+ 6. **Without production traces.** For an agent that calls NetSuite directly, `ancha init` writes a NetSuite world of a private-equity portfolio company (four subsidiaries, two currencies, thousands of transactions) and 25 tests: 10 read tasks and 15 write workflows. For an agent that uses QuickBooks, it writes Pellmont Building Services' 2025 books and two tests: `pellmont-duplicates` reports the duplicate vendors, the invoices and bills entered twice and the money at stake without changing the books, and `pellmont-approved-merge` merges the three duplicate vendor pairs as approved and changes nothing else.
28
31
  - Your data: `ancha world import netsuite <your exports> --id <id>` reads REST record JSON, SuiteQL results and saved search CSV into `ancha/worlds/<id>.yaml`; check it with `ancha world validate`. To write the seed yourself, `ancha twins seed netsuite` lists its fields.
29
32
  - Your evals: `ancha test import <file>` (JSONL, JSON, CSV or YAML with a question and an expected answer) writes tests for the only world in `ancha/worlds/`, or the one `--world <id>` names; with none, `ancha init --on local --template starter` adds one.
30
33
  - One test from a sentence: `ancha test new "<sentence>" --world <id>`.
@@ -0,0 +1,75 @@
1
+ # Pellmont Building Services (QuickBooks, 2025): carry out the approved merge of the duplicate vendors.
2
+ # Passes when, for each of the three pairs, the record with the legal suffix (LLC, Inc. or Co.) stays active, holds
3
+ # all of the pair's bills and gets the email, phone, address or website it lacked from the other record (nothing it
4
+ # had is overwritten), and the other record is inactive; no other vendor, customer, item or invoice changes, and
5
+ # no bill is deleted, the bills recorded twice included.
6
+ version: 2
7
+ id: pellmont-approved-merge
8
+ title: "Pellmont: merge the three approved duplicate vendor pairs; nothing else changes"
9
+ world: pellmont-building-services
10
+ timeout: 10m
11
+ start:
12
+ task: "For Pellmont Building Services, the operator reviewed the 2025 duplicate-vendor findings and approved merging each vendor that is recorded under two names. For each such pair, keep the record whose name carries the legal suffix (LLC, Inc. or Co.): move the other record's bills to it, copy over any email, phone, address or website the kept record lacks, then make the other record inactive. Do not delete any bill or invoice or change its amount, and do not change customers, items or any other vendor. Report what you changed."
13
+ checks:
14
+ - id: bills_moved_off_102
15
+ state:
16
+ quickbooks.count: { type: Bill, where: { VendorRef.value: "102" }, count: 0 }
17
+ - id: bills_moved_off_104
18
+ state:
19
+ quickbooks.count: { type: Bill, where: { VendorRef.value: "104" }, count: 0 }
20
+ - id: bills_moved_off_106
21
+ state:
22
+ quickbooks.count: { type: Bill, where: { VendorRef.value: "106" }, count: 0 }
23
+ - id: bills_on_101
24
+ state:
25
+ quickbooks.count: { type: Bill, where: { VendorRef.value: "101" }, count: 8 }
26
+ - id: bills_on_103
27
+ state:
28
+ quickbooks.count: { type: Bill, where: { VendorRef.value: "103" }, count: 13 }
29
+ - id: bills_on_105
30
+ state:
31
+ quickbooks.count: { type: Bill, where: { VendorRef.value: "105" }, count: 12 }
32
+ - id: website_copied_to_105
33
+ state:
34
+ quickbooks.entity: { type: Vendor, id: "105", fields: {"WebAddr.URI": "https://ostrandersupply.example", "PrimaryEmailAddr.Address": "orders@ostrandersupply.example"} }
35
+ - id: kept_details_not_overwritten
36
+ state:
37
+ quickbooks.entity: { type: Vendor, id: "101", fields: {"PrimaryEmailAddr.Address": "ap@halvorsendiaz.example", "WebAddr.URI": "https://halvorsendiaz.example"} }
38
+ - id: kept_email_103
39
+ state:
40
+ quickbooks.entity: { type: Vendor, id: "103", fields: {"PrimaryEmailAddr.Address": "accounts@northpointfuel.example"} }
41
+ - id: inactive_102
42
+ state:
43
+ quickbooks.entity: { type: Vendor, id: "102", fields: {"Active": false} }
44
+ - id: inactive_104
45
+ state:
46
+ quickbooks.entity: { type: Vendor, id: "104", fields: {"Active": false} }
47
+ - id: inactive_106
48
+ state:
49
+ quickbooks.entity: { type: Vendor, id: "106", fields: {"Active": false} }
50
+ - id: active_101
51
+ state:
52
+ quickbooks.entity: { type: Vendor, id: "101", fields: {"Active": true} }
53
+ - id: active_103
54
+ state:
55
+ quickbooks.entity: { type: Vendor, id: "103", fields: {"Active": true} }
56
+ - id: active_105
57
+ state:
58
+ quickbooks.entity: { type: Vendor, id: "105", fields: {"Active": true} }
59
+ - id: only_three_inactive
60
+ state:
61
+ quickbooks.count: { type: Vendor, where: { Active: false }, count: 3 }
62
+ - id: other_vendors_untouched
63
+ state:
64
+ quickbooks.unchanged:
65
+ types: [ Vendor ]
66
+ except: [{"type": "Vendor", "id": "101"}, {"type": "Vendor", "id": "103"}, {"type": "Vendor", "id": "105"}, {"type": "Vendor", "id": "102"}, {"type": "Vendor", "id": "104"}, {"type": "Vendor", "id": "106"}]
67
+ - id: sales_side_untouched
68
+ state:
69
+ quickbooks.unchanged: { types: [ Invoice, Customer, Item ] }
70
+ - id: no_bill_deleted
71
+ state:
72
+ quickbooks.count: { type: Bill, count: 71 }
73
+ - id: double_entries_kept
74
+ state:
75
+ quickbooks.count: { type: Bill, where: { DocNumber: "HD-3317", TotalAmt: 8940 }, count: 2 }