@koda-sl/baker-cli 0.417.0-dev.933ebc23d → 0.418.0-dev.6af3f5093
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 +55 -7
- package/dist/{chunk-HFH5HQTP.js → chunk-3FJU7BNQ.js} +2 -2
- package/dist/{chunk-TTBMFAGF.js → chunk-6V6B7RPR.js} +4 -4
- package/dist/{chunk-D76DSHL2.js → chunk-AKX7S6ZW.js} +15 -28
- package/dist/chunk-AKX7S6ZW.js.map +1 -0
- package/dist/{chunk-FQ7WNNOG.js → chunk-HTPY7G2Y.js} +4 -8
- package/dist/{chunk-FQ7WNNOG.js.map → chunk-HTPY7G2Y.js.map} +1 -1
- package/dist/{chunk-4RN4CBIQ.js → chunk-LMMZ3FAC.js} +3 -3
- package/dist/{chunk-VF77MVEM.js → chunk-OEI3NLGH.js} +11 -3
- package/dist/chunk-OEI3NLGH.js.map +1 -0
- package/dist/cli.js +8805 -6538
- package/dist/cli.js.map +1 -1
- package/dist/{client-OA2QMHOI.js → client-6CLQVK65.js} +4 -4
- package/dist/engine/index.js +3 -3
- package/dist/{env-Q5FUIVIJ.js → env-ZJLFGNH5.js} +4 -2
- package/dist/output-BTVIL27G.js +22 -0
- package/dist/{shared-PD226SU6.js → shared-C5EZVLDS.js} +6 -6
- package/package.json +1 -1
- package/dist/chunk-D76DSHL2.js.map +0 -1
- package/dist/chunk-VF77MVEM.js.map +0 -1
- package/dist/output-NMXF2VIL.js +0 -18
- /package/dist/{chunk-HFH5HQTP.js.map → chunk-3FJU7BNQ.js.map} +0 -0
- /package/dist/{chunk-TTBMFAGF.js.map → chunk-6V6B7RPR.js.map} +0 -0
- /package/dist/{chunk-4RN4CBIQ.js.map → chunk-LMMZ3FAC.js.map} +0 -0
- /package/dist/{client-OA2QMHOI.js.map → client-6CLQVK65.js.map} +0 -0
- /package/dist/{env-Q5FUIVIJ.js.map → env-ZJLFGNH5.js.map} +0 -0
- /package/dist/{output-NMXF2VIL.js.map → output-BTVIL27G.js.map} +0 -0
- /package/dist/{shared-PD226SU6.js.map → shared-C5EZVLDS.js.map} +0 -0
package/README.md
CHANGED
|
@@ -1109,10 +1109,23 @@ baker ads linkedin analytics --level campaign --campaign-id 1234 \
|
|
|
1109
1109
|
# "Top companies seeing this campaign" (ABM feedback loop) — org names auto-resolved
|
|
1110
1110
|
baker ads linkedin top-companies --campaign-id 1234 --last-days 30
|
|
1111
1111
|
|
|
1112
|
+
# "Which companies are our ads reaching?" — one row per company over the whole period,
|
|
1113
|
+
# most engaged first ({org, name, impressions, clicks, engagements, costLocal}).
|
|
1114
|
+
# Defaults: last 12 calendar months, the only selected ad account, top 100 (--full for all).
|
|
1115
|
+
baker ads linkedin companies --account-id 1234
|
|
1116
|
+
baker ads linkedin companies --by month --min-impressions 50 # months[] per company
|
|
1117
|
+
baker ads linkedin companies --campaign-id 1,2 --by campaign # campaigns[] per company
|
|
1118
|
+
baker ads linkedin companies --with-domains --stats --output csv # + domain/domainSource; read-quality stats
|
|
1119
|
+
|
|
1112
1120
|
# "Who are these org URNs?" — resolve org URNs to company names (probe leakage)
|
|
1113
1121
|
baker ads linkedin resolve --urns urn:li:organization:17719,urn:li:organization:19022
|
|
1114
1122
|
baker ads linkedin resolve --ids 17719,19022 --output csv
|
|
1115
1123
|
|
|
1124
|
+
# "What are these companies' website domains?" — for matching against CRM companies.
|
|
1125
|
+
# Per org: vanityName (LinkedIn page), website, domain, domainSource (website | subdomain | none);
|
|
1126
|
+
# ids LinkedIn doesn't know land in `errors`. Shortlinks are never followed.
|
|
1127
|
+
baker ads linkedin resolve --ids 1035,1337 --with-domains
|
|
1128
|
+
|
|
1116
1129
|
# "Who is in our audience by industry/seniority/function/title — all at once?"
|
|
1117
1130
|
baker ads linkedin demographics --campaign-id 1234 --last-days 30
|
|
1118
1131
|
|
|
@@ -1181,6 +1194,7 @@ creatives # default ACTIVE intended-status
|
|
|
1181
1194
|
|
|
1182
1195
|
analytics # see "Smart defaults" above (3-axis: level × intent × pivot)
|
|
1183
1196
|
demographics # sweep all firmographic pivots in one call
|
|
1197
|
+
companies # which companies the ads reached, one row per company (--by month|campaign, --with-domains)
|
|
1184
1198
|
top-companies # pivot=MEMBER_COMPANY shortcut (ABM)
|
|
1185
1199
|
conversation # pivot=CONVERSATION_NODE_BUTTON shortcut (Sponsored Messaging)
|
|
1186
1200
|
|
|
@@ -1200,6 +1214,7 @@ audit --format md # deliverable-ready markdown table
|
|
|
1200
1214
|
campaign-groups create|update|pause|resume|duplicate # staged writes (see below)
|
|
1201
1215
|
campaigns create|update|pause|resume|archive|duplicate
|
|
1202
1216
|
campaigns url-params <ad-set-id> # UTMs for every ad in the ad set
|
|
1217
|
+
campaigns exclude-companies <ad-set-id> --org <ids> # stop an ad set reaching these companies
|
|
1203
1218
|
account url-params # UTMs for every ad in the whole account
|
|
1204
1219
|
url-params [--ad-sets] # read what is tagged now, and what lands twice
|
|
1205
1220
|
creatives create|update|pause|resume|duplicate
|
|
@@ -1240,9 +1255,16 @@ baker ads linkedin account url-params --param "utm_source=linkedin&utm_medium=pa
|
|
|
1240
1255
|
baker ads linkedin campaigns update 123456 --audience-expansion off --lan off
|
|
1241
1256
|
baker ads linkedin campaigns update 123456 --bid 7.50 --daily-budget 100 --currency USD
|
|
1242
1257
|
|
|
1243
|
-
# Matched audiences (CSV with header; email columns SHA-256 hashed locally)
|
|
1258
|
+
# Matched audiences (CSV with header; email columns SHA-256 hashed locally).
|
|
1259
|
+
# Company lists take companyName,domain,organizationUrn — organizationUrn matches the company page exactly
|
|
1244
1260
|
baker ads linkedin audiences create --name "ABM Tier-1" --type company-list --list-file accounts.csv
|
|
1245
1261
|
|
|
1262
|
+
# Stop an ad set reaching customers / open deals — add-only; at publish Baker re-reads the ad set
|
|
1263
|
+
# and merges into its targeting as it stands then. --org takes company ids, ≤200 per call;
|
|
1264
|
+
# a longer list goes into a company-list audience passed as --segment
|
|
1265
|
+
baker ads linkedin campaigns exclude-companies 123456 --org 1035,1441
|
|
1266
|
+
baker ads linkedin campaigns exclude-companies 123456 --segment urn:li:dmpSegment:42
|
|
1267
|
+
|
|
1246
1268
|
# Conversions with playbook-default windows
|
|
1247
1269
|
baker ads linkedin conversions create --name "Demo booked" --type LEAD --method INSIGHT_TAG \
|
|
1248
1270
|
--post-click-window 30 --view-window 7
|
|
@@ -1304,7 +1326,7 @@ Each finding: `{id, area, check, status, severity, evidence, fix: {explanation,
|
|
|
1304
1326
|
- OAuth tokens auto-refresh server-side. On 401, reconnect LinkedIn from dashboard → integrations.
|
|
1305
1327
|
- Account scoping: backend rejects calls against an account not in the picker selection.
|
|
1306
1328
|
- Pinned API version: `Linkedin-Version: 202606` (declared in `oauth/constants.ts`). Bump as a coordinated change — LinkedIn deprecates monthly with a ~12-month support window. The floor is `TRACKING_PARAM_DYNAMIC_MIN_API_VERSION` (`CREATIVE_NAME` needs 202606), asserted in `ads/linkedin/utils.test.ts`.
|
|
1307
|
-
- Cache TTLs: accounts/account-detail 1h, listings 30m, analytics 15m–6h (depends on date range), facets 7d, urn-resolve 1h, bid-pricing/forecast 6h, audience-size 1h.
|
|
1329
|
+
- Cache TTLs: accounts/account-detail 1h, listings 30m, analytics 15m–6h (depends on date range), facets 7d, urn-resolve 1h, org domains 7d, bid-pricing/forecast 6h, audience-size 1h.
|
|
1308
1330
|
- `--no-cache` on any command skips both cache layers (the CLI's own and the server's).
|
|
1309
1331
|
|
|
1310
1332
|
#### LinkedIn-specific gotchas
|
|
@@ -3730,13 +3752,12 @@ Permissions enforced server-side:
|
|
|
3730
3752
|
|
|
3731
3753
|
---
|
|
3732
3754
|
|
|
3733
|
-
### `baker mcp connected |
|
|
3755
|
+
### `baker mcp connected | list | add | remove`
|
|
3734
3756
|
|
|
3735
3757
|
See everything a chat can reach — managed integrations, custom servers, and connected platforms — and manage **custom MCP servers** by pointing the agent at any remote HTTPS MCP endpoint. Registered tools appear as `mcp__<name>__*` on the next chat message.
|
|
3736
3758
|
|
|
3737
3759
|
```bash
|
|
3738
3760
|
baker mcp connected
|
|
3739
|
-
baker mcp catalog --search notion
|
|
3740
3761
|
baker mcp list
|
|
3741
3762
|
baker mcp add --name weather --url https://mcp.example.com/mcp
|
|
3742
3763
|
baker mcp add --name acme --url https://acme.dev/mcp --header "Authorization: Bearer sk-…"
|
|
@@ -3745,7 +3766,6 @@ baker mcp remove --name weather
|
|
|
3745
3766
|
```
|
|
3746
3767
|
|
|
3747
3768
|
- `connected` returns three lists. `managed` and `custom` are MCP tools the agent calls directly; `platforms` are the accounts the company signed in to (HubSpot, Google Ads, GA4, Search Console, Tag Manager, LinkedIn Ads), each with its login and the resources it may read. A platform has **no** `mcp__*` tools — it is read through its own command family — so it is listed here to keep the agent from concluding a working connection is missing.
|
|
3748
|
-
- `catalog --search <name> [--limit 1-20]` searches the managed apps a user can connect when a vendor has no MCP server of its own. Each app reports its slug (`app`), how the user connects it (`sign-in`, `key` or `none`) and whether this chat already reaches it (`connected`).
|
|
3749
3769
|
- `--url` must be the **full MCP endpoint** (commonly ending in `/mcp`), HTTPS and public; loopback / private / cloud-metadata hosts are rejected. A bare domain frequently accepts the OAuth sign-in and then serves no tools, so every address is handshake-checked after it changes: `connected` and `list` report `usable: false` plus a `problem` (and a `suggestedAddress` when the server advertises a better endpoint) for a server that isn't serving tools, or `lastCheck: failed` when the last check only hit an outage — that one may work anyway, and a later turn re-checks it automatically. Repointing a server at a different host clears its saved sign-in: a token belongs to the host that issued it, so the server has to be connected again.
|
|
3750
3770
|
- Scope is two independent choices — audience (just you / everyone) × level (this company / whole org):
|
|
3751
3771
|
- `--scope company` (default) — everyone in this company.
|
|
@@ -3792,7 +3812,7 @@ baker history list --category ads --full # ad writes with raw metadata
|
|
|
3792
3812
|
|
|
3793
3813
|
---
|
|
3794
3814
|
|
|
3795
|
-
### `baker hubspot forms list | view | submissions` · `baker hubspot workflows list | view` · `baker hubspot pipelines list` · `baker hubspot contacts summary | lookup | properties | fields` · `baker hubspot deals properties | fields` · `baker hubspot meetings list | view`
|
|
3815
|
+
### `baker hubspot forms list | view | submissions` · `baker hubspot workflows list | view` · `baker hubspot pipelines list` · `baker hubspot contacts summary | lookup | properties | fields` · `baker hubspot companies search` · `baker hubspot deals list | properties | fields` · `baker hubspot meetings list | view`
|
|
3796
3816
|
|
|
3797
3817
|
Read-only view of the company's **connected HubSpot account** — the forms and meeting links (calendars) that live there, the leads those forms received, and the workflows, deal pipelines, and contact records a lead runs through afterwards. Fetched from HubSpot live on every call; nothing is cached and nothing is ever written back.
|
|
3798
3818
|
|
|
@@ -3814,6 +3834,8 @@ baker hubspot pipelines list # where a lead lands, and the st
|
|
|
3814
3834
|
baker hubspot contacts summary --days 30 # are recent leads being worked? (counts only)
|
|
3815
3835
|
baker hubspot contacts lookup lead@example.com # was this one lead picked up?
|
|
3816
3836
|
baker hubspot contacts properties # what a HubSpot-read source can watch, with each value
|
|
3837
|
+
baker hubspot companies search --domains acme.com,globex.io --with-deals # CRM accounts by domain, with their deals
|
|
3838
|
+
baker hubspot deals list --pipeline default --modified-since 2026-01-01 # deals: amount, stage, closed won
|
|
3817
3839
|
baker hubspot meetings list # every calendar + whether booking redirects
|
|
3818
3840
|
baker hubspot meetings view <slug> # booking-form fields for one calendar
|
|
3819
3841
|
baker hubspot meetings view <slug> --as-node # the form.external blob for a flow node
|
|
@@ -3824,7 +3846,9 @@ baker hubspot meetings view <slug> --as-node # the form.external blob for a f
|
|
|
3824
3846
|
**`forms submissions`:** positional `<formId>`; `--days <1-365>` (default 30) sets the window; `--full` adds each submission's field values. The default response is counts and dates only — `total`, `inWindow`, `lastSubmittedAt`, and per-day counts — because submissions carry the lead's own contact details. `truncated: true` means the page budget ran out before the window was covered, so `inWindow` is a floor rather than an exact count.
|
|
3825
3847
|
**`workflows list` flags:** `--search <text>`, `--enabled-only`. Disabled workflows are listed too — a form wired to one that is off looks connected and does nothing.
|
|
3826
3848
|
**`workflows view`:** positional `<workflowId>` (the id from `workflows list`, and the one in HubSpot's own URL — the command translates it to HubSpot's separate internal flow id for you). Returns the enrolment criteria and whether it re-enrols (`null` = HubSpot does not report it for that criteria type, so it is unknown rather than off), plus every step with the property it writes. On a `LIST_BRANCH` step, branches come back in **evaluation order** (`order: 1` wins over `order: 2`) — a broad branch above a narrower one silently swallows the records the narrow one was written for, and HubSpot reports nothing. A `STATIC_BRANCH` matches on a value rather than top down, so its `order` is display only. `steps` is **not** in execution order; follow `nextActionId`. `--full` adds the raw payload, the only place the branch filter criteria (which property is compared to which value) can be read.
|
|
3827
|
-
**`pipelines list`:** no flags; stages come back in the order they run in HubSpot.
|
|
3849
|
+
**`pipelines list`:** no flags; stages come back in the order they run in HubSpot, each with `isClosed` and `isWon` (closed with probability 1).
|
|
3850
|
+
**`companies search` flags:** `--domains <a.com,b.com>` (up to 100; a URL or `www.` is reduced to the bare domain), `--names <"Acme, Inc.;Globex">` (semicolon-separated), `--with-deals`, `--limit <1-500>` (default 100), `--output json|csv|jsonl|md`. Rows: `{ id, name, domain, linkedinPage, deals? }`; `notFound` lists the searched domains no CRM company carries; `truncated: true` means more matched than `--limit`.
|
|
3851
|
+
**`deals list` flags:** `--pipeline <id,id>`, `--modified-since <YYYY-MM-DD>`, `--limit <1-1000>` (default 200), `--after <cursor>`, `--output json|csv|jsonl|md`. Rows, oldest change first: `{ id, name, amount, currency, pipelineId, stageId, stageLabel, isClosed, isWon, createdAt, closedAt, modifiedAt, companyIds }` — `amount: null` is none entered. `next` is the `--after` for the following page; `restartFrom` appears when HubSpot's 10,000-result search ceiling is reached (read on with `--modified-since <restartFrom>`); `companiesReadable: false` means the connection cannot read companies, so no deal carries `companyIds`.
|
|
3828
3852
|
**`contacts summary` flags:** `--days <1-365>` (default 30) over contact creation date. Returns counts only — total contacts, how many have an owner, and the lifecycle-stage split — never a name or an email. `truncated: true` means the page budget ran out, so the counts are floors.
|
|
3829
3853
|
**`contacts lookup`:** positional `<email>`; returns that contact's lifecycle stage, owner, the account (company) it was filed under, and associated deals with their stage. `dealsReadable: false` / `companyReadable: false` mean the connection does not cover deals or accounts, so an empty `deals` or a null `company` is unknown rather than absent. `found: false` means no contact with that email — the lead never reached the CRM, which is a finding rather than an error.
|
|
3830
3854
|
**`contacts properties`:** no flags; returns every contact property with a closed list of values — `{ name, label, groupName, options: [{ value, label }] }` — the ones a HubSpot-read source can watch. Names are HubSpot's internal ones; hand them to `baker analytics sources --create-hubspot --property <name> --value <value>` as printed. No personal data.
|
|
@@ -3856,6 +3880,30 @@ No write surface against HubSpot itself — a form's fields, redirect, or consen
|
|
|
3856
3880
|
|
|
3857
3881
|
---
|
|
3858
3882
|
|
|
3883
|
+
### `baker accounts influenced | engagement | warm | company | campaigns | crm`
|
|
3884
|
+
|
|
3885
|
+
Account insights: which companies the LinkedIn ads are warming, and which CRM deals they influenced. Reads Baker's nightly copy of LinkedIn and the CRM, so it is fast and covers up to 24 months; nothing is changed anywhere. Only for companies with Account insights switched on — otherwise every command exits 1 with `ACCOUNTS_NOT_ENABLED` and an `error.fix` pointing at the live read (`baker ads linkedin companies`, plus `baker hubspot companies search`). `--start`/`--end` must be real calendar days within 24 calendar months; a bad flag or an unsupported `--output` exits 1 with `INVALID_ARGS`.
|
|
3886
|
+
|
|
3887
|
+
```bash
|
|
3888
|
+
baker accounts influenced # influenced pipeline, last 12 calendar months
|
|
3889
|
+
baker accounts influenced --basis revenue --start 2026-01-01 --end 2026-06-30
|
|
3890
|
+
baker accounts influenced --full # every deal in the period, influenced or not
|
|
3891
|
+
baker accounts engagement --last-months 3 --limit 50 # companies reached, New/Rising, CRM match and deals
|
|
3892
|
+
baker accounts engagement --campaign-id 123456 --output csv
|
|
3893
|
+
baker accounts warm --output csv > warm.csv # companyName,domain,organizationUrn
|
|
3894
|
+
baker accounts company acme.com # or a LinkedIn company id / urn:li:organization:N
|
|
3895
|
+
baker accounts campaigns --last-months 6 --output md # per campaign: reached, engaged, influenced pipeline (--basis revenue)
|
|
3896
|
+
baker accounts influenced --model awareness --threshold 10 --output csv # another rule, this call only
|
|
3897
|
+
baker accounts warm --min 0 # every New/Rising company, below the threshold too
|
|
3898
|
+
baker accounts crm status # deals from HubSpot or sent by the client; what arrived, linked Google Sheets
|
|
3899
|
+
baker accounts crm check --file deals.csv # judge a deals or company CSV offline, nothing sent
|
|
3900
|
+
baker accounts crm contract # the send-your-CRM contract, as Markdown for a developer
|
|
3901
|
+
```
|
|
3902
|
+
|
|
3903
|
+
A deal is **influenced** when its company reached the company's influence rule — by default 3+ LinkedIn ad engagements (Awareness: 7+ impressions; Intent: 3+ clicks) — in the 12 months up to and including the month the deal was created (`--basis pipeline`, deals not won) or closed won (`--basis revenue`). It is a labelled rule, not credit: campaign rows overlap, and money is reported per currency, never summed across currencies. Deals whose company match is only a guess come back under `lowConfidence` and stay out of `summary` until the match is confirmed in Measure → Accounts. Without the deals set up there — HubSpot's pipelines and won/lost stages, or Another CRM — `influenced` and `campaigns` exit 1 with `ACCOUNTS_NOT_SET_UP`. A CRM Baker cannot read sends its companies and deals to `POST /v1/accounts/crm` (a `crm_ingest` key, `X-Baker-Mode: test` to rehearse, up to 500 records per request, records naming a person refused), is uploaded as a CSV in Measure → Accounts, or lives in a Google Sheet linked there that Baker reads every night (a row deleted from the sheet leaves Baker). A file is a deals export or a company list — a company needs only its website or LinkedIn page; `crm check` runs the same rules offline and `crm contract` prints the whole contract. The CLI never sends deals or links a sheet. `--model engagement|awareness|intent` and `--threshold N` on `influenced`, `campaigns` and `warm` read with another rule for that call only; the saved setting is unchanged. A **warm** account is New or Rising, reached the company's influence threshold this period on the rule's metric (`--min N` overrides, `--min 0` drops it), and has no open deal, no won deal and no deal lost in the last 6 months; `engagement` and `warm` rows carry `dealStatus` (`won` > `open` > `lost` > `none`), `engagement --output csv` adds `lastMonth` and `previousImpressions/Clicks/Engagements`, and `campaigns` / `company` carry each campaign's `campaignName` (null when LinkedIn could not name it). `company` returns `months` (the company's totals), `byCampaign` (the same numbers per campaign — overlapping, never add them) and its `deals` with `touchValue` and `influenced`. `warm --output csv` is the file `baker ads linkedin audiences create --type company-list --list-file` takes.
|
|
3904
|
+
|
|
3905
|
+
---
|
|
3906
|
+
|
|
3859
3907
|
### `baker chats list | view | transcript | diff`
|
|
3860
3908
|
|
|
3861
3909
|
Read-only inspection of **other Sessions (chats) on the same account** — so an agent can reuse prior work ("like we did in that other chat, but for X"). Same-account only; never crosses a company boundary and has no write surface.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
debugLogSetting
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-AKX7S6ZW.js";
|
|
4
4
|
|
|
5
5
|
// src/debugLog.ts
|
|
6
6
|
import { appendFileSync, mkdirSync, renameSync, statSync } from "fs";
|
|
@@ -173,4 +173,4 @@ export {
|
|
|
173
173
|
readBodyForLog,
|
|
174
174
|
installStreamTaps
|
|
175
175
|
};
|
|
176
|
-
//# sourceMappingURL=chunk-
|
|
176
|
+
//# sourceMappingURL=chunk-3FJU7BNQ.js.map
|
|
@@ -2,13 +2,13 @@ import {
|
|
|
2
2
|
handleConnectionError,
|
|
3
3
|
needsConnectionFix,
|
|
4
4
|
writeAdsJson
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-OEI3NLGH.js";
|
|
6
6
|
import {
|
|
7
7
|
ApiError
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-LMMZ3FAC.js";
|
|
9
9
|
import {
|
|
10
10
|
getEnv
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-AKX7S6ZW.js";
|
|
12
12
|
|
|
13
13
|
// src/commands/ads/meta/shared.ts
|
|
14
14
|
var DAY_MS = 864e5;
|
|
@@ -133,4 +133,4 @@ export {
|
|
|
133
133
|
resolveEffectiveStatus,
|
|
134
134
|
statusFilterHints
|
|
135
135
|
};
|
|
136
|
-
//# sourceMappingURL=chunk-
|
|
136
|
+
//# sourceMappingURL=chunk-6V6B7RPR.js.map
|
|
@@ -68,8 +68,7 @@ var PROXY_TIERS = {
|
|
|
68
68
|
port: 8e3,
|
|
69
69
|
usernamePrefix: "user-",
|
|
70
70
|
countryKey: "-country-",
|
|
71
|
-
sessionKey: null
|
|
72
|
-
attempts: 3
|
|
71
|
+
sessionKey: null
|
|
73
72
|
},
|
|
74
73
|
residential: {
|
|
75
74
|
tier: "residential",
|
|
@@ -77,8 +76,7 @@ var PROXY_TIERS = {
|
|
|
77
76
|
port: 7777,
|
|
78
77
|
usernamePrefix: "customer-",
|
|
79
78
|
countryKey: "-cc-",
|
|
80
|
-
sessionKey: "-sessid-"
|
|
81
|
-
attempts: 1
|
|
79
|
+
sessionKey: "-sessid-"
|
|
82
80
|
}
|
|
83
81
|
};
|
|
84
82
|
var ESCALATION_ORDER = ["datacenter", "residential"];
|
|
@@ -276,28 +274,10 @@ function plannedRoutes(url, credentials, options) {
|
|
|
276
274
|
const routes = [DIRECT_ROUTE];
|
|
277
275
|
for (const tier of configuredTiers(credentials)) {
|
|
278
276
|
const built = buildProxyRoute(tier, credentials, options);
|
|
279
|
-
if (
|
|
280
|
-
for (let attempt = 0; attempt < PROXY_TIERS[tier].attempts; attempt++) routes.push(built.route);
|
|
277
|
+
if (built.ok) routes.push(built.route);
|
|
281
278
|
}
|
|
282
279
|
return routes;
|
|
283
280
|
}
|
|
284
|
-
function routeTier(route) {
|
|
285
|
-
return route.kind === "proxy" ? route.tier : "direct";
|
|
286
|
-
}
|
|
287
|
-
function nextPlannedRoute(routes, tried) {
|
|
288
|
-
const dead = new Set(tried.filter((attempt) => attempt.proxyFailure).map((attempt) => attempt.tier));
|
|
289
|
-
const spent = /* @__PURE__ */ new Map();
|
|
290
|
-
for (const attempt of tried) spent.set(attempt.tier, (spent.get(attempt.tier) ?? 0) + 1);
|
|
291
|
-
const offered = /* @__PURE__ */ new Map();
|
|
292
|
-
for (const route of routes) {
|
|
293
|
-
const tier = routeTier(route);
|
|
294
|
-
if (dead.has(tier)) continue;
|
|
295
|
-
const position = (offered.get(tier) ?? 0) + 1;
|
|
296
|
-
offered.set(tier, position);
|
|
297
|
-
if (position > (spent.get(tier) ?? 0)) return route;
|
|
298
|
-
}
|
|
299
|
-
return null;
|
|
300
|
-
}
|
|
301
281
|
|
|
302
282
|
// src/env.ts
|
|
303
283
|
import { createEnv } from "@t3-oss/env-core";
|
|
@@ -1300,12 +1280,19 @@ function debugLogSetting() {
|
|
|
1300
1280
|
const raw = process.env.BAKER_DEBUG_LOG?.trim();
|
|
1301
1281
|
return raw ? raw : void 0;
|
|
1302
1282
|
}
|
|
1283
|
+
var MissingChatIdError = class extends Error {
|
|
1284
|
+
code = "MISSING_CHAT_ID";
|
|
1285
|
+
constructor() {
|
|
1286
|
+
super(
|
|
1287
|
+
"BAKER_CHAT_ID is not set. This command stages changes against a chat \u2014 run it from a chat-attached environment."
|
|
1288
|
+
);
|
|
1289
|
+
this.name = "MissingChatIdError";
|
|
1290
|
+
}
|
|
1291
|
+
};
|
|
1303
1292
|
function requireChatId() {
|
|
1304
1293
|
const env = getEnv();
|
|
1305
1294
|
if (!env.BAKER_CHAT_ID) {
|
|
1306
|
-
throw new
|
|
1307
|
-
"BAKER_CHAT_ID is not set. This command stages changes against a chat \u2014 run it from a chat-attached environment."
|
|
1308
|
-
);
|
|
1295
|
+
throw new MissingChatIdError();
|
|
1309
1296
|
}
|
|
1310
1297
|
return env.BAKER_CHAT_ID;
|
|
1311
1298
|
}
|
|
@@ -1351,7 +1338,6 @@ export {
|
|
|
1351
1338
|
refuseNonPublicUrl,
|
|
1352
1339
|
DIRECT_ROUTE,
|
|
1353
1340
|
plannedRoutes,
|
|
1354
|
-
nextPlannedRoute,
|
|
1355
1341
|
API_KEY_FORMAT_MESSAGE,
|
|
1356
1342
|
isBakerApiKey,
|
|
1357
1343
|
registerSchema,
|
|
@@ -1374,6 +1360,7 @@ export {
|
|
|
1374
1360
|
requireConnection,
|
|
1375
1361
|
optionalChatId,
|
|
1376
1362
|
debugLogSetting,
|
|
1363
|
+
MissingChatIdError,
|
|
1377
1364
|
requireChatId,
|
|
1378
1365
|
resolveChatId,
|
|
1379
1366
|
hasFrameVisionKey,
|
|
@@ -1385,4 +1372,4 @@ export {
|
|
|
1385
1372
|
captureVimeoCookie,
|
|
1386
1373
|
childEnvWith
|
|
1387
1374
|
};
|
|
1388
|
-
//# sourceMappingURL=chunk-
|
|
1375
|
+
//# sourceMappingURL=chunk-AKX7S6ZW.js.map
|