fairwire-telecom-bills 0.0.0-stage → 0.1.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/CHANGELOG.md +5 -0
- package/LICENSE +21 -0
- package/README.md +212 -2
- package/bin/fairwire-telecom-bills.js +7 -0
- package/evals/cases.json +358 -0
- package/fixtures/README.md +7 -0
- package/fixtures/intl/README.md +12 -0
- package/fixtures/intl/de/leavers.csv +2 -0
- package/fixtures/intl/de/lines.csv +17 -0
- package/fixtures/intl/ja/leavers.csv +2 -0
- package/fixtures/intl/ja/lines.csv +17 -0
- package/fixtures/leavers.csv +2 -0
- package/fixtures/lines.csv +17 -0
- package/fixtures/settings-roaming.json +3 -0
- package/fixtures/settings.json +4 -0
- package/package.json +57 -4
- package/server.json +37 -0
- package/src/demo.js +19 -0
- package/src/index.js +2 -0
- package/src/logic.js +62 -0
- package/src/manifest.js +32 -0
package/CHANGELOG.md
ADDED
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Kurt Francisco
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,213 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Fairwire Telecom Bills
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Telecom bill review: mobile lines with no use for months, lines still billed for people who left, roaming and premium charges, plans much bigger than the use, two lines for one person and fixed lines nobody calls from. Phone numbers masked for the model. Drafts cancellation lists; never cancels a line.
|
|
4
|
+
|
|
5
|
+
Part of **Fairwire**, the IT and network family of [Mythos Machines](https://fair-agents.com) agents. The software is free (MIT); you pay a fixed price for the setup on your files. It reads files your IT team exports, on your own computer, and drafts notes. Every change to a live device, firewall, DNS zone, directory or cloud account stays one named person's click.
|
|
6
|
+
|
|
7
|
+
## What it checks
|
|
8
|
+
|
|
9
|
+
| Finding | What it means |
|
|
10
|
+
|---|---|
|
|
11
|
+
| `line_of_leaver` | A line still billed for someone who has left. |
|
|
12
|
+
| `unused_line` | A line with no calls and no data in each of the last months you set (still billed). |
|
|
13
|
+
| `roaming_spike` | Roaming charges on a line above your limit in the latest month. |
|
|
14
|
+
| `premium_charges` | Premium-rate or third-party charges on a line (often subscriptions nobody asked for). |
|
|
15
|
+
| `oversized_plan` | A line using a small share of its data allowance month after month (a smaller plan would do). |
|
|
16
|
+
| `two_lines_one_user` | One person with two or more active mobile lines. |
|
|
17
|
+
|
|
18
|
+
Findings come back worst first (high, medium, low). A finding a named person has reviewed can be accepted as known, with a reason and a date to look again; it then moves to "Accepted as known" instead of counting as open.
|
|
19
|
+
|
|
20
|
+
## Settings
|
|
21
|
+
|
|
22
|
+
Pass a settings file with `settings`. Every setting is optional; a misspelt setting is refused by name.
|
|
23
|
+
|
|
24
|
+
| Setting | What it does |
|
|
25
|
+
|---|---|
|
|
26
|
+
| `unused_months` | Months in a row with no use before a line is flagged (default 2) |
|
|
27
|
+
| `roaming_max` | Roaming charges in one month above which a line is flagged (default 50) |
|
|
28
|
+
| `plan_use_pct` | Share of the data allowance under which a plan counts as oversized, every month (default 20) |
|
|
29
|
+
|
|
30
|
+
## What it never does
|
|
31
|
+
|
|
32
|
+
- `carrier_cancel_line` is refused: Fairwire Telecom Bills never cancels, suspends or changes a line with the carrier.
|
|
33
|
+
- `carrier_dispute_charge` is refused: Fairwire Telecom Bills never files a dispute with the carrier; a person sends the reviewed list.
|
|
34
|
+
- `telecom_request_send` waits for one named person's click, even in Auto (`binding_send`).
|
|
35
|
+
- `telecom_accept_learning` waits for one named person's click, even in Auto (`accept_learning`).
|
|
36
|
+
- `telecom_retire_memory` waits for one named person's click, even in Auto (`accept_learning`).
|
|
37
|
+
- `carrier_cancel_line` waits for one named person's click, even in Auto (`production_deploy`).
|
|
38
|
+
- `carrier_dispute_charge` waits for one named person's click, even in Auto (`binding_send`).
|
|
39
|
+
|
|
40
|
+
<!-- generated:start -->
|
|
41
|
+
|
|
42
|
+
## A demo run
|
|
43
|
+
|
|
44
|
+
`npx -y fairwire-telecom-bills demo` runs the agent on the fictional files in [`fixtures/`](fixtures) in a temporary folder. Captured output:
|
|
45
|
+
|
|
46
|
+
```text
|
|
47
|
+
Fairwire Telecom Bills demo (fictional data) in a temporary folder, Auto on for the draft only
|
|
48
|
+
|
|
49
|
+
▶ Check the exported files
|
|
50
|
+
status: executed decision: allow
|
|
51
|
+
2026-10: 8 line(s) billed 562.49, roaming 267.5: 7 open finding(s), 1 high.
|
|
52
|
+
high line_of_leaver PERSON-7101624a
|
|
53
|
+
medium roaming_spike PERSON-d0bec31c
|
|
54
|
+
medium unused_line PERSON-a203c0f9
|
|
55
|
+
medium unused_line PERSON-3edeb565
|
|
56
|
+
low oversized_plan PERSON-9a2be67b
|
|
57
|
+
low premium_charges PERSON-be9a9b63
|
|
58
|
+
low two_lines_one_user PERSON-59dd52e6
|
|
59
|
+
|
|
60
|
+
▶ Explain one finding
|
|
61
|
+
status: executed decision: allow
|
|
62
|
+
medium roaming_spike: Line +TEL-d11473b6 (PERSON-d0bec31c) ran up 267.5 in roaming in 2026-10. Fix: Add a travel pass before trips, or cap roaming on the line.
|
|
63
|
+
|
|
64
|
+
▶ Write the worklist
|
|
65
|
+
status: executed decision: allow
|
|
66
|
+
Telecom bill review written: 2026-10: 8 line(s) billed 562.49, roaming 267.5: 7 open finding(s), 1 high.
|
|
67
|
+
|
|
68
|
+
▶ Draft the note for a person
|
|
69
|
+
status: executed decision: allow (auto)
|
|
70
|
+
cancellation list 2026-11-18 drafted with 1 open marker(s) ([TO CONFIRM telecom administrator]). Nothing was sent.
|
|
71
|
+
|
|
72
|
+
▶ Auto: approving it still waits for one named person
|
|
73
|
+
status: needs_approval decision: ask
|
|
74
|
+
reason: binding_send stays one-click, even in Auto
|
|
75
|
+
|
|
76
|
+
▶ The agent tries to change the live system itself
|
|
77
|
+
status: blocked decision: block
|
|
78
|
+
reason: Fairwire Telecom Bills never cancels, suspends or changes a line with the carrier.
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## Tools
|
|
82
|
+
|
|
83
|
+
| Tool | What it does | Policy |
|
|
84
|
+
|---|---|---|
|
|
85
|
+
| `telecom_check` | Review the latest month of line charges against earlier months and list leavers' lines, unused lines, roaming, premium charges, oversized plans and duplicate lines. | runs |
|
|
86
|
+
| `telecom_explain` | Every finding for one line. | runs |
|
|
87
|
+
| `telecom_write_report` | Write telecom-bills.csv (one row per finding, with blank owner and decision columns) and telecom-bills.html into out_dir (default fairwire-out/telecom). | runs |
|
|
88
|
+
| `telecom_draft_cancellation_list` | Write drafts/cancellation_list-<date>.md: the open findings at or above min_severity (default medium), each with what to do, addressed to telecom administrator. | asks first (Auto can be opted in) |
|
|
89
|
+
| `telecom_request_send` | After one named human click (even in Auto), record that the reviewed cancellation list draft is approved in cancellation_list-requests.csv. | one named click, even in Auto (`binding_send`) |
|
|
90
|
+
| `telecom_recall` | Search this agent's own memory of the customer's setup: accepted facts (in use) and facts waiting for a person. | runs |
|
|
91
|
+
| `telecom_learn` | Propose one fact about the customer's setup for this agent to remember. | runs |
|
|
92
|
+
| `telecom_accept_learning` | A named person accepts or rejects a fact waiting in this agent's memory. | one named click, even in Auto (`accept_learning`) |
|
|
93
|
+
| `telecom_retire_memory` | A named person stops an accepted fact from applying. | one named click, even in Auto (`accept_learning`) |
|
|
94
|
+
| `carrier_cancel_line` | Fairwire Telecom Bills never cancels, suspends or changes a line with the carrier. | refused |
|
|
95
|
+
| `carrier_dispute_charge` | Fairwire Telecom Bills never files a dispute with the carrier; a person sends the reviewed list. | refused |
|
|
96
|
+
|
|
97
|
+
Any tool name not in this table is blocked, including names a model invents. `refused` tools are listed so a model can see they exist and are refused.
|
|
98
|
+
|
|
99
|
+
## Columns it reads
|
|
100
|
+
|
|
101
|
+
Table inputs can be CSV, TSV, semicolon- or pipe-separated text, Excel `.xlsx`, JSON or JSONL. Columns are matched by the agent's own name, then by the English names below, then by their names in German, French, Spanish, Portuguese, Italian, Japanese, Chinese and Korean. Dates become `YYYY-MM-DD`; amounts and counts are read with either decimal mark. Every result lists under `sources` how each file was read.
|
|
102
|
+
|
|
103
|
+
### Telecom lines by month (`lines`)
|
|
104
|
+
|
|
105
|
+
| Column | Type | Also read as | For example, in other languages |
|
|
106
|
+
|---|---|---|---|
|
|
107
|
+
| `line_number` (required) | text | Line Number, Phone Number, Mobile Number, MSISDN, Number, Wireless Number | Rufnummer, Numéro de ligne, 回線番号, 号码 |
|
|
108
|
+
| `month` (required) | date | Month, Bill Period, Billing Period, Invoice Date, Bill Date | - |
|
|
109
|
+
| `user` | text | User, User Name, Employee, Assigned To, Subscriber | Benutzer, Utilisateur, ユーザー, 用户 |
|
|
110
|
+
| `line_type` | text | Line Type, Type, Service Type, Device Type | - |
|
|
111
|
+
| `plan` | text | Plan, Rate Plan, Tariff, Price Plan | Tarif, Forfait, 料金プラン, 套餐 |
|
|
112
|
+
| `monthly_charge` | amount | Monthly Charge, Total Charges, Total, Amount, Line Total | Betrag, Montant, 金額, 金额 |
|
|
113
|
+
| `data_gb` | number | Data (GB), Data Used (GB), Data GB, Data Usage | Daten (GB), Données (Go), データ通信量(GB), 流量(GB) |
|
|
114
|
+
| `data_allowance_gb` | number | Data Allowance (GB), Allowance GB, Plan Data (GB), Included Data | - |
|
|
115
|
+
| `minutes` | number | Minutes, Voice Minutes, Minutes Used, Call Minutes | Minuten, Minutes, 通話分数, 分钟数 |
|
|
116
|
+
| `roaming_charge` | amount | Roaming, Roaming Charges, International Roaming, Roaming Amount | - |
|
|
117
|
+
| `premium_charge` | amount | Premium, Premium Charges, Third Party Charges, Purchases, Content Charges | - |
|
|
118
|
+
|
|
119
|
+
### Leavers (`leavers`)
|
|
120
|
+
|
|
121
|
+
| Column | Type | Also read as | For example, in other languages |
|
|
122
|
+
|---|---|---|---|
|
|
123
|
+
| `user` (required) | text | User, Employee, Name, User Name | Benutzer, Utilisateur, ユーザー, 用户 |
|
|
124
|
+
| `end_date` (required) | date | End Date, Last Day, Termination Date, Leaving Date | Austrittsdatum, Date de sortie, 退職日, 离职日期 |
|
|
125
|
+
|
|
126
|
+
### Files from other countries
|
|
127
|
+
|
|
128
|
+
A German export in Windows-1252 with semicolons, `1.234,56` and `03.11.2026`, or a Japanese one in Shift_JIS with `2026/11/03`, is read the same way as the English file. [`fixtures/intl/`](fixtures/intl) has both versions of the demo data, and the eval cases `intl-de-*` and `intl-ja-*` require the same results as the English case. Columns named differently? Run `npx fairwire-telecom-bills inspect <file>` (names and shapes only, never values) and name them in `fairwire-sources.json`:
|
|
129
|
+
|
|
130
|
+
```json
|
|
131
|
+
{ "files": { "exports/devices.csv": { "columns": { "host": "Gerätename" }, "date_order": "dmy" } } }
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
## Memory
|
|
135
|
+
|
|
136
|
+
fairwire-telecom-bills can remember facts about your setup so the next run does not have to be told again. `telecom_learn` only proposes a fact; it changes nothing until a named person accepts it with `telecom_accept_learning`, which is one click even in Auto. Facts live in one hash-chained file per agent under `.fairwire/memory/`; if the chain does not verify, no fact is used. Credentials, personal identifiers and text that reads like instructions to an AI are refused. Run without memory with `--no-memory`.
|
|
137
|
+
|
|
138
|
+
| Kind | What an accepted fact changes |
|
|
139
|
+
|---|---|
|
|
140
|
+
| `known_exception` | that finding is listed under "Accepted as known" instead of as open, until review_by (when given) has passed. |
|
|
141
|
+
| `note` | nothing (shown by recall only) |
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
fairwire-telecom-bills memory list
|
|
145
|
+
fairwire-telecom-bills memory accept MEM-1a2b3c4d5e6f --as "Your Name"
|
|
146
|
+
fairwire-telecom-bills memory retire MEM-1a2b3c4d5e6f --as "Your Name" --reason "rule removed"
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
## Install
|
|
150
|
+
|
|
151
|
+
Node 20 or newer. No other dependencies.
|
|
152
|
+
|
|
153
|
+
```bash
|
|
154
|
+
npx -y fairwire-telecom-bills demo
|
|
155
|
+
npx -y fairwire-telecom-bills mcp --root /path/to/your/files
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
Claude Desktop, Cursor and other MCP hosts:
|
|
159
|
+
|
|
160
|
+
```json
|
|
161
|
+
{
|
|
162
|
+
"mcpServers": {
|
|
163
|
+
"fairwire-telecom-bills": {
|
|
164
|
+
"command": "npx",
|
|
165
|
+
"args": [
|
|
166
|
+
"-y",
|
|
167
|
+
"fairwire-telecom-bills",
|
|
168
|
+
"mcp",
|
|
169
|
+
"--root",
|
|
170
|
+
"/path/to/your/files"
|
|
171
|
+
]
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
Claude Code: `claude mcp add fairwire-telecom-bills -- npx -y fairwire-telecom-bills mcp --root .`, or install the `fairwire-telecom-bills` plugin from this repository's marketplace.
|
|
178
|
+
|
|
179
|
+
## Modes and approvals
|
|
180
|
+
|
|
181
|
+
- **Review** (`--mode review`): reads and reports only.
|
|
182
|
+
- **Assist** (default): the policy above. A tool that asks returns an `approval_id`; a person approves it once with `fairwire-telecom-bills approve <id> --as "Your Name"` (or on the local approvals page, `fairwire-telecom-bills approvals`), and the same call is repeated.
|
|
183
|
+
- **Auto** (`--mode auto --auto <tool,...>`): opt-in per tool, with step caps and a kill switch (`fairwire-telecom-bills kill`). Paying, sending, posting to a ledger or a live system and accepting a learned fact stay **one named click even in Auto**; an approval is tied to the sha256 of the reviewed draft, so a changed draft needs a new click.
|
|
184
|
+
|
|
185
|
+
## CLI
|
|
186
|
+
|
|
187
|
+
```bash
|
|
188
|
+
fairwire-telecom-bills tools # every tool, its policy and arguments
|
|
189
|
+
fairwire-telecom-bills sources # the columns each input is read from
|
|
190
|
+
fairwire-telecom-bills inspect <file> # how a file would be read (names and shapes, never values)
|
|
191
|
+
fairwire-telecom-bills call telecom_check '{"lines":"<lines>"}'
|
|
192
|
+
fairwire-telecom-bills eval # the private eval cases on the fictional fixtures
|
|
193
|
+
fairwire-telecom-bills demo
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
## Audit log and data
|
|
197
|
+
|
|
198
|
+
Every call is written to `.fairwire/audit.jsonl` under the root: hash-chained JSON lines, with arguments stored as a hash, signed with an Ed25519 key when you configure one. Everything runs on your machine on files you choose. No network calls, no telemetry, no credentials. The bundled fixtures are fictional.
|
|
199
|
+
|
|
200
|
+
<!-- generated:end -->
|
|
201
|
+
|
|
202
|
+
## Limits
|
|
203
|
+
|
|
204
|
+
- Reads only the files you export and give it. It does not log in to a firewall, switch, controller, cloud console, identity provider or any other live system.
|
|
205
|
+
- Use and charges are the carrier's figures; a line with no use may be a backup or alarm line on purpose.
|
|
206
|
+
- Thresholds are working defaults in a settings file you control; they are not a vendor rule, a requirement of any standard or a security guarantee.
|
|
207
|
+
- Results returned to the AI model have the names of people, sign-in names, e-mail addresses, phone numbers and client addresses masked. The files written here keep the real values: keep them in a secure folder.
|
|
208
|
+
- Totals are arithmetic on the numbers in your files, not forecasts or quotes.
|
|
209
|
+
- Export layouts were written from knowledge of common exports and have not been tested on live customer accounts. Run `inspect` on a new export and name columns in `fairwire-sources.json` when they differ.
|
|
210
|
+
|
|
211
|
+
## Licence
|
|
212
|
+
|
|
213
|
+
MIT. Fictional data only in `fixtures/`.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { fileURLToPath } from 'node:url';
|
|
3
|
+
import { main } from 'fairwire-core';
|
|
4
|
+
import { manifest } from '../src/manifest.js';
|
|
5
|
+
import { demo } from '../src/demo.js';
|
|
6
|
+
|
|
7
|
+
main(manifest, { bin: 'fairwire-telecom-bills', demo, evalFile: fileURLToPath(new URL('../evals/cases.json', import.meta.url)) });
|
package/evals/cases.json
ADDED
|
@@ -0,0 +1,358 @@
|
|
|
1
|
+
{
|
|
2
|
+
"suite": "fairwire-telecom-bills",
|
|
3
|
+
"root": "..",
|
|
4
|
+
"data_note": "Fictional telecom lines in ../fixtures for September and October 2026. No model is called.",
|
|
5
|
+
"cases": [
|
|
6
|
+
{
|
|
7
|
+
"id": "check-totals",
|
|
8
|
+
"tool": "telecom_check",
|
|
9
|
+
"args": {
|
|
10
|
+
"lines": "fixtures/lines.csv",
|
|
11
|
+
"leavers": "fixtures/leavers.csv",
|
|
12
|
+
"settings": "fixtures/settings.json"
|
|
13
|
+
},
|
|
14
|
+
"expect": {
|
|
15
|
+
"equals": {
|
|
16
|
+
"result.month": "2026-10",
|
|
17
|
+
"result.lines": 8,
|
|
18
|
+
"result.total": 562.49,
|
|
19
|
+
"result.roaming": 267.5,
|
|
20
|
+
"result.open": 7,
|
|
21
|
+
"result.high": 1
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"id": "every-planted-issue",
|
|
27
|
+
"tool": "telecom_check",
|
|
28
|
+
"args": {
|
|
29
|
+
"lines": "fixtures/lines.csv",
|
|
30
|
+
"leavers": "fixtures/leavers.csv",
|
|
31
|
+
"settings": "fixtures/settings.json"
|
|
32
|
+
},
|
|
33
|
+
"expect": {
|
|
34
|
+
"contains": [
|
|
35
|
+
"line_of_leaver",
|
|
36
|
+
"left on 2026-09-15",
|
|
37
|
+
"unused_line",
|
|
38
|
+
"landline",
|
|
39
|
+
"roaming_spike",
|
|
40
|
+
"267.5",
|
|
41
|
+
"premium_charges",
|
|
42
|
+
"9.99",
|
|
43
|
+
"oversized_plan",
|
|
44
|
+
"of a 50 GB plan",
|
|
45
|
+
"two_lines_one_user"
|
|
46
|
+
]
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"id": "numbers-and-names-masked",
|
|
51
|
+
"tool": "telecom_check",
|
|
52
|
+
"args": {
|
|
53
|
+
"lines": "fixtures/lines.csv",
|
|
54
|
+
"leavers": "fixtures/leavers.csv"
|
|
55
|
+
},
|
|
56
|
+
"expect": {
|
|
57
|
+
"not_contains": [
|
|
58
|
+
"555 0100",
|
|
59
|
+
"Ana Ortiz",
|
|
60
|
+
"Fay Nunez"
|
|
61
|
+
],
|
|
62
|
+
"matches": [
|
|
63
|
+
"TEL-[0-9a-f]{8}",
|
|
64
|
+
"PERSON-[0-9a-f]{8}"
|
|
65
|
+
]
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"id": "no-leaver-list",
|
|
70
|
+
"tool": "telecom_check",
|
|
71
|
+
"args": {
|
|
72
|
+
"lines": "fixtures/lines.csv"
|
|
73
|
+
},
|
|
74
|
+
"expect": {
|
|
75
|
+
"equals": {
|
|
76
|
+
"result.open": 6,
|
|
77
|
+
"result.high": 0
|
|
78
|
+
},
|
|
79
|
+
"not_contains": [
|
|
80
|
+
"line_of_leaver"
|
|
81
|
+
]
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"id": "higher-roaming-limit",
|
|
86
|
+
"tool": "telecom_check",
|
|
87
|
+
"args": {
|
|
88
|
+
"lines": "fixtures/lines.csv",
|
|
89
|
+
"settings": "fixtures/settings-roaming.json"
|
|
90
|
+
},
|
|
91
|
+
"expect": {
|
|
92
|
+
"not_contains": [
|
|
93
|
+
"roaming_spike"
|
|
94
|
+
],
|
|
95
|
+
"equals": {
|
|
96
|
+
"result.open": 5
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"id": "draft-after-approval",
|
|
102
|
+
"tool": "telecom_draft_cancellation_list",
|
|
103
|
+
"approve": "Pat Example",
|
|
104
|
+
"args": {
|
|
105
|
+
"lines": "fixtures/lines.csv",
|
|
106
|
+
"leavers": "fixtures/leavers.csv",
|
|
107
|
+
"settings": "fixtures/settings.json"
|
|
108
|
+
},
|
|
109
|
+
"expect": {
|
|
110
|
+
"status": "executed",
|
|
111
|
+
"contains": [
|
|
112
|
+
"Nothing was sent"
|
|
113
|
+
],
|
|
114
|
+
"equals": {
|
|
115
|
+
"result.items": 4,
|
|
116
|
+
"result.open_markers": 1
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
"id": "explain-line",
|
|
122
|
+
"tool": "telecom_explain",
|
|
123
|
+
"args": {
|
|
124
|
+
"lines": "fixtures/lines.csv",
|
|
125
|
+
"leavers": "fixtures/leavers.csv",
|
|
126
|
+
"settings": "fixtures/settings.json",
|
|
127
|
+
"line": "+1 555 0100 204"
|
|
128
|
+
},
|
|
129
|
+
"expect": {
|
|
130
|
+
"contains": [
|
|
131
|
+
"roaming_spike"
|
|
132
|
+
],
|
|
133
|
+
"equals": {
|
|
134
|
+
"result.findings": 1
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
"id": "review-mode-still-reads",
|
|
140
|
+
"tool": "telecom_check",
|
|
141
|
+
"mode": "review",
|
|
142
|
+
"args": {
|
|
143
|
+
"lines": "fixtures/lines.csv",
|
|
144
|
+
"leavers": "fixtures/leavers.csv",
|
|
145
|
+
"settings": "fixtures/settings.json"
|
|
146
|
+
},
|
|
147
|
+
"expect": {
|
|
148
|
+
"status": "executed",
|
|
149
|
+
"equals": {
|
|
150
|
+
"result.month": "2026-10",
|
|
151
|
+
"result.lines": 8,
|
|
152
|
+
"result.total": 562.49,
|
|
153
|
+
"result.roaming": 267.5,
|
|
154
|
+
"result.open": 7,
|
|
155
|
+
"result.high": 1
|
|
156
|
+
}
|
|
157
|
+
},
|
|
158
|
+
"generated": true
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
"id": "severity-filter",
|
|
162
|
+
"tool": "telecom_check",
|
|
163
|
+
"args": {
|
|
164
|
+
"lines": "fixtures/lines.csv",
|
|
165
|
+
"leavers": "fixtures/leavers.csv",
|
|
166
|
+
"settings": "fixtures/settings.json",
|
|
167
|
+
"severity": "high"
|
|
168
|
+
},
|
|
169
|
+
"expect": {
|
|
170
|
+
"status": "executed",
|
|
171
|
+
"equals": {
|
|
172
|
+
"result.findings": 1
|
|
173
|
+
}
|
|
174
|
+
},
|
|
175
|
+
"generated": true
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
"id": "missing-argument-named",
|
|
179
|
+
"tool": "telecom_check",
|
|
180
|
+
"args": {},
|
|
181
|
+
"expect": {
|
|
182
|
+
"status": "error",
|
|
183
|
+
"contains": [
|
|
184
|
+
"lines"
|
|
185
|
+
]
|
|
186
|
+
},
|
|
187
|
+
"generated": true
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
"id": "file-outside-root-refused",
|
|
191
|
+
"tool": "telecom_check",
|
|
192
|
+
"args": {
|
|
193
|
+
"lines": "../../../outside.csv",
|
|
194
|
+
"leavers": "fixtures/leavers.csv",
|
|
195
|
+
"settings": "fixtures/settings.json"
|
|
196
|
+
},
|
|
197
|
+
"expect": {
|
|
198
|
+
"status": "error",
|
|
199
|
+
"contains": [
|
|
200
|
+
"outside"
|
|
201
|
+
]
|
|
202
|
+
},
|
|
203
|
+
"generated": true
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
"id": "invented-tool-name-refused",
|
|
207
|
+
"tool": "telecom_apply_every_fix_now",
|
|
208
|
+
"args": {},
|
|
209
|
+
"expect": {
|
|
210
|
+
"status": "blocked"
|
|
211
|
+
},
|
|
212
|
+
"generated": true
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
"id": "write-report-writes-files",
|
|
216
|
+
"tool": "telecom_write_report",
|
|
217
|
+
"args": {
|
|
218
|
+
"lines": "fixtures/lines.csv",
|
|
219
|
+
"leavers": "fixtures/leavers.csv",
|
|
220
|
+
"settings": "fixtures/settings.json"
|
|
221
|
+
},
|
|
222
|
+
"expect": {
|
|
223
|
+
"status": "executed",
|
|
224
|
+
"contains": [
|
|
225
|
+
"telecom-bills.csv",
|
|
226
|
+
"telecom-bills.html"
|
|
227
|
+
]
|
|
228
|
+
},
|
|
229
|
+
"generated": true
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
"id": "recall-memory-starts-empty",
|
|
233
|
+
"tool": "telecom_recall",
|
|
234
|
+
"args": {},
|
|
235
|
+
"expect": {
|
|
236
|
+
"status": "executed",
|
|
237
|
+
"contains": [
|
|
238
|
+
"memory is empty"
|
|
239
|
+
]
|
|
240
|
+
},
|
|
241
|
+
"generated": true
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
"id": "accept-learning-stays-one-click",
|
|
245
|
+
"tool": "telecom_accept_learning",
|
|
246
|
+
"mode": "auto",
|
|
247
|
+
"args": {
|
|
248
|
+
"id": "MEM-000000000000",
|
|
249
|
+
"decision": "accept"
|
|
250
|
+
},
|
|
251
|
+
"expect": {
|
|
252
|
+
"status": "needs_approval"
|
|
253
|
+
},
|
|
254
|
+
"generated": true
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
"id": "never-carrier-cancel-line",
|
|
258
|
+
"tool": "carrier_cancel_line",
|
|
259
|
+
"mode": "auto",
|
|
260
|
+
"args": {},
|
|
261
|
+
"expect": {
|
|
262
|
+
"status": "blocked"
|
|
263
|
+
},
|
|
264
|
+
"generated": true
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
"id": "never-carrier-dispute-charge",
|
|
268
|
+
"tool": "carrier_dispute_charge",
|
|
269
|
+
"mode": "auto",
|
|
270
|
+
"args": {},
|
|
271
|
+
"expect": {
|
|
272
|
+
"status": "blocked"
|
|
273
|
+
},
|
|
274
|
+
"generated": true
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
"id": "draft-waits-for-a-person",
|
|
278
|
+
"tool": "telecom_draft_cancellation_list",
|
|
279
|
+
"args": {
|
|
280
|
+
"lines": "fixtures/lines.csv",
|
|
281
|
+
"leavers": "fixtures/leavers.csv",
|
|
282
|
+
"settings": "fixtures/settings.json"
|
|
283
|
+
},
|
|
284
|
+
"expect": {
|
|
285
|
+
"status": "needs_approval",
|
|
286
|
+
"decision": "ask"
|
|
287
|
+
},
|
|
288
|
+
"generated": true
|
|
289
|
+
},
|
|
290
|
+
{
|
|
291
|
+
"id": "review-mode-drafts-nothing",
|
|
292
|
+
"tool": "telecom_draft_cancellation_list",
|
|
293
|
+
"mode": "review",
|
|
294
|
+
"args": {
|
|
295
|
+
"lines": "fixtures/lines.csv",
|
|
296
|
+
"leavers": "fixtures/leavers.csv",
|
|
297
|
+
"settings": "fixtures/settings.json"
|
|
298
|
+
},
|
|
299
|
+
"expect": {
|
|
300
|
+
"status": "blocked"
|
|
301
|
+
},
|
|
302
|
+
"generated": true
|
|
303
|
+
},
|
|
304
|
+
{
|
|
305
|
+
"id": "request-stays-one-click",
|
|
306
|
+
"tool": "telecom_request_send",
|
|
307
|
+
"mode": "auto",
|
|
308
|
+
"args": {
|
|
309
|
+
"draft": "fixtures/README.md",
|
|
310
|
+
"draft_sha256": "0000000000000000000000000000000000000000000000000000000000000000"
|
|
311
|
+
},
|
|
312
|
+
"expect": {
|
|
313
|
+
"status": "needs_approval"
|
|
314
|
+
},
|
|
315
|
+
"generated": true
|
|
316
|
+
},
|
|
317
|
+
{
|
|
318
|
+
"id": "intl-de-check-totals",
|
|
319
|
+
"tool": "telecom_check",
|
|
320
|
+
"args": {
|
|
321
|
+
"lines": "fixtures/intl/de/lines.csv",
|
|
322
|
+
"leavers": "fixtures/intl/de/leavers.csv",
|
|
323
|
+
"settings": "fixtures/settings.json"
|
|
324
|
+
},
|
|
325
|
+
"expect": {
|
|
326
|
+
"equals": {
|
|
327
|
+
"result.month": "2026-10",
|
|
328
|
+
"result.lines": 8,
|
|
329
|
+
"result.total": 562.49,
|
|
330
|
+
"result.roaming": 267.5,
|
|
331
|
+
"result.open": 7,
|
|
332
|
+
"result.high": 1
|
|
333
|
+
}
|
|
334
|
+
},
|
|
335
|
+
"note": "German export of the same data (fixtures/intl/de); must match the English case \"check-totals\"."
|
|
336
|
+
},
|
|
337
|
+
{
|
|
338
|
+
"id": "intl-ja-check-totals",
|
|
339
|
+
"tool": "telecom_check",
|
|
340
|
+
"args": {
|
|
341
|
+
"lines": "fixtures/intl/ja/lines.csv",
|
|
342
|
+
"leavers": "fixtures/intl/ja/leavers.csv",
|
|
343
|
+
"settings": "fixtures/settings.json"
|
|
344
|
+
},
|
|
345
|
+
"expect": {
|
|
346
|
+
"equals": {
|
|
347
|
+
"result.month": "2026-10",
|
|
348
|
+
"result.lines": 8,
|
|
349
|
+
"result.total": 562.49,
|
|
350
|
+
"result.roaming": 267.5,
|
|
351
|
+
"result.open": 7,
|
|
352
|
+
"result.high": 1
|
|
353
|
+
}
|
|
354
|
+
},
|
|
355
|
+
"note": "Japanese export of the same data (fixtures/intl/ja); must match the English case \"check-totals\"."
|
|
356
|
+
}
|
|
357
|
+
]
|
|
358
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# Fairwire Telecom Bills fixtures
|
|
2
|
+
|
|
3
|
+
Fictional telecom bill lines for September and October 2026. Numbers use the 555 fiction range.
|
|
4
|
+
|
|
5
|
+
- `lines.csv`: 8 lines over two months. Ben Kim uses 2 to 3 GB of a 50 GB plan; Cy Diaz and the reception landline have no use at all; Dee Lee ran up 267.50 in roaming; Eli Moss has a 9.99 premium charge; Ana Ortiz has two mobile lines; Fay Nunez left in September but her line is still billed.
|
|
6
|
+
- `leavers.csv`: one leaver.
|
|
7
|
+
- `settings.json`: roaming above 50 and two months without use are flagged.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# Fixtures from other countries
|
|
2
|
+
|
|
3
|
+
Generated by `node scripts/make-intl-fixtures.mjs` from the English fixtures one
|
|
4
|
+
folder up. The same fictional data, written the way a local export writes it:
|
|
5
|
+
|
|
6
|
+
- `de/`: German column names, Windows-1252 text, semicolons, comma decimals
|
|
7
|
+
(1.234,56), day-first dotted dates (03.11.2026), kilograms and kilometres.
|
|
8
|
+
- `ja/`: Japanese column names, Shift_JIS text, year-first dates (2026/11/03),
|
|
9
|
+
kilograms and kilometres.
|
|
10
|
+
|
|
11
|
+
Values (names, codes, charge wording) stay in English. The eval cases
|
|
12
|
+
`intl-de-*` and `intl-ja-*` expect exactly the same results as the English case.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
month;Rufnummer;Benutzer;line_type;Tarif;Betrag;Daten (GB);data_allowance_gb;Minuten;roaming_charge;premium_charge
|
|
2
|
+
01.09.2026;+1 555 0100 201;Ana Ortiz;Mobile;Business 50GB;45,00;12;50;320;0,00;0,00
|
|
3
|
+
01.10.2026;+1 555 0100 201;Ana Ortiz;Mobile;Business 50GB;45,00;14;50;300;0,00;0,00
|
|
4
|
+
01.09.2026;+1 555 0100 202;Ben Kim;Mobile;Business 50GB;45,00;3;50;200;0,00;0,00
|
|
5
|
+
01.10.2026;+1 555 0100 202;Ben Kim;Mobile;Business 50GB;45,00;2;50;180;0,00;0,00
|
|
6
|
+
01.09.2026;+1 555 0100 203;Cy Diaz;Mobile;Business 50GB;45,00;0;50;0;0,00;0,00
|
|
7
|
+
01.10.2026;+1 555 0100 203;Cy Diaz;Mobile;Business 50GB;45,00;0;50;0;0,00;0,00
|
|
8
|
+
01.09.2026;+1 555 0100 204;Dee Lee;Mobile;Business 50GB;45,00;20;50;400;0,00;0,00
|
|
9
|
+
01.10.2026;+1 555 0100 204;Dee Lee;Mobile;Business 50GB;312,50;25;50;410;267,50;0,00
|
|
10
|
+
01.09.2026;+1 555 0100 205;Eli Moss;Mobile;Business 20GB;30,00;8;20;150;0,00;0,00
|
|
11
|
+
01.10.2026;+1 555 0100 205;Eli Moss;Mobile;Business 20GB;39,99;9;20;140;0,00;9,99
|
|
12
|
+
01.09.2026;+1 555 0100 206;Ana Ortiz;Mobile;Data 10GB;20,00;4;10;0;0,00;0,00
|
|
13
|
+
01.10.2026;+1 555 0100 206;Ana Ortiz;Mobile;Data 10GB;20,00;5;10;0;0,00;0,00
|
|
14
|
+
01.09.2026;+1 555 0100 207;Fay Nunez;Mobile;Business 20GB;30,00;6;20;90;0,00;0,00
|
|
15
|
+
01.10.2026;+1 555 0100 207;Fay Nunez;Mobile;Business 20GB;30,00;7;20;95;0,00;0,00
|
|
16
|
+
01.09.2026;+1 555 0300 100;Reception;Landline;Fixed basic;25,00;;;0;0,00;0,00
|
|
17
|
+
01.10.2026;+1 555 0300 100;Reception;Landline;Fixed basic;25,00;;;0;0,00;0,00
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
month,����ԍ�,���[�U�[,line_type,�����v����,���z,�f�[�^�ʐM�ʁiGB�j,data_allowance_gb,�ʘb����,roaming_charge,premium_charge
|
|
2
|
+
2026/09/01,+1 555 0100 201,Ana Ortiz,Mobile,Business 50GB,45.00,12,50,320,0.00,0.00
|
|
3
|
+
2026/10/01,+1 555 0100 201,Ana Ortiz,Mobile,Business 50GB,45.00,14,50,300,0.00,0.00
|
|
4
|
+
2026/09/01,+1 555 0100 202,Ben Kim,Mobile,Business 50GB,45.00,3,50,200,0.00,0.00
|
|
5
|
+
2026/10/01,+1 555 0100 202,Ben Kim,Mobile,Business 50GB,45.00,2,50,180,0.00,0.00
|
|
6
|
+
2026/09/01,+1 555 0100 203,Cy Diaz,Mobile,Business 50GB,45.00,0,50,0,0.00,0.00
|
|
7
|
+
2026/10/01,+1 555 0100 203,Cy Diaz,Mobile,Business 50GB,45.00,0,50,0,0.00,0.00
|
|
8
|
+
2026/09/01,+1 555 0100 204,Dee Lee,Mobile,Business 50GB,45.00,20,50,400,0.00,0.00
|
|
9
|
+
2026/10/01,+1 555 0100 204,Dee Lee,Mobile,Business 50GB,312.50,25,50,410,267.50,0.00
|
|
10
|
+
2026/09/01,+1 555 0100 205,Eli Moss,Mobile,Business 20GB,30.00,8,20,150,0.00,0.00
|
|
11
|
+
2026/10/01,+1 555 0100 205,Eli Moss,Mobile,Business 20GB,39.99,9,20,140,0.00,9.99
|
|
12
|
+
2026/09/01,+1 555 0100 206,Ana Ortiz,Mobile,Data 10GB,20.00,4,10,0,0.00,0.00
|
|
13
|
+
2026/10/01,+1 555 0100 206,Ana Ortiz,Mobile,Data 10GB,20.00,5,10,0,0.00,0.00
|
|
14
|
+
2026/09/01,+1 555 0100 207,Fay Nunez,Mobile,Business 20GB,30.00,6,20,90,0.00,0.00
|
|
15
|
+
2026/10/01,+1 555 0100 207,Fay Nunez,Mobile,Business 20GB,30.00,7,20,95,0.00,0.00
|
|
16
|
+
2026/09/01,+1 555 0300 100,Reception,Landline,Fixed basic,25.00,,,0,0.00,0.00
|
|
17
|
+
2026/10/01,+1 555 0300 100,Reception,Landline,Fixed basic,25.00,,,0,0.00,0.00
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
month,line_number,user,line_type,plan,monthly_charge,data_gb,data_allowance_gb,minutes,roaming_charge,premium_charge
|
|
2
|
+
2026-09-01,+1 555 0100 201,Ana Ortiz,Mobile,Business 50GB,45,12,50,320,0,0
|
|
3
|
+
2026-10-01,+1 555 0100 201,Ana Ortiz,Mobile,Business 50GB,45,14,50,300,0,0
|
|
4
|
+
2026-09-01,+1 555 0100 202,Ben Kim,Mobile,Business 50GB,45,3,50,200,0,0
|
|
5
|
+
2026-10-01,+1 555 0100 202,Ben Kim,Mobile,Business 50GB,45,2,50,180,0,0
|
|
6
|
+
2026-09-01,+1 555 0100 203,Cy Diaz,Mobile,Business 50GB,45,0,50,0,0,0
|
|
7
|
+
2026-10-01,+1 555 0100 203,Cy Diaz,Mobile,Business 50GB,45,0,50,0,0,0
|
|
8
|
+
2026-09-01,+1 555 0100 204,Dee Lee,Mobile,Business 50GB,45,20,50,400,0,0
|
|
9
|
+
2026-10-01,+1 555 0100 204,Dee Lee,Mobile,Business 50GB,312.5,25,50,410,267.5,0
|
|
10
|
+
2026-09-01,+1 555 0100 205,Eli Moss,Mobile,Business 20GB,30,8,20,150,0,0
|
|
11
|
+
2026-10-01,+1 555 0100 205,Eli Moss,Mobile,Business 20GB,39.99,9,20,140,0,9.99
|
|
12
|
+
2026-09-01,+1 555 0100 206,Ana Ortiz,Mobile,Data 10GB,20,4,10,0,0,0
|
|
13
|
+
2026-10-01,+1 555 0100 206,Ana Ortiz,Mobile,Data 10GB,20,5,10,0,0,0
|
|
14
|
+
2026-09-01,+1 555 0100 207,Fay Nunez,Mobile,Business 20GB,30,6,20,90,0,0
|
|
15
|
+
2026-10-01,+1 555 0100 207,Fay Nunez,Mobile,Business 20GB,30,7,20,95,0,0
|
|
16
|
+
2026-09-01,+1 555 0300 100,Reception,Landline,Fixed basic,25,,,0,0,0
|
|
17
|
+
2026-10-01,+1 555 0300 100,Reception,Landline,Fixed basic,25,,,0,0,0
|
package/package.json
CHANGED
|
@@ -1,6 +1,59 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fairwire-telecom-bills",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"description": "
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"mcpName": "io.github.fpavia111-creator/fairwire-telecom-bills",
|
|
5
|
+
"description": "Fairwire Telecom Bills: Telecom bill review: mobile lines with no use for months, lines still billed for people who left, roaming and premium charges, plans much bigger than the use, two lines for one person and fixed lines nobody calls from. Phone numbers masked for the model. Drafts cancellation lists; never cancels a line.",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"author": "Kurt Francisco",
|
|
9
|
+
"engines": {
|
|
10
|
+
"node": ">=20"
|
|
11
|
+
},
|
|
12
|
+
"main": "src/index.js",
|
|
13
|
+
"exports": {
|
|
14
|
+
".": "./src/index.js",
|
|
15
|
+
"./package.json": "./package.json"
|
|
16
|
+
},
|
|
17
|
+
"bin": {
|
|
18
|
+
"fairwire-telecom-bills": "bin/fairwire-telecom-bills.js"
|
|
19
|
+
},
|
|
20
|
+
"files": [
|
|
21
|
+
"src",
|
|
22
|
+
"bin",
|
|
23
|
+
"fixtures",
|
|
24
|
+
"evals",
|
|
25
|
+
"README.md",
|
|
26
|
+
"CHANGELOG.md",
|
|
27
|
+
"LICENSE",
|
|
28
|
+
"server.json"
|
|
29
|
+
],
|
|
30
|
+
"scripts": {
|
|
31
|
+
"test": "node scripts/run-tests.cjs",
|
|
32
|
+
"demo": "node bin/fairwire-telecom-bills.js demo",
|
|
33
|
+
"eval": "node bin/fairwire-telecom-bills.js eval"
|
|
34
|
+
},
|
|
35
|
+
"dependencies": {
|
|
36
|
+
"fairwire-core": "^0.1.0"
|
|
37
|
+
},
|
|
38
|
+
"repository": {
|
|
39
|
+
"type": "git",
|
|
40
|
+
"url": "git+https://github.com/fpavia111-creator/fairwire-agents.git",
|
|
41
|
+
"directory": "packages/fairwire-telecom-bills"
|
|
42
|
+
},
|
|
43
|
+
"homepage": "https://github.com/fpavia111-creator/fairwire-agents/tree/master/packages/fairwire-telecom-bills#readme",
|
|
44
|
+
"bugs": {
|
|
45
|
+
"url": "https://github.com/fpavia111-creator/fairwire-agents/issues"
|
|
46
|
+
},
|
|
47
|
+
"keywords": [
|
|
48
|
+
"mcp",
|
|
49
|
+
"mcp-server",
|
|
50
|
+
"it-operations",
|
|
51
|
+
"network",
|
|
52
|
+
"fairwire",
|
|
53
|
+
"telecom-expense",
|
|
54
|
+
"mobile-bill",
|
|
55
|
+
"roaming",
|
|
56
|
+
"tem",
|
|
57
|
+
"cost-review"
|
|
58
|
+
]
|
|
59
|
+
}
|
package/server.json
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
|
|
3
|
+
"name": "io.github.fpavia111-creator/fairwire-telecom-bills",
|
|
4
|
+
"title": "Fairwire Telecom Bills",
|
|
5
|
+
"description": "Fairwire Telecom Bills: Telecom bill review: mobile lines with no use for months, lines still…",
|
|
6
|
+
"version": "0.1.0",
|
|
7
|
+
"repository": {
|
|
8
|
+
"url": "https://github.com/fpavia111-creator/fairwire-agents",
|
|
9
|
+
"source": "github",
|
|
10
|
+
"subfolder": "packages/fairwire-telecom-bills"
|
|
11
|
+
},
|
|
12
|
+
"websiteUrl": "https://fair-agents.com/fairwire.html",
|
|
13
|
+
"packages": [
|
|
14
|
+
{
|
|
15
|
+
"registryType": "npm",
|
|
16
|
+
"identifier": "fairwire-telecom-bills",
|
|
17
|
+
"version": "0.1.0",
|
|
18
|
+
"transport": {
|
|
19
|
+
"type": "stdio"
|
|
20
|
+
},
|
|
21
|
+
"packageArguments": [
|
|
22
|
+
{
|
|
23
|
+
"type": "positional",
|
|
24
|
+
"value": "mcp"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"type": "named",
|
|
28
|
+
"name": "--root",
|
|
29
|
+
"description": "Folder holding the exports this agent may read and write (it cannot reach outside it)",
|
|
30
|
+
"isRequired": true,
|
|
31
|
+
"format": "filepath",
|
|
32
|
+
"valueHint": "exports_folder"
|
|
33
|
+
}
|
|
34
|
+
]
|
|
35
|
+
}
|
|
36
|
+
]
|
|
37
|
+
}
|
package/src/demo.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { fileURLToPath } from 'node:url';
|
|
2
|
+
import { readFileSync } from 'node:fs';
|
|
3
|
+
import { standardDemo } from 'fairwire-core';
|
|
4
|
+
|
|
5
|
+
// The demo runs the eval case "check-totals" and the agent's draft on the fictional fixtures.
|
|
6
|
+
const cases = JSON.parse(readFileSync(new URL('../evals/cases.json', import.meta.url), 'utf8')).cases;
|
|
7
|
+
const base = cases.find((c) => c.id === 'check-totals');
|
|
8
|
+
const explain = cases.find((c) => /_explain$/.test(c.tool) && !c.expect.status);
|
|
9
|
+
const draft = cases.find((c) => /_draft_/.test(c.tool) && c.approve);
|
|
10
|
+
|
|
11
|
+
export async function demo(manifest) {
|
|
12
|
+
const refused = manifest.tools.filter((t) => (manifest.policy.rules.find((r) => r.tool === t.name) || {}).decision === 'block')[0];
|
|
13
|
+
await standardDemo(manifest, fileURLToPath(new URL('../fixtures', import.meta.url)), {
|
|
14
|
+
title: 'Fairwire Telecom Bills demo', args: base.args,
|
|
15
|
+
explain: explain ? { label: 'Explain one finding', args: explain.args } : null,
|
|
16
|
+
draft: draft ? { label: 'Draft the note for a person', args: draft.args } : null,
|
|
17
|
+
refused: refused ? refused.name : null,
|
|
18
|
+
});
|
|
19
|
+
}
|
package/src/index.js
ADDED
package/src/logic.js
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
// Fairwire Telecom Bills: telecom bill review (mobile and fixed lines). Pure functions.
|
|
2
|
+
import { num, str, low, monthOf, isoDate, round2, finding } from 'fairwire-core';
|
|
3
|
+
|
|
4
|
+
export const CHECKS = Object.freeze({
|
|
5
|
+
line_of_leaver: 'A line still billed for someone who has left.',
|
|
6
|
+
unused_line: 'A line with no calls and no data in each of the last months you set (still billed).',
|
|
7
|
+
roaming_spike: 'Roaming charges on a line above your limit in the latest month.',
|
|
8
|
+
premium_charges: 'Premium-rate or third-party charges on a line (often subscriptions nobody asked for).',
|
|
9
|
+
oversized_plan: 'A line using a small share of its data allowance month after month (a smaller plan would do).',
|
|
10
|
+
two_lines_one_user: 'One person with two or more active mobile lines.',
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
export const LINE_FIELDS = Object.freeze({
|
|
14
|
+
line_number: { aliases: ['Line Number', 'Phone Number', 'Mobile Number', 'MSISDN', 'Number', 'Wireless Number'], required: true, pii: 'phone' },
|
|
15
|
+
month: { type: 'date', aliases: ['Month', 'Bill Period', 'Billing Period', 'Invoice Date', 'Bill Date'], required: true },
|
|
16
|
+
user: { aliases: ['User', 'User Name', 'Employee', 'Assigned To', 'Subscriber'], pii: 'name' },
|
|
17
|
+
line_type: { aliases: ['Line Type', 'Type', 'Service Type', 'Device Type'] },
|
|
18
|
+
plan: { aliases: ['Plan', 'Rate Plan', 'Tariff', 'Price Plan'] },
|
|
19
|
+
monthly_charge: { type: 'money', aliases: ['Monthly Charge', 'Total Charges', 'Total', 'Amount', 'Line Total'] },
|
|
20
|
+
data_gb: { type: 'number', aliases: ['Data (GB)', 'Data Used (GB)', 'Data GB', 'Data Usage'] },
|
|
21
|
+
data_allowance_gb: { type: 'number', aliases: ['Data Allowance (GB)', 'Allowance GB', 'Plan Data (GB)', 'Included Data'] },
|
|
22
|
+
minutes: { type: 'number', aliases: ['Minutes', 'Voice Minutes', 'Minutes Used', 'Call Minutes'] },
|
|
23
|
+
roaming_charge: { type: 'money', aliases: ['Roaming', 'Roaming Charges', 'International Roaming', 'Roaming Amount'] },
|
|
24
|
+
premium_charge: { type: 'money', aliases: ['Premium', 'Premium Charges', 'Third Party Charges', 'Purchases', 'Content Charges'] },
|
|
25
|
+
});
|
|
26
|
+
export const LEAVER_FIELDS = Object.freeze({
|
|
27
|
+
user: { aliases: ['User', 'Employee', 'Name', 'User Name'], required: true, pii: 'name' },
|
|
28
|
+
end_date: { type: 'date', aliases: ['End Date', 'Last Day', 'Termination Date', 'Leaving Date'], required: true },
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
export const SETTINGS_SCHEMA = { type: 'object', additionalProperties: false, properties: {
|
|
32
|
+
unused_months: { type: 'integer', minimum: 1, description: 'Months in a row with no use before a line is flagged (default 2)' },
|
|
33
|
+
roaming_max: { type: 'number', minimum: 0, description: 'Roaming charges in one month above which a line is flagged (default 50)' },
|
|
34
|
+
plan_use_pct: { type: 'number', minimum: 1, maximum: 100, description: 'Share of the data allowance under which a plan counts as oversized, every month (default 20)' },
|
|
35
|
+
} };
|
|
36
|
+
export const DEFAULTS = Object.freeze({ unused_months: 2, roaming_max: 50, plan_use_pct: 20 });
|
|
37
|
+
|
|
38
|
+
export function reviewTelecom(rows, leaverRows = [], settings = {}) {
|
|
39
|
+
const s = { ...DEFAULTS, ...settings };
|
|
40
|
+
const ls = rows.filter((r) => str(r.line_number) && monthOf(r.month)).map((r) => ({ line: str(r.line_number), month: monthOf(r.month), user: str(r.user), type: low(r.line_type) || 'mobile', plan: str(r.plan), charge: num(r.monthly_charge) || 0, data: num(r.data_gb), allow: num(r.data_allowance_gb), minutes: num(r.minutes), roaming: num(r.roaming_charge) || 0, premium: num(r.premium_charge) || 0 }));
|
|
41
|
+
const months = [...new Set(ls.map((l) => l.month))].sort(); const cur = months.at(-1);
|
|
42
|
+
const byLine = new Map(); for (const l of ls) byLine.set(l.line, [...(byLine.get(l.line) || []), l]);
|
|
43
|
+
const leavers = new Map(leaverRows.filter((r) => str(r.user) && isoDate(r.end_date)).map((r) => [low(r.user), isoDate(r.end_date)]));
|
|
44
|
+
const items = []; const userLines = new Map();
|
|
45
|
+
for (const [line, list] of byLine) {
|
|
46
|
+
list.sort((a, b) => (a.month < b.month ? -1 : 1));
|
|
47
|
+
const last = list.at(-1); if (last.month !== cur) continue; const user = last.user;
|
|
48
|
+
const end = user && leavers.get(low(user));
|
|
49
|
+
if (end && end < `${cur}-01`) items.push(finding('line_of_leaver', 'high', line, `Line ${line} is still billed (${last.charge} in ${cur}) for ${user}, who left on ${end}.`, 'Cancel the line or move it to the person who took over the role.', { subject: user, amount: last.charge }));
|
|
50
|
+
const recent = list.slice(-s.unused_months);
|
|
51
|
+
const unused = recent.length >= s.unused_months && recent.every((m) => (m.data ?? 0) === 0 && (m.minutes ?? 0) === 0);
|
|
52
|
+
if (unused) items.push(finding('unused_line', 'medium', line, `Line ${line} (${last.type}${user ? `, ${user}` : ''}) had no calls or data for ${recent.length} month(s) but cost ${round2(recent.reduce((t, m) => t + m.charge, 0))}.`, 'Confirm with the user, then suspend or cancel it.', { subject: user || line, amount: last.charge }));
|
|
53
|
+
if (last.roaming > s.roaming_max) items.push(finding('roaming_spike', 'medium', line, `Line ${line}${user ? ` (${user})` : ''} ran up ${last.roaming} in roaming in ${cur}.`, 'Add a travel pass before trips, or cap roaming on the line.', { subject: user || line, amount: last.roaming }));
|
|
54
|
+
if (last.premium > 0) items.push(finding('premium_charges', 'low', line, `Line ${line} has ${last.premium} in premium or third-party charges in ${cur}.`, 'Ask the carrier to block premium services on company lines and to refund unrequested ones.', { subject: user || line, amount: last.premium }));
|
|
55
|
+
const withAllow = list.filter((m) => m.allow && m.data !== null);
|
|
56
|
+
if (!unused && withAllow.length >= 2 && withAllow.every((m) => (100 * m.data) / m.allow < s.plan_use_pct)) items.push(finding('oversized_plan', 'low', line, `Line ${line} used at most ${Math.max(...withAllow.map((m) => m.data))} GB of a ${withAllow.at(-1).allow} GB plan in ${withAllow.length} months.`, 'Move it to a smaller plan at the next change window.', { subject: user || line }));
|
|
57
|
+
if (user && /mobile|cell|wireless|smartphone|phone/.test(last.type)) userLines.set(low(user), [...(userLines.get(low(user)) || []), { line, user }]);
|
|
58
|
+
}
|
|
59
|
+
for (const [, list] of userLines) if (list.length > 1) items.push(finding('two_lines_one_user', 'low', list[0].user, `${list[0].user} has ${list.length} active mobile lines (${list.map((x) => x.line).sort().join(', ')}).`, 'Check whether both are needed (a work phone and a data-only device is common).', { subject: list[0].user }));
|
|
60
|
+
const now = ls.filter((l) => l.month === cur);
|
|
61
|
+
return { month: cur || null, lines: now.length, total: round2(now.reduce((t, l) => t + l.charge, 0)), roaming: round2(now.reduce((t, l) => t + l.roaming, 0)), items };
|
|
62
|
+
}
|
package/src/manifest.js
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { readFileSync } from 'node:fs';
|
|
2
|
+
import { wireAgent, fileArg, SETTINGS_ARG, settingsFrom, LIMITS } from 'fairwire-core';
|
|
3
|
+
import { LINE_FIELDS, LEAVER_FIELDS, SETTINGS_SCHEMA, DEFAULTS, reviewTelecom } from './logic.js';
|
|
4
|
+
|
|
5
|
+
const pkg = JSON.parse(readFileSync(new URL('../package.json', import.meta.url), 'utf8'));
|
|
6
|
+
const args = {
|
|
7
|
+
lines: fileArg('Telecom bill detail under --root (carrier portal or telecom expense export as CSV, Excel or JSON) covering at least two months: one row per line per month with number, user, type, plan, charges, data and minutes used, allowance, roaming and premium charges'),
|
|
8
|
+
leavers: fileArg('Optional list of people who left, with their last day'),
|
|
9
|
+
settings: SETTINGS_ARG('unused_months, roaming_max, plan_use_pct'),
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export const manifest = wireAgent({
|
|
13
|
+
pkg, prefix: 'telecom', title: 'Fairwire Telecom Bills',
|
|
14
|
+
description: 'Reviews telecom bills: lines still billed for leavers, lines with no use for months, roaming spikes, premium and third-party charges, plans much bigger than the use and people with two mobile lines. Phone numbers and names are masked for the model. Drafts cancellation lists; never cancels a line.',
|
|
15
|
+
args, required: ['lines'],
|
|
16
|
+
sources: { lines: { label: 'Telecom lines by month', args: ['lines'], fields: LINE_FIELDS }, leavers: { label: 'Leavers', args: ['leavers'], fields: LEAVER_FIELDS } },
|
|
17
|
+
configSchemas: { telecom_settings: SETTINGS_SCHEMA },
|
|
18
|
+
run: (a, ctx) => reviewTelecom(ctx.records(a.lines, 'lines'), a.leavers ? ctx.records(a.leavers, 'leavers') : [], settingsFrom(a, ctx, 'telecom_settings', DEFAULTS)),
|
|
19
|
+
summary: (o) => `${o.month ? `${o.month}: ${o.lines} line(s) billed ${o.total}, roaming ${o.roaming}` : 'No lines'}: ${o.open} open finding(s), ${o.high} high.`,
|
|
20
|
+
check: { title: 'Review the telecom bill', description: 'Review the latest month of line charges against earlier months and list leavers\' lines, unused lines, roaming, premium charges, oversized plans and duplicate lines.' },
|
|
21
|
+
explain: { arg: 'line', argSchema: { type: 'string', maxLength: 100, description: 'Line number from telecom_check (the pseudonym is fine)' }, title: 'Explain one line', description: 'Every finding for one line.', match: (i, v, ctx) => i.key === v || (ctx.pii && ctx.pii.same(i.key, v, 'phone')) },
|
|
22
|
+
report: {
|
|
23
|
+
title: 'Telecom bill review', base: 'telecom-bills',
|
|
24
|
+
limits: [LIMITS.files, 'Use and charges are the carrier\'s figures; a line with no use may be a backup or alarm line on purpose.', LIMITS.defaults, LIMITS.pii, LIMITS.estimate],
|
|
25
|
+
},
|
|
26
|
+
note: { noun: 'cancellation_list', verb: 'send', category: 'binding_send', actor: 'the telecom owner', to: 'telecom administrator', subject: 'Lines to cancel or change', ask: 'Please confirm each line with its user or manager before anything is cancelled with the carrier.' },
|
|
27
|
+
refused: [
|
|
28
|
+
{ name: 'carrier_cancel_line', category: 'production_deploy', description: 'Fairwire Telecom Bills never cancels, suspends or changes a line with the carrier.' },
|
|
29
|
+
{ name: 'carrier_dispute_charge', category: 'binding_send', description: 'Fairwire Telecom Bills never files a dispute with the carrier; a person sends the reviewed list.' },
|
|
30
|
+
],
|
|
31
|
+
prompt: { title: 'Review the telecom bill', description: 'Walks the host model through a telecom bill review with Fairwire Telecom Bills.', text: 'You are helping an IT or finance lead review telecom bills with fairwire-telecom-bills. Numbers and names are pseudonyms. 1. Call telecom_check; lead with leavers\' lines and unused lines. 2. Use telecom_explain for a line. 3. Call telecom_write_report (the file has real numbers). 4. Offer telecom_draft_cancellation_list; telecom_request_send waits for one named click.' },
|
|
32
|
+
});
|