@datarails-ai/dr-cli 1.6.73 → 1.6.75
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/README.md +12 -11
- package/dist/cli.js +930 -313
- package/dist/scopes-map.json +25 -1
- package/dist/skills/dr-cli/SKILL.md +6 -5
- package/dist/skills/dr-cli/reference/datamappers.md +6 -0
- package/dist/skills/dr-cli/reference/multi-product.md +1 -1
- package/dist/skills/dr-cli/reference/safety.md +3 -2
- package/dist/skills/dr-cli/reference/templates.md +1 -1
- package/dist/skills/dr-error-enrichment/SKILL.md +1 -1
- package/dist/skills/dr-error-enrichment/reference/groundcover.md +3 -2
- package/dist/skills/dr-error-enrichment/reference/safety-backup.md +2 -2
- package/dist/skills/dr-error-enrichment-improve/SKILL.md +1 -1
- package/dist/skills/dr-filebox-api-setup/SKILL.md +3 -3
- package/dist/skills/dr-switch-user/SKILL.md +3 -3
- package/dist/skills/fx-conversion-matrix/SKILL.md +1 -1
- package/dist/skills/mec-table-validation/SKILL.md +2 -2
- package/package.json +3 -2
package/dist/scopes-map.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 1,
|
|
3
|
-
"cliVersion": "1.6.
|
|
3
|
+
"cliVersion": "1.6.75",
|
|
4
4
|
"_contract": "Resolve a command path through `aliases` (canonical prefix + alias segment -> canonical path) before any lookup. A path listed in `pendingCommands`, or whose first segment is a key of `pending`, is UNDECIDED, not unrestricted: fail closed or skip it, and never read a path's absence from `commands` as 'no requirement'. An entry carrying `denied` is UNAVAILABLE to any AGENT-SCOPED credential — one whose `scopes` claim carries at least one `resource:action` entry; a claim that is absent, empty, capability-only or wholly unparseable is UNRESTRICTED, and this mark does not apply to it — whatever else that entry says: it is not a ceiling and it is not always-available, its `denied.reason` says why and `denied.until` names the ticket that lifts it, and the absence of `requires` on it must NEVER be read as 'no requirement'. Only an entry in `commands` with an empty `requires` means always-available.",
|
|
5
5
|
"commands": {
|
|
6
6
|
"login": {
|
|
@@ -763,6 +763,30 @@
|
|
|
763
763
|
}
|
|
764
764
|
]
|
|
765
765
|
},
|
|
766
|
+
"odata tables": {
|
|
767
|
+
"requires": [
|
|
768
|
+
{
|
|
769
|
+
"resource": "tables",
|
|
770
|
+
"action": "read"
|
|
771
|
+
}
|
|
772
|
+
]
|
|
773
|
+
},
|
|
774
|
+
"odata metadata": {
|
|
775
|
+
"requires": [
|
|
776
|
+
{
|
|
777
|
+
"resource": "tables",
|
|
778
|
+
"action": "read"
|
|
779
|
+
}
|
|
780
|
+
]
|
|
781
|
+
},
|
|
782
|
+
"odata data": {
|
|
783
|
+
"requires": [
|
|
784
|
+
{
|
|
785
|
+
"resource": "tables",
|
|
786
|
+
"action": "read"
|
|
787
|
+
}
|
|
788
|
+
]
|
|
789
|
+
},
|
|
766
790
|
"storyboards list": {
|
|
767
791
|
"requires": [
|
|
768
792
|
{
|
|
@@ -23,7 +23,8 @@ for any command come from `dr <command> --help` (the binary is authoritative).
|
|
|
23
23
|
`register-identity`, `bulk-create`, `bulk-set-email`, `bulk-permissions`,
|
|
24
24
|
`set-email`, `set-email-notifications`, `bulk-set-email-notifications`,
|
|
25
25
|
`set-password`, `set-field-type`) — on `US`, `US2`, `UK`, `CA`,
|
|
26
|
-
`EU`, `DEMO` (DEMO is a customer-facing prod tenant, not a sandbox
|
|
26
|
+
`EU`, `STUDIO`, `DEMO` (DEMO is a customer-facing prod tenant, not a sandbox;
|
|
27
|
+
STUDIO is the free-tier environment and holds real prospects' data) must be
|
|
27
28
|
confirmed by the user before you run them. `register-identity --confirm` in
|
|
28
29
|
particular sends real invite emails to customers, so it counts as a prod
|
|
29
30
|
write. Demonstrate on `DEV` / `DEV-1` / `TEST` / `TEST-1`..`TEST-7` first when
|
|
@@ -40,7 +41,7 @@ for any command come from `dr <command> --help` (the binary is authoritative).
|
|
|
40
41
|
dialog (or TTY prompt) where the *user* types a fresh challenge word; in a
|
|
41
42
|
headless shell it refuses non-zero. Don't add your own word ritual in chat.
|
|
42
43
|
Non-prod (`DEV`/`DEV-1`/`TEST`/`TEST-1`..`TEST-7`) is token-only, a plain
|
|
43
|
-
"yes" suffices; `DEMO`
|
|
44
|
+
"yes" suffices; `DEMO` and `STUDIO` count as prod. Details in
|
|
44
45
|
[reference/safety.md](reference/safety.md).
|
|
45
46
|
4. **Credentials are sensitive.** Sessions live in the OS keychain, or in a
|
|
46
47
|
credential file where one is in use — never extract or echo JWTs or session
|
|
@@ -103,7 +104,7 @@ update it in the file alongside the key, or the warning keeps naming the old
|
|
|
103
104
|
one.
|
|
104
105
|
|
|
105
106
|
`--server <KEY>` is **required on every command that hits an API**. Valid keys:
|
|
106
|
-
`US`, `US2`, `UK`, `CA`, `EU`, `DEV`, `DEV-1`, `TEST`, `TEST-1`, `TEST-2`, `TEST-3`, `TEST-4`, `TEST-5`, `TEST-6`, `TEST-7`, `DEMO` (case-insensitive).
|
|
107
|
+
`US`, `US2`, `UK`, `CA`, `EU`, `STUDIO`, `DEV`, `DEV-1`, `TEST`, `TEST-1`, `TEST-2`, `TEST-3`, `TEST-4`, `TEST-5`, `TEST-6`, `TEST-7`, `DEMO` (case-insensitive).
|
|
107
108
|
|
|
108
109
|
You can also pass a full **`https://<host>.datarails.com` URL** instead of a
|
|
109
110
|
key to reach an ad-hoc / PR-preview environment, e.g.
|
|
@@ -539,8 +540,8 @@ returns the source rows behind the number.
|
|
|
539
540
|
counts — and a token; re-run with `--confirm-token` to fire it) → poll `scans
|
|
540
541
|
status` again. This is a **full historical** rescan (every calc field × every
|
|
541
542
|
version). To only pick up a datamapper change on the live template, prefer
|
|
542
|
-
`datamappers update <id> --rescan latest` (latest version
|
|
543
|
-
|
|
543
|
+
`datamappers update <id> --rescan latest` (latest version of the mapper's bound
|
|
544
|
+
documents only) — far cheaper and lower-blast.
|
|
544
545
|
|
|
545
546
|
**Build a `create` body from plain-English intent** (calc models, datamappers,
|
|
546
547
|
metrics): you resolve names → integer IDs yourself against the tenant
|
|
@@ -67,6 +67,12 @@ value-inference behavior. `NAME` is the target **table field** name (the
|
|
|
67
67
|
## Update / preview / bind / delete
|
|
68
68
|
|
|
69
69
|
- `datamappers update`, `datamappers delete` (two-step confirm).
|
|
70
|
+
- `datamappers update --rescan latest` — after the PUT, dr watches the
|
|
71
|
+
template's scan status for up to 30s, because servers without the DR-54200 fix
|
|
72
|
+
save the config but ignore `rescan: "latest"`. If no new scan shows up, it
|
|
73
|
+
prints a warning with a ready `datamappers bind <id> --doc … --rescan latest`
|
|
74
|
+
command. Run `scans status <template_id>` first: the scan may only be queued,
|
|
75
|
+
and `bind` on a queued scan starts a second one. Don't re-run `update`.
|
|
70
76
|
- `datamappers preview --payload-file <p>` — renders mapper output for sample
|
|
71
77
|
input ("what would this extract?") before saving.
|
|
72
78
|
- `datamappers bind <mapper_id> --doc <id> [--rescan latest|all]` — change which
|
|
@@ -117,7 +117,7 @@ org 99.
|
|
|
117
117
|
|
|
118
118
|
Token TTL is 10 minutes — past that, re-run step 1.
|
|
119
119
|
|
|
120
|
-
For prod (`US`/`US2`/`UK`/`CA`/`EU`/`DEMO`), get the user's in-chat "yes" before
|
|
120
|
+
For prod (`US`/`US2`/`UK`/`CA`/`EU`/`STUDIO`/`DEMO`), get the user's in-chat "yes" before
|
|
121
121
|
re-invoking with the token; the binary's interactive gate then has the user
|
|
122
122
|
type a challenge word in a dialog, same as any other destructive write — see
|
|
123
123
|
[safety.md](safety.md).
|
|
@@ -38,7 +38,8 @@ Reads never need confirmation. Gated **writes** fall into two tiers (full table:
|
|
|
38
38
|
`src/commands/_prodGateTiers.ts`):
|
|
39
39
|
|
|
40
40
|
- **Tier A — destructive / irreversible / org-wide.** On a prod tenant (`US`,
|
|
41
|
-
`US2`, `UK`, `CA`, `EU`, `DEMO` — DEMO is customer-facing
|
|
41
|
+
`US2`, `UK`, `CA`, `EU`, `STUDIO`, `DEMO` — DEMO is customer-facing, STUDIO holds
|
|
42
|
+
real prospects' data) the binary requires a
|
|
42
43
|
live human to type a fresh challenge word in a desktop dialog / TTY (see
|
|
43
44
|
"Binary-enforced interactive gate" below). Relay the plan output (target name
|
|
44
45
|
+ blast radius), get a clear in-chat "yes, do it", then re-invoke with
|
|
@@ -105,7 +106,7 @@ the LUT that 4 functions depend on" — before running.
|
|
|
105
106
|
|
|
106
107
|
The human check is enforced **in the binary** — not by prose an agent could
|
|
107
108
|
skip or forget. When a valid `--confirm-token` is redeemed for a **Tier-A**
|
|
108
|
-
action against a prod tenant (`US`, `US2`, `UK`, `CA`, `EU`, `DEMO` — plus,
|
|
109
|
+
action against a prod tenant (`US`, `US2`, `UK`, `CA`, `EU`, `STUDIO`, `DEMO` — plus,
|
|
109
110
|
fail-closed, any server the CLI cannot positively classify as non-prod, and any
|
|
110
111
|
action not positively classified as Tier B), the binary requires a live human:
|
|
111
112
|
|
|
@@ -150,7 +150,7 @@ except on `update`, which resolves the range's own table automatically.
|
|
|
150
150
|
`--confirm-token` — token-only, no word gate even on prod (a rescan re-derives
|
|
151
151
|
data, it doesn't delete it). To pick up a datamapper change on the live template
|
|
152
152
|
**without** touching history, use `datamappers update <id> --rescan latest`
|
|
153
|
-
instead (
|
|
153
|
+
instead (re-extracts the latest version of the mapper's bound documents); a full rescan will re-run pre-existing
|
|
154
154
|
calc fields against old rows, so a latent divide-by-null there fails the whole
|
|
155
155
|
scan. Refuses `UsageStats` on every tenant (system data, not customer-owned).
|
|
156
156
|
- `dataflow get` — the dependency graph: inputs → mappers → LUTs → table →
|
|
@@ -67,7 +67,7 @@ These hold in every sub-skill; the detail is in
|
|
|
67
67
|
[reference/safety-backup.md](reference/safety-backup.md).
|
|
68
68
|
|
|
69
69
|
1. **Confirm the target server explicitly** — ask, never infer it from earlier
|
|
70
|
-
conversation. `US`, `US2`, `UK`, `CA`, `EU`, `DEMO` are all prod.
|
|
70
|
+
conversation. `US`, `US2`, `UK`, `CA`, `EU`, `STUDIO`, `DEMO` are all prod.
|
|
71
71
|
2. **Back up every reachable server before the first write** of a session, not
|
|
72
72
|
just the target — the export is also the diff baseline. One command:
|
|
73
73
|
`dr error-enrichments export --all-servers --out <dir>`. Tell the user the
|
|
@@ -64,9 +64,10 @@ Groundcover envs are not dr-cli server keys. Envs are `prod-us`, `prod-east-us`,
|
|
|
64
64
|
| `DEMO` | `prod-demo` |
|
|
65
65
|
| `US` / `US2` | **ambiguous** across `prod-us`, `prod-east-us`, `prod-west-us-2` |
|
|
66
66
|
| `EU` | **unmapped** — resolve it before mining (see below) |
|
|
67
|
+
| `STUDIO` | **unmapped** — resolve it before mining (see below) |
|
|
67
68
|
|
|
68
|
-
`EU`
|
|
69
|
-
groundcover
|
|
69
|
+
`EU` and `STUDIO` were added to the registry after this table was written and
|
|
70
|
+
their groundcover envs have not been confirmed. Resolve them the same way as the US
|
|
70
71
|
ambiguity before mining, and record the answer here once known.
|
|
71
72
|
|
|
72
73
|
Resolve the US ambiguity with
|
|
@@ -9,8 +9,8 @@ reading.
|
|
|
9
9
|
|
|
10
10
|
**1. Confirm the target server explicitly.** Ask (AskUserQuestion) which server
|
|
11
11
|
to change — never infer it from earlier context in the conversation. Prod keys
|
|
12
|
-
are `US`, `US2`, `UK`, `CA`, `EU`, `DEMO` (DEMO is customer-facing prod, not a
|
|
13
|
-
sandbox). Demonstrate on `DEV` / `TEST-*` first when the user is undecided.
|
|
12
|
+
are `US`, `US2`, `UK`, `CA`, `EU`, `STUDIO`, `DEMO` (DEMO is customer-facing prod, not a
|
|
13
|
+
sandbox; STUDIO is the free-tier environment and holds real prospects' data). Demonstrate on `DEV` / `TEST-*` first when the user is undecided.
|
|
14
14
|
|
|
15
15
|
**2. Back up every reachable server first.** Before the first write of a
|
|
16
16
|
session, one command — `export` takes the same sweep flags as `list` / `stats`,
|
|
@@ -44,7 +44,7 @@ fixing disliked rules is `dr-error-enrichment-maintain`.
|
|
|
44
44
|
**1. Pick the region and the window, and prove they line up.** Ask which server
|
|
45
45
|
the user intends to improve, then map it to the groundcover env before querying —
|
|
46
46
|
`UK` is `prod-uk*`, `CA` is `prod-canada-central`, `DEMO` is `prod-demo`, and
|
|
47
|
-
`US`/`US2` are ambiguous across the three US envs and `EU`
|
|
47
|
+
`US`/`US2` are ambiguous across the three US envs and `EU` and `STUDIO` are not mapped at
|
|
48
48
|
all, so resolve those explicitly (see the reference). Mining one region's logs to justify a rule you then write to
|
|
49
49
|
another is the failure mode this step exists to prevent. Start with a tight
|
|
50
50
|
window and widen only after it returns rows.
|
|
@@ -23,7 +23,7 @@ Before issuing any commands, confirm the following with the user if not already
|
|
|
23
23
|
| Input | How to resolve |
|
|
24
24
|
|---|---|
|
|
25
25
|
| **Target fileboxes** | IDs/names, or a folder name to expand — run `dr filebox list --server <S>` and filter by parent folder ID |
|
|
26
|
-
| **Server** | Ask if not obvious from context (`US`, `US2`, `UK`, `CA`, `EU`, `DEV`, `DEV-1`, `TEST`, `TEST-1`, `TEST-2`, `TEST-3`, `TEST-4`, `TEST-5`, `TEST-6`, `TEST-7`, `DEMO`) |
|
|
26
|
+
| **Server** | Ask if not obvious from context (`US`, `US2`, `UK`, `CA`, `EU`, `STUDIO`, `DEV`, `DEV-1`, `TEST`, `TEST-1`, `TEST-2`, `TEST-3`, `TEST-4`, `TEST-5`, `TEST-6`, `TEST-7`, `DEMO`) |
|
|
27
27
|
| **Connection** | Run `dr integrations list --server <S>` and show the WorkatoBased options; ask the user to pick |
|
|
28
28
|
| **Object type** | Ask — commonly `table`; surface the value from a reference filebox if one exists |
|
|
29
29
|
| **Start date / End date** | Ask — commonly "start of month" / "end of month", which maps to `{{date_tag|somonth}}` / `{{date_tag|eomonth}}` |
|
|
@@ -69,7 +69,7 @@ If no reference exists, build the payload from the gathered inputs (see Step 4).
|
|
|
69
69
|
|
|
70
70
|
## Step 3 — Enable Upload via API on all target fileboxes
|
|
71
71
|
|
|
72
|
-
Run in parallel for efficiency. This is a prod write — confirm with the user before running on `US`, `US2`, `UK`, `CA`, `EU`, `DEMO`.
|
|
72
|
+
Run in parallel for efficiency. This is a prod write — confirm with the user before running on `US`, `US2`, `UK`, `CA`, `EU`, `STUDIO`, `DEMO`.
|
|
73
73
|
|
|
74
74
|
```bash
|
|
75
75
|
dr documents support-api set <id1> --on --server <S> &
|
|
@@ -152,7 +152,7 @@ Offer to export the table as a CSV if the user wants it.
|
|
|
152
152
|
|
|
153
153
|
## Guard rails
|
|
154
154
|
|
|
155
|
-
- **Prod confirmation required.** `support_api` and `data-query set` are writes. On `US`, `US2`, `UK`, `CA`, `EU`, `DEMO`, confirm in-chat before running.
|
|
155
|
+
- **Prod confirmation required.** `support_api` and `data-query set` are writes. On `US`, `US2`, `UK`, `CA`, `EU`, `STUDIO`, `DEMO`, confirm in-chat before running.
|
|
156
156
|
- **Never read out tokens or JWTs.** The UUID returned is not a secret, but session tokens are — do not surface them.
|
|
157
157
|
- **Always verify the integration ID from `dr integrations list`** — do not guess or reuse IDs from a prior session without confirming they match the current tenant.
|
|
158
158
|
- **Always quote file paths** in `--payload-file` on Windows to handle spaces in directory names.
|
|
@@ -53,7 +53,7 @@ The skill is invoked in one of these forms:
|
|
|
53
53
|
|
|
54
54
|
## Server keys (the universe to probe)
|
|
55
55
|
|
|
56
|
-
`US`, `US2`, `UK`, `CA`, `EU`, `DEV`, `DEV-1`, `TEST`, `TEST-1`, `TEST-2`, `TEST-3`, `TEST-4`, `TEST-5`, `TEST-6`, `TEST-7`, `DEMO` — case-insensitive.
|
|
56
|
+
`US`, `US2`, `UK`, `CA`, `EU`, `STUDIO`, `DEV`, `DEV-1`, `TEST`, `TEST-1`, `TEST-2`, `TEST-3`, `TEST-4`, `TEST-5`, `TEST-6`, `TEST-7`, `DEMO` — case-insensitive.
|
|
57
57
|
These are the only valid `--server` values dr-cli accepts.
|
|
58
58
|
|
|
59
59
|
---
|
|
@@ -82,7 +82,7 @@ across all servers wastes turns and can scope the default wrongly.
|
|
|
82
82
|
Print verbatim, then wait for the user's reply. Do not guess from
|
|
83
83
|
context, prior turns, or `userEmail`:
|
|
84
84
|
|
|
85
|
-
> Which server should I switch to `<email>` on? (`US`, `US2`, `UK`, `CA`, `EU`, `DEV`, `DEV-1`, `TEST`, `TEST-1`, `TEST-2`, `TEST-3`, `TEST-4`, `TEST-5`, `TEST-6`, `TEST-7`, `DEMO`)
|
|
85
|
+
> Which server should I switch to `<email>` on? (`US`, `US2`, `UK`, `CA`, `EU`, `STUDIO`, `DEV`, `DEV-1`, `TEST`, `TEST-1`, `TEST-2`, `TEST-3`, `TEST-4`, `TEST-5`, `TEST-6`, `TEST-7`, `DEMO`)
|
|
86
86
|
|
|
87
87
|
### 2.2. Probe that one server
|
|
88
88
|
|
|
@@ -226,7 +226,7 @@ Use the **single-loop pattern** (same reason as Section 2 — parallel
|
|
|
226
226
|
tool calls cancel each other on the first non-zero exit):
|
|
227
227
|
|
|
228
228
|
```bash
|
|
229
|
-
for srv in US US2 UK CA EU DEV DEV-1 TEST TEST-1 TEST-2 TEST-3 TEST-4 TEST-5 TEST-6 TEST-7 DEMO; do
|
|
229
|
+
for srv in US US2 UK CA EU STUDIO DEV DEV-1 TEST TEST-1 TEST-2 TEST-3 TEST-4 TEST-5 TEST-6 TEST-7 DEMO; do
|
|
230
230
|
echo "=== $srv ==="
|
|
231
231
|
dr whoami --server "$srv" 2>&1 || true
|
|
232
232
|
done
|
|
@@ -728,7 +728,7 @@ the package layout reaches every producer.
|
|
|
728
728
|
|
|
729
729
|
- **Every write here is prod-tier.** Functions, filebox, mappers, lookups and custom
|
|
730
730
|
currencies are all mutations. Confirm before running on `US`, `US2`, `UK`, `CA`,
|
|
731
|
-
`EU` — **and on `DEMO`**, which is a customer-facing demo tenant, not a sandbox.
|
|
731
|
+
`EU`, `STUDIO` — **and on `DEMO`**, which is a customer-facing demo tenant, not a sandbox.
|
|
732
732
|
Prefer a `DEV`/`TEST*` rehearsal when the org is unstated.
|
|
733
733
|
- **Never guess a currency, a base, or a missing pair.** Each is a question for the
|
|
734
734
|
customer. A wrong rate mislabels real money and nobody downstream can tell.
|
|
@@ -38,8 +38,8 @@ config before the operator wastes time debugging downstream symptoms.
|
|
|
38
38
|
|
|
39
39
|
## Inputs
|
|
40
40
|
|
|
41
|
-
- `--server <key>` — required. Valid: `US`, `US2`, `UK`, `CA`, `EU`, `
|
|
42
|
-
`DEV-1`, `TEST`, `TEST-1`, `TEST-2`, `TEST-3`, `TEST-4`, `TEST-5`,
|
|
41
|
+
- `--server <key>` — required. Valid: `US`, `US2`, `UK`, `CA`, `EU`, `STUDIO`,
|
|
42
|
+
`DEV`, `DEV-1`, `TEST`, `TEST-1`, `TEST-2`, `TEST-3`, `TEST-4`, `TEST-5`,
|
|
43
43
|
`TEST-6`, `TEST-7`, `DEMO` (case-insensitive). Default per project
|
|
44
44
|
convention: `US`.
|
|
45
45
|
- `--report` — optional. Writes a markdown report to cwd in addition to
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@datarails-ai/dr-cli",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.75",
|
|
4
4
|
"description": "Datarails CLI",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -17,10 +17,11 @@
|
|
|
17
17
|
"access": "public"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@datarails-ai/dr-appspace-cli": "0.9.
|
|
20
|
+
"@datarails-ai/dr-appspace-cli": "0.9.7",
|
|
21
21
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
22
22
|
"@napi-rs/keyring": "^1.3.0",
|
|
23
23
|
"commander": "^12.1.0",
|
|
24
|
+
"fast-xml-parser": "^5.11.2",
|
|
24
25
|
"jszip": "^3.10.1",
|
|
25
26
|
"node-html-parser": "^6.1.13",
|
|
26
27
|
"open": "^10.1.0",
|