deepline 0.3.504 → 0.3.506
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/dist/bundling-sources/sdk/src/client-core.ts +121 -5
- package/dist/bundling-sources/sdk/src/index.ts +3 -0
- package/dist/bundling-sources/sdk/src/release.ts +1 -1
- package/dist/bundling-sources/sdk/src/types.ts +5 -0
- package/dist/bundling-sources/shared_libs/integration-contracts/billing-entitlements.ts +2 -0
- package/dist/bundling-sources/shared_libs/monitors/fleets/issues.ts +176 -0
- package/dist/bundling-sources/shared_libs/monitors/fleets/limits.ts +17 -0
- package/dist/bundling-sources/shared_libs/monitors/fleets/overview.ts +118 -0
- package/dist/bundling-sources/shared_libs/monitors/fleets/plan.ts +29 -1
- package/dist/bundling-sources/shared_libs/monitors/legacy-radar-retirement.ts +29 -10
- package/dist/bundling-sources/shared_libs/monitors/package.json +4 -0
- package/dist/bundling-sources/shared_libs/observability/scheduled-jobs.json +9 -9
- package/dist/bundling-sources/shared_libs/play-runtime/context.ts +52 -5
- package/dist/bundling-sources/shared_libs/play-runtime/freshness-receipt-execution.ts +48 -5
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-lifecycle.ts +157 -47
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/modal.ts +36 -3
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-gateway-egress.ts +55 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +66 -0
- package/dist/bundling-sources/shared_libs/play-runtime/transient-service-error.ts +18 -0
- package/dist/bundling-sources/shared_libs/product-notifications/onboarding-unsubscribe.ts +23 -0
- package/dist/cli/auth-MMHG2OFE.js +43 -0
- package/dist/cli/{auth-3L5AA5AX.mjs → auth-ZHFONT2D.mjs} +5 -5
- package/dist/cli/{billing-HOGXVE2V.js → billing-3Z7N4WTL.js} +101 -91
- package/dist/cli/{billing-E7EASVPO.mjs → billing-B2YEMNHE.mjs} +27 -17
- package/dist/cli/{chunk-UXQQPMYO.js → chunk-26DJ4BDY.js} +2 -2
- package/dist/cli/{chunk-3MLFFWDM.mjs → chunk-2CFTDVEP.mjs} +2 -2
- package/dist/cli/{chunk-QOLX2O2S.mjs → chunk-2IXXB7OA.mjs} +93 -34
- package/dist/cli/{chunk-6JNBMTCZ.js → chunk-2OY5DXTC.js} +1 -1
- package/dist/cli/{chunk-SVFTZTCI.mjs → chunk-3BFZEHBH.mjs} +1 -1
- package/dist/cli/{chunk-67OI26OE.js → chunk-3F676QXJ.js} +96 -37
- package/dist/cli/{chunk-KCKAFTPY.js → chunk-5ARG7J7A.js} +6 -6
- package/dist/cli/{chunk-5CHBIJIM.mjs → chunk-6RYVIZRP.mjs} +2 -2
- package/dist/cli/{chunk-QKKU2FH4.js → chunk-75NAFY36.js} +7 -7
- package/dist/cli/{chunk-7P2QVMBP.js → chunk-AD2WJUZA.js} +91 -48
- package/dist/cli/{chunk-UFYJTRSF.mjs → chunk-AFSYNOG4.mjs} +42 -7
- package/dist/cli/{chunk-VJVJWZ6I.mjs → chunk-BJ5OX62J.mjs} +5 -5
- package/dist/cli/{chunk-HUX5DZO6.mjs → chunk-BQBPVUFJ.mjs} +3 -3
- package/dist/cli/{chunk-MLMWM5DV.mjs → chunk-CHGRURBN.mjs} +5 -5
- package/dist/cli/{chunk-22OCKCYS.mjs → chunk-D7OCORZ7.mjs} +1 -1
- package/dist/cli/{chunk-SMSQVRHE.js → chunk-DB54ROPH.js} +5 -5
- package/dist/cli/{chunk-KGUGNEKL.js → chunk-E554XCJI.js} +96 -96
- package/dist/cli/{chunk-GGBXNQCR.mjs → chunk-EN7GXLFX.mjs} +4 -4
- package/dist/cli/{chunk-2W77YCKH.js → chunk-F53SGS3C.js} +5 -5
- package/dist/cli/{chunk-6SMR7LU7.js → chunk-F7IQQYKV.js} +2 -2
- package/dist/cli/chunk-FFGQR5J3.mjs +405 -0
- package/dist/cli/{chunk-UJMBG5JU.js → chunk-FWSEGIT6.js} +4 -4
- package/dist/cli/{chunk-GJ2DA35C.js → chunk-GDHLL5EQ.js} +42 -7
- package/dist/cli/{chunk-XHZSPMNC.mjs → chunk-GJNIC2CO.mjs} +84 -441
- package/dist/cli/chunk-GRESJ3H3.js +405 -0
- package/dist/cli/{chunk-WZSFIJMG.js → chunk-HINTYT5H.js} +113 -470
- package/dist/cli/{chunk-A6LA42JY.js → chunk-LRSRJJPD.js} +16 -16
- package/dist/cli/{chunk-WBIDPDKJ.js → chunk-MHRR47VQ.js} +3 -3
- package/dist/cli/{chunk-FTRVCIGC.js → chunk-N7G36GXB.js} +26 -26
- package/dist/cli/{chunk-BTWUNKKX.mjs → chunk-ND4WPLTE.mjs} +2 -2
- package/dist/cli/{chunk-NZ7Z7WNM.mjs → chunk-O4DZG4VA.mjs} +2 -2
- package/dist/cli/{chunk-LHXYCZYO.js → chunk-OD6TASBP.js} +8 -8
- package/dist/cli/{chunk-GRAGUYIE.js → chunk-OHNMJ5XQ.js} +41 -41
- package/dist/cli/{chunk-OX2D6BG4.mjs → chunk-ONBXTEFQ.mjs} +46 -3
- package/dist/cli/{chunk-7F4OEHQK.mjs → chunk-OPBXKB57.mjs} +1 -1
- package/dist/cli/{chunk-Y7VEHKID.mjs → chunk-OUGJUM5X.mjs} +6 -6
- package/dist/cli/{chunk-USTJEEND.js → chunk-PRIHD5XS.js} +9 -9
- package/dist/cli/{chunk-IGNQKOWT.mjs → chunk-QAY5AS2H.mjs} +12 -12
- package/dist/cli/{chunk-5Z6EULD5.js → chunk-QP333GFE.js} +7 -7
- package/dist/cli/{chunk-JPR2546F.js → chunk-SUJIVF6L.js} +16 -16
- package/dist/cli/{chunk-DEAJVQEG.mjs → chunk-TEMORCEE.mjs} +1 -1
- package/dist/cli/{chunk-YOQ2NNDO.mjs → chunk-TS4KFQKS.mjs} +1 -1
- package/dist/cli/{chunk-4CC67XH5.mjs → chunk-XUY7WQ2R.mjs} +3 -3
- package/dist/cli/{chunk-Z6FXUDIL.mjs → chunk-YEX6RPUO.mjs} +1 -1
- package/dist/cli/{chunk-MJTK6Q3G.js → chunk-YJKKOSXS.js} +3 -3
- package/dist/cli/{chunk-Y6XKCEPK.mjs → chunk-YVOS5KSG.mjs} +1 -1
- package/dist/cli/{chunk-2ABRDH3B.mjs → chunk-YWZEBPXK.mjs} +2 -2
- package/dist/cli/{chunk-BX45XMXZ.mjs → chunk-Z7EHY2MF.mjs} +2 -2
- package/dist/cli/{chunk-FISP4LCK.js → chunk-ZM5BJ5MP.js} +53 -53
- package/dist/cli/{chunk-IPAMOMGP.js → chunk-ZZDTWVCQ.js} +21 -21
- package/dist/cli/command-docs.js +2 -2
- package/dist/cli/command-docs.mjs +1 -1
- package/dist/cli/{csv-2XWGPITO.js → csv-7K7LK63Y.js} +13 -13
- package/dist/cli/{csv-433JEHLQ.mjs → csv-ARHQ54HA.mjs} +4 -4
- package/dist/cli/{db-K747DH43.mjs → db-JBX24NJY.mjs} +6 -6
- package/dist/cli/{db-PJJMD4VH.js → db-V4Z2I6DY.js} +27 -27
- package/dist/cli/describe-AYXVS6DZ.js +50 -0
- package/dist/cli/{describe-VEDDYW4P.mjs → describe-RBDSGSZ7.mjs} +18 -17
- package/dist/cli/describe-core.d.mts +3 -3
- package/dist/cli/describe-core.d.ts +3 -3
- package/dist/cli/{executions-JWRX3XCT.mjs → executions-BAZEU63W.mjs} +6 -6
- package/dist/cli/{executions-HM5T72H6.js → executions-XEZKV5QU.js} +8 -8
- package/dist/cli/{feedback-34UG4BO3.js → feedback-LOERESRU.js} +8 -8
- package/dist/cli/{feedback-MNSIA63Y.mjs → feedback-YDSWBHCO.mjs} +4 -4
- package/dist/cli/{git-ZKEOXV3A.mjs → git-4Z3W2CQU.mjs} +5 -5
- package/dist/cli/git-T6WKO7EA.js +25 -0
- package/dist/cli/index.js +146 -148
- package/dist/cli/index.mjs +53 -55
- package/dist/cli/{legacy-noops-YXSI4FVU.js → legacy-noops-4QIQPVE5.js} +8 -8
- package/dist/cli/{legacy-noops-5M4T4ZVT.mjs → legacy-noops-E4HH7S5O.mjs} +5 -5
- package/dist/cli/{monitors-C65OC4AW.mjs → monitors-FPDW5DDM.mjs} +305 -8
- package/dist/cli/{monitors-O25GDOYE.js → monitors-QBHDSDA7.js} +423 -126
- package/dist/cli/{org-2GSPLY2A.js → org-JO4GGSAH.js} +72 -72
- package/dist/cli/{org-ZRMG5NS2.mjs → org-UCDHIHAD.mjs} +6 -6
- package/dist/cli/{pages-TZZUFBRO.mjs → pages-6V52IZXY.mjs} +6 -6
- package/dist/cli/{pages-45DPADK6.js → pages-FJAAXAWO.js} +18 -18
- package/dist/cli/{play-RCGMND6X.js → play-F3AENS6W.js} +317 -316
- package/dist/cli/{play-3D7HH273.mjs → play-MF4DWROJ.mjs} +18 -17
- package/dist/cli/{providers-PSAKV6CJ.mjs → providers-NJJLTECA.mjs} +6 -6
- package/dist/cli/{providers-3N3ECMTY.js → providers-XXOQLPX7.js} +9 -9
- package/dist/cli/{quickstart-6R6AIXM6.js → quickstart-JCE3XGQG.js} +6 -6
- package/dist/cli/{quickstart-2A35SMGC.mjs → quickstart-Z5MSMI7S.mjs} +4 -4
- package/dist/cli/{run-F3TLDGUO.mjs → run-56UGPIRL.mjs} +23 -22
- package/dist/cli/{run-F6ZXTASZ.js → run-X2DNIW3F.js} +41 -40
- package/dist/cli/search-B753RTKC.js +33 -0
- package/dist/cli/{search-CZLCY3D2.mjs → search-SZYI4NBB.mjs} +8 -7
- package/dist/cli/{search-output-R5XDNILW.js → search-output-7UNT6EMP.js} +6 -6
- package/dist/cli/{search-output-MQTSTLN5.mjs → search-output-T35QNZUF.mjs} +4 -4
- package/dist/cli/{secrets-DCJYHDSY.js → secrets-JMUAVIVC.js} +15 -15
- package/dist/cli/{secrets-D3GF4B2Z.mjs → secrets-Q36VC35L.mjs} +6 -6
- package/dist/cli/{sessions-QGEQ2UYZ.mjs → sessions-HG6I3HMY.mjs} +5 -5
- package/dist/cli/{sessions-Z4JYJSDP.js → sessions-SUXU7OM7.js} +6 -6
- package/dist/cli/{settings-UVXXAT4A.js → settings-UIELQ5CV.js} +106 -78
- package/dist/cli/{settings-G7QEXA4N.mjs → settings-Z76XW4KF.mjs} +39 -11
- package/dist/cli/{setup-5I42W7D4.js → setup-2L7H5P2O.js} +50 -49
- package/dist/cli/{setup-QHJU3DUI.mjs → setup-OXNYAOQ4.mjs} +10 -9
- package/dist/cli/skills-DEVXYGYH.js +37 -0
- package/dist/cli/{skills-5LRF4UKX.mjs → skills-XSNLXJGI.mjs} +8 -7
- package/dist/cli/tools-SCGHABDL.js +57 -0
- package/dist/cli/{tools-PUT6STVG.mjs → tools-SUSFAYFH.mjs} +17 -16
- package/dist/cli/update-BSIILGO3.js +35 -0
- package/dist/cli/{update-CJ2GA64X.mjs → update-ENSTG3QO.mjs} +10 -9
- package/dist/cli/{workflow-O67MEBCP.js → workflow-FMBZNY4F.js} +17 -17
- package/dist/cli/{workflow-HVEWRTXD.mjs → workflow-Z33QE6VT.mjs} +7 -7
- package/dist/{client-DYAfJpaN.d.mts → client-BDbouy3Y.d.mts} +1 -1
- package/dist/{client-CIwenMFS.d.ts → client-Cx0420fs.d.ts} +1 -1
- package/dist/{client-core-CRjtyMAI.d.ts → client-core-B4hq0-m2.d.ts} +56 -4
- package/dist/{client-core-DlzP8vEs.d.mts → client-core-CwiVaMZ5.d.mts} +56 -4
- package/dist/{compiler-manifest-DaJrA2KV.d.mts → compiler-manifest-BeURaD5Y.d.mts} +2 -0
- package/dist/{compiler-manifest-DaJrA2KV.d.ts → compiler-manifest-BeURaD5Y.d.ts} +2 -0
- package/dist/{errors-KLga4bLr.d.ts → errors-BoPXPrSy.d.ts} +1 -1
- package/dist/{errors-BKnSYueU.d.mts → errors-kBuT4kGK.d.mts} +1 -1
- package/dist/{index-C5nAZ-VS.d.ts → index-D0crdGM1.d.ts} +1 -1
- package/dist/{index-C-8AFpWy.d.mts → index-DC7oRAAC.d.mts} +1 -1
- package/dist/index.d.mts +7 -7
- package/dist/index.d.ts +7 -7
- package/dist/index.js +9 -9
- package/dist/index.mjs +6 -6
- package/dist/install-integrity.json +116 -110
- package/dist/plays/bundle-play-file.d.mts +3 -3
- package/dist/plays/bundle-play-file.d.ts +3 -3
- package/dist/plays/play-description.d.mts +2 -2
- package/dist/plays/play-description.d.ts +2 -2
- package/dist/plays/run-request.d.mts +2 -2
- package/dist/plays/run-request.d.ts +2 -2
- package/dist/release.d.mts +1 -1
- package/dist/release.d.ts +1 -1
- package/dist/release.js +2 -2
- package/dist/release.mjs +1 -1
- package/dist/server.d.mts +4 -4
- package/dist/server.d.ts +4 -4
- package/dist/server.js +5 -5
- package/dist/server.mjs +3 -3
- package/package.json +1 -1
- package/dist/cli/auth-UPK4IIIN.js +0 -43
- package/dist/cli/describe-OYS7LZJD.js +0 -49
- package/dist/cli/git-5YQJSJFR.js +0 -25
- package/dist/cli/search-R5VEWJO2.js +0 -32
- package/dist/cli/skills-FB6TV52O.js +0 -36
- package/dist/cli/tools-L2364RPA.js +0 -56
- package/dist/cli/update-ESYJGYVZ.js +0 -34
|
@@ -1310,6 +1310,8 @@ export type MonitorsLedgerOptions = {
|
|
|
1310
1310
|
signals?: string[];
|
|
1311
1311
|
/** A Play definition id, or `none` for monitors no Play listens to. */
|
|
1312
1312
|
play?: string;
|
|
1313
|
+
/** A Monitor Fleet id: only the monitors that fleet owns. */
|
|
1314
|
+
fleet?: string;
|
|
1313
1315
|
/** `findings` orders by the most findings in `window`. */
|
|
1314
1316
|
sort?: 'recent' | 'installed' | 'name' | 'findings';
|
|
1315
1317
|
/** The span each row's findings count covers; `30d` by default. */
|
|
@@ -1585,6 +1587,40 @@ export type MonitorFleetGetOptions = {
|
|
|
1585
1587
|
limit?: number;
|
|
1586
1588
|
};
|
|
1587
1589
|
|
|
1590
|
+
/** Options for `client.monitors.fleets.overview(...)` without a fleet id. */
|
|
1591
|
+
export type MonitorFleetOverviewOptions = {
|
|
1592
|
+
/** Search fleet ids, source tables, member tools and signals. */
|
|
1593
|
+
q?: string;
|
|
1594
|
+
/**
|
|
1595
|
+
* Customer statuses to include: needs_attention, paused_credits,
|
|
1596
|
+
* paused_cap, paused_billing, setting_up, running, deactivated. Every
|
|
1597
|
+
* status except deactivated by default.
|
|
1598
|
+
*/
|
|
1599
|
+
states?: string[];
|
|
1600
|
+
/** `attention` (default) puts the fleet needing the most attention first. */
|
|
1601
|
+
sort?: 'attention' | 'findings' | 'newest' | 'name';
|
|
1602
|
+
/** The span each fleet's findings count covers; `30d` by default. */
|
|
1603
|
+
window?: '1d' | '7d' | '30d' | '90d' | '1y';
|
|
1604
|
+
};
|
|
1605
|
+
|
|
1606
|
+
/** Options for `client.monitors.fleets.overview(fleetId, ...)`. */
|
|
1607
|
+
export type MonitorFleetOverviewDetailOptions = Pick<
|
|
1608
|
+
MonitorFleetOverviewOptions,
|
|
1609
|
+
'window'
|
|
1610
|
+
>;
|
|
1611
|
+
|
|
1612
|
+
/** Options for `client.monitors.fleets.issues(...)`. */
|
|
1613
|
+
export type MonitorFleetIssuesOptions = {
|
|
1614
|
+
/** Only failed, blocked, or waiting (rate-limited) members. */
|
|
1615
|
+
group?: 'failed' | 'blocked' | 'waiting';
|
|
1616
|
+
/** One cause, as the fleet overview's `issues` counts name it. */
|
|
1617
|
+
cause?: string;
|
|
1618
|
+
/** Continue from a prior page's `next_cursor`. */
|
|
1619
|
+
cursor?: string;
|
|
1620
|
+
/** Rows per page, 1 to 100 (server default 25). */
|
|
1621
|
+
limit?: number;
|
|
1622
|
+
};
|
|
1623
|
+
|
|
1588
1624
|
export type MonitorFleetDeactivateOptions = {
|
|
1589
1625
|
/** Return the blast radius without deactivating anything. */
|
|
1590
1626
|
dryRun?: boolean;
|
|
@@ -1702,6 +1738,19 @@ export type MonitorFleetsNamespace = {
|
|
|
1702
1738
|
) => Promise<MonitorFleetResult>;
|
|
1703
1739
|
/** Every fleet in the workspace. */
|
|
1704
1740
|
list: () => Promise<MonitorFleetResult>;
|
|
1741
|
+
/**
|
|
1742
|
+
* The Fleets page: every fleet's customer status, issue counts and findings
|
|
1743
|
+
* (searched, filtered, sorted), or one fleet's overview when an id is given.
|
|
1744
|
+
*/
|
|
1745
|
+
overview: (
|
|
1746
|
+
fleetId?: string,
|
|
1747
|
+
options?: MonitorFleetOverviewOptions,
|
|
1748
|
+
) => Promise<MonitorFleetResult>;
|
|
1749
|
+
/** One page of a fleet's members that are not live, with cause and message. */
|
|
1750
|
+
issues: (
|
|
1751
|
+
fleetId: string,
|
|
1752
|
+
options?: MonitorFleetIssuesOptions,
|
|
1753
|
+
) => Promise<MonitorFleetResult>;
|
|
1705
1754
|
/** Deactivate a fleet and the monitors it owns. */
|
|
1706
1755
|
deactivate: (
|
|
1707
1756
|
fleetId: string,
|
|
@@ -2532,9 +2581,13 @@ export type BillingNamespace = {
|
|
|
2532
2581
|
/** Current workspace provider benefits; discovery does not authorize a call. */
|
|
2533
2582
|
entitlements: () => Promise<BillingEntitlements>;
|
|
2534
2583
|
/** Play compute pricing and this period's sandbox minutes by day. */
|
|
2535
|
-
includedCompute: (
|
|
2584
|
+
includedCompute: (options?: {
|
|
2585
|
+
includeOverage?: boolean;
|
|
2586
|
+
}) => Promise<IncludedCompute>;
|
|
2536
2587
|
/** Turn on included compute for the workspace. It cannot be turned off again. */
|
|
2537
|
-
enableIncludedCompute: (
|
|
2588
|
+
enableIncludedCompute: (options?: {
|
|
2589
|
+
includeOverage?: boolean;
|
|
2590
|
+
}) => Promise<IncludedCompute>;
|
|
2538
2591
|
/** Charge the saved payment method and add Deepline credits to the active workspace. */
|
|
2539
2592
|
topUp: (options: {
|
|
2540
2593
|
credits: number;
|
|
@@ -2990,9 +3043,19 @@ export class DeeplineClient {
|
|
|
2990
3043
|
quote: (input) =>
|
|
2991
3044
|
this.http.post<BillingQuoteResult>('/api/v2/billing/quote', input),
|
|
2992
3045
|
entitlements: () => this.http.get('/api/v2/billing/entitlements'),
|
|
2993
|
-
includedCompute: () =>
|
|
2994
|
-
|
|
2995
|
-
|
|
3046
|
+
includedCompute: ({ includeOverage } = {}) =>
|
|
3047
|
+
this.http.get(
|
|
3048
|
+
includeOverage
|
|
3049
|
+
? '/api/v2/billing/included-compute?include_overage=true'
|
|
3050
|
+
: '/api/v2/billing/included-compute',
|
|
3051
|
+
),
|
|
3052
|
+
enableIncludedCompute: ({ includeOverage } = {}) =>
|
|
3053
|
+
this.http.post<IncludedCompute>(
|
|
3054
|
+
includeOverage
|
|
3055
|
+
? '/api/v2/billing/included-compute?include_overage=true'
|
|
3056
|
+
: '/api/v2/billing/included-compute',
|
|
3057
|
+
{},
|
|
3058
|
+
),
|
|
2996
3059
|
topUp: (options) => this.topUpBillingBalance(options),
|
|
2997
3060
|
topUpWithReceipt: (options) =>
|
|
2998
3061
|
this.topUpBillingBalanceWithReceipt(options),
|
|
@@ -3126,6 +3189,12 @@ export class DeeplineClient {
|
|
|
3126
3189
|
? this.listMonitorFleets()
|
|
3127
3190
|
: this.getMonitorFleet(fleetId, options),
|
|
3128
3191
|
list: () => this.listMonitorFleets(),
|
|
3192
|
+
overview: (fleetId, options) =>
|
|
3193
|
+
fleetId === undefined
|
|
3194
|
+
? this.listMonitorFleetOverviews(options)
|
|
3195
|
+
: this.getMonitorFleetOverview(fleetId, options),
|
|
3196
|
+
issues: (fleetId, options) =>
|
|
3197
|
+
this.listMonitorFleetIssues(fleetId, options),
|
|
3129
3198
|
deactivate: (fleetId, options) =>
|
|
3130
3199
|
this.deactivateMonitorFleet(fleetId, options),
|
|
3131
3200
|
reactivate: (fleetId, options) =>
|
|
@@ -7298,6 +7367,7 @@ export class DeeplineClient {
|
|
|
7298
7367
|
for (const signal of options?.signals ?? [])
|
|
7299
7368
|
params.append('signal', signal);
|
|
7300
7369
|
if (options?.play) params.set('play', options.play);
|
|
7370
|
+
if (options?.fleet) params.set('fleet', options.fleet);
|
|
7301
7371
|
if (options?.sort) params.set('sort', options.sort);
|
|
7302
7372
|
if (options?.window) params.set('window', options.window);
|
|
7303
7373
|
if (options?.limit !== undefined)
|
|
@@ -7742,6 +7812,52 @@ export class DeeplineClient {
|
|
|
7742
7812
|
});
|
|
7743
7813
|
}
|
|
7744
7814
|
|
|
7815
|
+
/** The Fleets list. Prefer `client.monitors.fleets.overview()`. */
|
|
7816
|
+
async listMonitorFleetOverviews(
|
|
7817
|
+
options?: MonitorFleetOverviewOptions,
|
|
7818
|
+
): Promise<MonitorFleetResult> {
|
|
7819
|
+
const params = new URLSearchParams({ view: 'overview' });
|
|
7820
|
+
if (options?.q) params.set('q', options.q);
|
|
7821
|
+
for (const state of options?.states ?? []) params.append('state', state);
|
|
7822
|
+
if (options?.sort) params.set('sort', options.sort);
|
|
7823
|
+
if (options?.window) params.set('window', options.window);
|
|
7824
|
+
return this.http.request<MonitorFleetResult>(
|
|
7825
|
+
`/api/v2/monitors/fleets?${params.toString()}`,
|
|
7826
|
+
{ method: 'GET' },
|
|
7827
|
+
);
|
|
7828
|
+
}
|
|
7829
|
+
|
|
7830
|
+
/** One fleet's overview. Prefer `client.monitors.fleets.overview(fleetId)`. */
|
|
7831
|
+
async getMonitorFleetOverview(
|
|
7832
|
+
fleetId: string,
|
|
7833
|
+
options?: MonitorFleetOverviewDetailOptions,
|
|
7834
|
+
): Promise<MonitorFleetResult> {
|
|
7835
|
+
const params = new URLSearchParams({ view: 'overview' });
|
|
7836
|
+
if (options?.window) params.set('window', options.window);
|
|
7837
|
+
return this.http.request<MonitorFleetResult>(
|
|
7838
|
+
`${this.monitorFleetPath(fleetId)}?${params.toString()}`,
|
|
7839
|
+
{ method: 'GET' },
|
|
7840
|
+
);
|
|
7841
|
+
}
|
|
7842
|
+
|
|
7843
|
+
/** A fleet's problem members. Prefer `client.monitors.fleets.issues(...)`. */
|
|
7844
|
+
async listMonitorFleetIssues(
|
|
7845
|
+
fleetId: string,
|
|
7846
|
+
options?: MonitorFleetIssuesOptions,
|
|
7847
|
+
): Promise<MonitorFleetResult> {
|
|
7848
|
+
const params = new URLSearchParams();
|
|
7849
|
+
if (options?.group) params.set('group', options.group);
|
|
7850
|
+
if (options?.cause) params.set('cause', options.cause);
|
|
7851
|
+
if (options?.cursor) params.set('cursor', options.cursor);
|
|
7852
|
+
if (options?.limit !== undefined)
|
|
7853
|
+
params.set('limit', String(options.limit));
|
|
7854
|
+
const query = params.toString();
|
|
7855
|
+
return this.http.request<MonitorFleetResult>(
|
|
7856
|
+
`${this.monitorFleetPath(fleetId)}/issues${query ? `?${query}` : ''}`,
|
|
7857
|
+
{ method: 'GET' },
|
|
7858
|
+
);
|
|
7859
|
+
}
|
|
7860
|
+
|
|
7745
7861
|
async getMonitorFleet(
|
|
7746
7862
|
fleetId: string,
|
|
7747
7863
|
options?: MonitorFleetGetOptions,
|
|
@@ -165,6 +165,9 @@ export type {
|
|
|
165
165
|
MonitorFleetDeactivateOptions,
|
|
166
166
|
MonitorFleetReactivateOptions,
|
|
167
167
|
MonitorFleetGetOptions,
|
|
168
|
+
MonitorFleetIssuesOptions,
|
|
169
|
+
MonitorFleetOverviewDetailOptions,
|
|
170
|
+
MonitorFleetOverviewOptions,
|
|
168
171
|
MonitorFleetSyncOptions,
|
|
169
172
|
MonitorFleetStatus,
|
|
170
173
|
MonitorFleetWaitOptions,
|
|
@@ -205,7 +205,7 @@ export const SDK_RELEASE = {
|
|
|
205
205
|
// getters keep their established compatibility behavior.
|
|
206
206
|
// 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
|
|
207
207
|
// 0.3.90 is the first deliberately versioned SDK release for API v3.
|
|
208
|
-
version: '0.3.
|
|
208
|
+
version: '0.3.506',
|
|
209
209
|
updateSummary: {
|
|
210
210
|
introducedIn: '0.3.90',
|
|
211
211
|
summary:
|
|
@@ -638,6 +638,11 @@ export interface ToolSearchResult {
|
|
|
638
638
|
search_mode?: 'v1' | 'v2';
|
|
639
639
|
/** Whether search fell back to category matching. */
|
|
640
640
|
search_fallback_to_category?: boolean;
|
|
641
|
+
/** Query-writing advice when phrasing is unclear, matches are weak, or the search is empty. */
|
|
642
|
+
search_guidance?: {
|
|
643
|
+
reason: 'poor_query' | 'low_confidence' | 'no_results';
|
|
644
|
+
message: string;
|
|
645
|
+
};
|
|
641
646
|
/** Requested categories no tool has, left out of the filter. */
|
|
642
647
|
unknown_categories?: string[];
|
|
643
648
|
/** Explanation and next commands when filters/search succeed but match zero tools. */
|
|
@@ -85,6 +85,8 @@ export type IncludedCompute = {
|
|
|
85
85
|
included_minutes_used: number;
|
|
86
86
|
/** Exact Deepline credits consumed from included compute; older servers may omit it. */
|
|
87
87
|
included_credits_used?: number;
|
|
88
|
+
/** Settled plan-rate sandbox credits paid beyond included compute this period. */
|
|
89
|
+
overage_credits?: number;
|
|
88
90
|
minutes_used: number;
|
|
89
91
|
days: Array<{ day: string; minutes: number }>;
|
|
90
92
|
/** Same settled sessions and allowance period for every value. */
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Why a fleet member is not live, in a closed vocabulary.
|
|
3
|
+
*
|
|
4
|
+
* The fleet page groups problem members by cause and pairs each cause with its
|
|
5
|
+
* fix. Grouping by the raw provider message would grow with membership (a
|
|
6
|
+
* message can name the member's own resource), so every member maps to one of
|
|
7
|
+
* a fixed set of causes and the summary is a fixed-size set of counts. The raw
|
|
8
|
+
* message stays on the paginated issue detail.
|
|
9
|
+
*
|
|
10
|
+
* Failed causes are read from the prefixes our own convergence code writes
|
|
11
|
+
* (`fleets/service.ts`, `describeProviderMonitorBatchItemFailure`); anything
|
|
12
|
+
* else is `other`. Blocked causes come from the refusal codes. Finer provider
|
|
13
|
+
* causes need retained real provider responses (KAR-196).
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
import { FLEET_BLOCKED_BY, FLEET_REFUSAL } from './limits';
|
|
17
|
+
|
|
18
|
+
export const FLEET_ISSUE_GROUPS = ['failed', 'blocked', 'waiting'] as const;
|
|
19
|
+
export type FleetIssueGroup = (typeof FLEET_ISSUE_GROUPS)[number];
|
|
20
|
+
|
|
21
|
+
export const FLEET_FAILED_CAUSES = [
|
|
22
|
+
'provider_rejected',
|
|
23
|
+
'provider_unconfirmed',
|
|
24
|
+
'provider_state_mismatch',
|
|
25
|
+
'billing',
|
|
26
|
+
'unsupported_tool',
|
|
27
|
+
'other',
|
|
28
|
+
] as const;
|
|
29
|
+
export type FleetFailedCause = (typeof FLEET_FAILED_CAUSES)[number];
|
|
30
|
+
|
|
31
|
+
export const FLEET_BLOCKED_CAUSES = [
|
|
32
|
+
'watched_accounts_limit',
|
|
33
|
+
'monitors_per_account_limit',
|
|
34
|
+
'rollout_access',
|
|
35
|
+
'identity_occupied',
|
|
36
|
+
'unsupported_tool',
|
|
37
|
+
'needs_support',
|
|
38
|
+
'unknown_code',
|
|
39
|
+
] as const;
|
|
40
|
+
export type FleetBlockedCause = (typeof FLEET_BLOCKED_CAUSES)[number];
|
|
41
|
+
|
|
42
|
+
export const FLEET_WAITING_CAUSES = ['rate_limited'] as const;
|
|
43
|
+
export type FleetWaitingCause = (typeof FLEET_WAITING_CAUSES)[number];
|
|
44
|
+
|
|
45
|
+
export type FleetIssueCause =
|
|
46
|
+
| FleetFailedCause
|
|
47
|
+
| FleetBlockedCause
|
|
48
|
+
| FleetWaitingCause;
|
|
49
|
+
|
|
50
|
+
export type FleetIssueMember = {
|
|
51
|
+
convergence:
|
|
52
|
+
| 'pending'
|
|
53
|
+
| 'submitting'
|
|
54
|
+
| 'rate_limited'
|
|
55
|
+
| 'settled'
|
|
56
|
+
| 'blocked'
|
|
57
|
+
| 'failed'
|
|
58
|
+
| null;
|
|
59
|
+
blockedBy: string | null;
|
|
60
|
+
error: string | null;
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
export type FleetMemberIssue =
|
|
64
|
+
| { group: 'failed'; cause: FleetFailedCause }
|
|
65
|
+
| { group: 'blocked'; cause: FleetBlockedCause }
|
|
66
|
+
| { group: 'waiting'; cause: FleetWaitingCause };
|
|
67
|
+
|
|
68
|
+
const FAILED_PREFIXES: ReadonlyArray<[string, FleetFailedCause]> = [
|
|
69
|
+
['provider acceptance unknown', 'provider_unconfirmed'],
|
|
70
|
+
['provider accepted ', 'provider_unconfirmed'],
|
|
71
|
+
['Monitor create could not be charged', 'billing'],
|
|
72
|
+
['Monitor tool ', 'unsupported_tool'],
|
|
73
|
+
['Provider resource ', 'provider_state_mismatch'],
|
|
74
|
+
['The provider holds radar', 'provider_state_mismatch'],
|
|
75
|
+
['This member is bound to radar', 'provider_state_mismatch'],
|
|
76
|
+
['The provider accepted the delete', 'provider_state_mismatch'],
|
|
77
|
+
['The provider returned an unrecognized', 'provider_state_mismatch'],
|
|
78
|
+
['The provider rejected this monitor.', 'provider_rejected'],
|
|
79
|
+
];
|
|
80
|
+
|
|
81
|
+
/** `describeProviderMonitorBatchItemFailure` appends `— code=…` or field reasons. */
|
|
82
|
+
const PROVIDER_REJECTION_DETAIL = / — (code=|[\w.[\]]+: )/;
|
|
83
|
+
|
|
84
|
+
export function classifyFleetFailure(error: string | null): FleetFailedCause {
|
|
85
|
+
const message = error?.trim() ?? '';
|
|
86
|
+
for (const [prefix, cause] of FAILED_PREFIXES) {
|
|
87
|
+
if (message.startsWith(prefix)) return cause;
|
|
88
|
+
}
|
|
89
|
+
return PROVIDER_REJECTION_DETAIL.test(message) ? 'provider_rejected' : 'other';
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
const BLOCKED_CAUSES: Readonly<Record<string, FleetBlockedCause>> = {
|
|
93
|
+
[FLEET_BLOCKED_BY.watchedEntities]: 'watched_accounts_limit',
|
|
94
|
+
[FLEET_BLOCKED_BY.monitorsPerEntity]: 'monitors_per_account_limit',
|
|
95
|
+
[FLEET_BLOCKED_BY.rolloutAccess]: 'rollout_access',
|
|
96
|
+
[FLEET_REFUSAL.identityOccupied]: 'identity_occupied',
|
|
97
|
+
[FLEET_REFUSAL.batchUnsupported]: 'unsupported_tool',
|
|
98
|
+
[FLEET_REFUSAL.orphanedResource]: 'needs_support',
|
|
99
|
+
[FLEET_REFUSAL.resourceOwnedByOtherOrg]: 'needs_support',
|
|
100
|
+
[FLEET_REFUSAL.resourceBindingConflict]: 'needs_support',
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
export function classifyFleetBlock(
|
|
104
|
+
blockedBy: string | null,
|
|
105
|
+
): FleetBlockedCause {
|
|
106
|
+
return (blockedBy && BLOCKED_CAUSES[blockedBy]) || 'unknown_code';
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/** The member's issue, or null when it is live or still being set up. */
|
|
110
|
+
export function classifyFleetMemberIssue(
|
|
111
|
+
member: FleetIssueMember,
|
|
112
|
+
): FleetMemberIssue | null {
|
|
113
|
+
switch (member.convergence) {
|
|
114
|
+
case 'failed':
|
|
115
|
+
return { group: 'failed', cause: classifyFleetFailure(member.error) };
|
|
116
|
+
case 'blocked':
|
|
117
|
+
return { group: 'blocked', cause: classifyFleetBlock(member.blockedBy) };
|
|
118
|
+
case 'rate_limited':
|
|
119
|
+
return { group: 'waiting', cause: 'rate_limited' };
|
|
120
|
+
default:
|
|
121
|
+
return null;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export type FleetIssueSummary = {
|
|
126
|
+
total: number;
|
|
127
|
+
failed: { total: number; causes: Record<FleetFailedCause, number> };
|
|
128
|
+
blocked: { total: number; causes: Record<FleetBlockedCause, number> };
|
|
129
|
+
waiting: { total: number; next_attempt_at: number | null };
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
function zeroes<T extends string>(keys: readonly T[]): Record<T, number> {
|
|
133
|
+
return Object.fromEntries(keys.map((key) => [key, 0])) as Record<T, number>;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export function emptyFleetIssueSummary(): FleetIssueSummary {
|
|
137
|
+
return {
|
|
138
|
+
total: 0,
|
|
139
|
+
failed: { total: 0, causes: zeroes(FLEET_FAILED_CAUSES) },
|
|
140
|
+
blocked: { total: 0, causes: zeroes(FLEET_BLOCKED_CAUSES) },
|
|
141
|
+
waiting: { total: 0, next_attempt_at: null },
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Fixed-size counts by group and cause. `total` counts failed and blocked
|
|
147
|
+
* members only: a rate-limited member retries on its own and needs nothing.
|
|
148
|
+
*/
|
|
149
|
+
export function summarizeFleetIssues(
|
|
150
|
+
members: Iterable<FleetIssueMember & { nextAttemptAt?: number | null }>,
|
|
151
|
+
): FleetIssueSummary {
|
|
152
|
+
const summary = emptyFleetIssueSummary();
|
|
153
|
+
for (const member of members) {
|
|
154
|
+
const issue = classifyFleetMemberIssue(member);
|
|
155
|
+
if (!issue) continue;
|
|
156
|
+
if (issue.group === 'failed') {
|
|
157
|
+
summary.failed.total += 1;
|
|
158
|
+
summary.failed.causes[issue.cause] += 1;
|
|
159
|
+
} else if (issue.group === 'blocked') {
|
|
160
|
+
summary.blocked.total += 1;
|
|
161
|
+
summary.blocked.causes[issue.cause] += 1;
|
|
162
|
+
} else {
|
|
163
|
+
summary.waiting.total += 1;
|
|
164
|
+
const next = member.nextAttemptAt ?? null;
|
|
165
|
+
if (
|
|
166
|
+
next !== null &&
|
|
167
|
+
(summary.waiting.next_attempt_at === null ||
|
|
168
|
+
next < summary.waiting.next_attempt_at)
|
|
169
|
+
) {
|
|
170
|
+
summary.waiting.next_attempt_at = next;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
summary.total = summary.failed.total + summary.blocked.total;
|
|
175
|
+
return summary;
|
|
176
|
+
}
|
|
@@ -6,5 +6,22 @@ export const FLEET_BLOCKED_BY = {
|
|
|
6
6
|
monitorsPerEntity: OrgLimit.MonitorsPerEntity,
|
|
7
7
|
rolloutAccess: 'monitor.rollout_access',
|
|
8
8
|
} as const;
|
|
9
|
+
/** Refusals a fleet's provider work records on a member it could not create. */
|
|
10
|
+
export const FLEET_REFUSAL = {
|
|
11
|
+
batchUnsupported: 'provider.batch_create_unsupported',
|
|
12
|
+
identityOccupied: 'provider.identity_occupied',
|
|
13
|
+
/** Created, unbillable, and its deletion could not be confirmed. */
|
|
14
|
+
orphanedResource: 'provider.orphaned_resource',
|
|
15
|
+
/**
|
|
16
|
+
* The provider holds a matching resource, but another Deepline organization
|
|
17
|
+
* created it. Adopting it would cross-wire two customers.
|
|
18
|
+
*/
|
|
19
|
+
resourceOwnedByOtherOrg: 'provider.resource_owned_by_other_org',
|
|
20
|
+
/**
|
|
21
|
+
* The member's binding and its row name different provider resources, so a
|
|
22
|
+
* removal cannot prove which radar it is deleting.
|
|
23
|
+
*/
|
|
24
|
+
resourceBindingConflict: 'provider.resource_binding_conflict',
|
|
25
|
+
} as const;
|
|
9
26
|
export const MAX_MEMBER_DEFINITION_BYTES = 2_048;
|
|
10
27
|
export const MAX_FLEET_SETTLE_ITEMS = 100;
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A fleet as the Fleets list presents it: one status a customer can act on,
|
|
3
|
+
* and the order that puts the fleet needing the most attention first.
|
|
4
|
+
*
|
|
5
|
+
* The verdict (`verdict.ts`) says what convergence is doing. This says what the
|
|
6
|
+
* customer should do about it, so a fleet that converged with members it could
|
|
7
|
+
* not create reads "needs attention", not "running".
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { monitorPauseKind } from '@deepline/monitors/billing/credit-recovery';
|
|
11
|
+
import type { FleetLifecycleStatus, FleetStatusVerdict } from './verdict';
|
|
12
|
+
|
|
13
|
+
export const FLEET_OVERVIEW_STATUSES = [
|
|
14
|
+
'needs_attention',
|
|
15
|
+
'paused_credits',
|
|
16
|
+
'paused_cap',
|
|
17
|
+
'paused_billing',
|
|
18
|
+
'setting_up',
|
|
19
|
+
'running',
|
|
20
|
+
'deactivated',
|
|
21
|
+
] as const;
|
|
22
|
+
export type FleetOverviewStatus = (typeof FLEET_OVERVIEW_STATUSES)[number];
|
|
23
|
+
|
|
24
|
+
/** Every status but deactivated: the list's default. */
|
|
25
|
+
export const FLEET_OVERVIEW_DEFAULT_STATUSES: readonly FleetOverviewStatus[] =
|
|
26
|
+
FLEET_OVERVIEW_STATUSES.filter((status) => status !== 'deactivated');
|
|
27
|
+
|
|
28
|
+
export function isFleetOverviewStatus(
|
|
29
|
+
value: unknown,
|
|
30
|
+
): value is FleetOverviewStatus {
|
|
31
|
+
return (FLEET_OVERVIEW_STATUSES as readonly unknown[]).includes(value);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export function fleetOverviewStatus(input: {
|
|
35
|
+
lifecycle: FleetLifecycleStatus;
|
|
36
|
+
verdict: FleetStatusVerdict;
|
|
37
|
+
/** Failed plus blocked members. */
|
|
38
|
+
issues: number;
|
|
39
|
+
/** Members the last provider check found missing or inactive. */
|
|
40
|
+
missingAtProvider: number;
|
|
41
|
+
billingSuspensionReason?: string | null;
|
|
42
|
+
}): FleetOverviewStatus {
|
|
43
|
+
switch (input.lifecycle) {
|
|
44
|
+
case 'deactivating':
|
|
45
|
+
case 'deactivated':
|
|
46
|
+
return 'deactivated';
|
|
47
|
+
case 'billing_suspending':
|
|
48
|
+
case 'billing_suspended':
|
|
49
|
+
case 'billing_reactivating': {
|
|
50
|
+
const kind = monitorPauseKind(input.billingSuspensionReason ?? undefined);
|
|
51
|
+
return kind === 'credits'
|
|
52
|
+
? 'paused_credits'
|
|
53
|
+
: kind === 'cap'
|
|
54
|
+
? 'paused_cap'
|
|
55
|
+
: 'paused_billing';
|
|
56
|
+
}
|
|
57
|
+
case 'active':
|
|
58
|
+
if (
|
|
59
|
+
input.issues > 0 ||
|
|
60
|
+
input.missingAtProvider > 0 ||
|
|
61
|
+
input.verdict === 'degraded'
|
|
62
|
+
) {
|
|
63
|
+
return 'needs_attention';
|
|
64
|
+
}
|
|
65
|
+
return input.verdict === 'converged' ? 'running' : 'setting_up';
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
const ATTENTION_RANK: Record<FleetOverviewStatus, number> = {
|
|
70
|
+
needs_attention: 0,
|
|
71
|
+
paused_credits: 1,
|
|
72
|
+
paused_cap: 1,
|
|
73
|
+
paused_billing: 1,
|
|
74
|
+
setting_up: 2,
|
|
75
|
+
running: 3,
|
|
76
|
+
deactivated: 4,
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
export const FLEET_OVERVIEW_SORTS = [
|
|
80
|
+
'attention',
|
|
81
|
+
'findings',
|
|
82
|
+
'newest',
|
|
83
|
+
'name',
|
|
84
|
+
] as const;
|
|
85
|
+
export type FleetOverviewSort = (typeof FLEET_OVERVIEW_SORTS)[number];
|
|
86
|
+
|
|
87
|
+
export function isFleetOverviewSort(value: unknown): value is FleetOverviewSort {
|
|
88
|
+
return (FLEET_OVERVIEW_SORTS as readonly unknown[]).includes(value);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export type FleetOverviewSortKey = {
|
|
92
|
+
id: string;
|
|
93
|
+
status: FleetOverviewStatus;
|
|
94
|
+
issues: number;
|
|
95
|
+
/** Null when no member has a findings row. Sorts below zero. */
|
|
96
|
+
findings: number | null;
|
|
97
|
+
createdAt: number;
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
export function compareFleetOverviews(sort: FleetOverviewSort) {
|
|
101
|
+
return (left: FleetOverviewSortKey, right: FleetOverviewSortKey): number => {
|
|
102
|
+
const byName = left.id.localeCompare(right.id);
|
|
103
|
+
switch (sort) {
|
|
104
|
+
case 'attention':
|
|
105
|
+
return (
|
|
106
|
+
ATTENTION_RANK[left.status] - ATTENTION_RANK[right.status] ||
|
|
107
|
+
right.issues - left.issues ||
|
|
108
|
+
byName
|
|
109
|
+
);
|
|
110
|
+
case 'findings':
|
|
111
|
+
return (right.findings ?? -1) - (left.findings ?? -1) || byName;
|
|
112
|
+
case 'newest':
|
|
113
|
+
return right.createdAt - left.createdAt || byName;
|
|
114
|
+
case 'name':
|
|
115
|
+
return byName;
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
}
|
|
@@ -77,6 +77,15 @@ export type FleetPlan = {
|
|
|
77
77
|
removes: number;
|
|
78
78
|
/** Refusals by the limit that caused them, e.g. `{'monitor.watched_entities': 3}`. */
|
|
79
79
|
blocked: Record<string, number>;
|
|
80
|
+
/**
|
|
81
|
+
* Creates, updates and removes for members whose last attempt failed. Each
|
|
82
|
+
* is also counted in `creates`, `updates` or `removes`.
|
|
83
|
+
*/
|
|
84
|
+
retries: number;
|
|
85
|
+
/** Creates for members a limit had blocked and now admits. Included in `creates`. */
|
|
86
|
+
unblocked: number;
|
|
87
|
+
/** Creates for rows the fleet did not own a monitor for. Included in `creates`. */
|
|
88
|
+
newRows: number;
|
|
80
89
|
};
|
|
81
90
|
|
|
82
91
|
export type FleetMembershipMember = {
|
|
@@ -234,6 +243,9 @@ export function planFleetMembers(input: {
|
|
|
234
243
|
let creates = 0;
|
|
235
244
|
let updates = 0;
|
|
236
245
|
let removes = 0;
|
|
246
|
+
let retries = 0;
|
|
247
|
+
let unblocked = 0;
|
|
248
|
+
let newRows = 0;
|
|
237
249
|
|
|
238
250
|
const refuse = (member: PlannedFleetMember, blockedBy: string) => {
|
|
239
251
|
blocked[blockedBy] = (blocked[blockedBy] ?? 0) + 1;
|
|
@@ -270,6 +282,8 @@ export function planFleetMembers(input: {
|
|
|
270
282
|
// rather than needing a second write path that could disagree with it.
|
|
271
283
|
members.push({ ...base, action: 'update', needsSeed: false });
|
|
272
284
|
updates += 1;
|
|
285
|
+
// A failed update keeps its applied hash, so it is retried as an update.
|
|
286
|
+
if (owned?.convergence === 'failed') retries += 1;
|
|
273
287
|
continue;
|
|
274
288
|
}
|
|
275
289
|
|
|
@@ -292,6 +306,10 @@ export function planFleetMembers(input: {
|
|
|
292
306
|
entityCounts.set(entityKey, onEntity + 1);
|
|
293
307
|
members.push(base);
|
|
294
308
|
creates += 1;
|
|
309
|
+
// A failed member never reached the provider, so this create is its retry.
|
|
310
|
+
if (owned?.convergence === 'failed') retries += 1;
|
|
311
|
+
if (owned?.convergence === 'blocked') unblocked += 1;
|
|
312
|
+
if (!owned) newRows += 1;
|
|
295
313
|
}
|
|
296
314
|
|
|
297
315
|
const plannedKeys = new Set(members.map((member) => member.monitorKey));
|
|
@@ -319,7 +337,17 @@ export function planFleetMembers(input: {
|
|
|
319
337
|
});
|
|
320
338
|
plannedKeys.add(owned.monitorKey);
|
|
321
339
|
removes += 1;
|
|
340
|
+
if (owned.convergence === 'failed') retries += 1;
|
|
322
341
|
}
|
|
323
342
|
|
|
324
|
-
return {
|
|
343
|
+
return {
|
|
344
|
+
members,
|
|
345
|
+
creates,
|
|
346
|
+
updates,
|
|
347
|
+
removes,
|
|
348
|
+
blocked,
|
|
349
|
+
retries,
|
|
350
|
+
unblocked,
|
|
351
|
+
newRows,
|
|
352
|
+
};
|
|
325
353
|
}
|
|
@@ -63,7 +63,10 @@ export function legacyRadarMonitorTool(radarType: string): string | null {
|
|
|
63
63
|
|
|
64
64
|
export type LegacyExpectedConfig = {
|
|
65
65
|
radar_type: string;
|
|
66
|
-
/**
|
|
66
|
+
/**
|
|
67
|
+
* Contact types only: lowercased LinkedIn `/in/<slug>`, as written. It may
|
|
68
|
+
* still be percent-encoded; the match decodes it like the live URL.
|
|
69
|
+
*/
|
|
67
70
|
profile_slug?: string;
|
|
68
71
|
/** Company types and `contact_job_changes`; optional on social posts. */
|
|
69
72
|
domain?: string;
|
|
@@ -143,13 +146,13 @@ export function parseLegacyExpectedConfig(text: string): LegacyExpectedConfig {
|
|
|
143
146
|
};
|
|
144
147
|
}
|
|
145
148
|
|
|
146
|
-
/**
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
let slug =
|
|
149
|
+
/**
|
|
150
|
+
* A LinkedIn `/in/<slug>` segment percent-decoded, trimmed and lowercased:
|
|
151
|
+
* `Gustav-Witth%C3%B6ft` -> `gustav-witthöft`. Both sides of the match go
|
|
152
|
+
* through it, so an encoded and a decoded spelling of one slug compare equal.
|
|
153
|
+
*/
|
|
154
|
+
export function normalizeLinkedinProfileSlug(raw: string): string | null {
|
|
155
|
+
let slug = raw;
|
|
153
156
|
try {
|
|
154
157
|
slug = decodeURIComponent(slug);
|
|
155
158
|
} catch {
|
|
@@ -159,6 +162,15 @@ export function linkedinProfileSlug(url: unknown): string | null {
|
|
|
159
162
|
return slug || null;
|
|
160
163
|
}
|
|
161
164
|
|
|
165
|
+
/** Normalized `/in/<slug>` of a LinkedIn profile URL, or null. */
|
|
166
|
+
export function linkedinProfileSlug(url: unknown): string | null {
|
|
167
|
+
const text = nonEmptyText(url);
|
|
168
|
+
if (!text) return null;
|
|
169
|
+
const match = /\/in\/([^/?#]+)/i.exec(text);
|
|
170
|
+
if (!match?.[1]) return null;
|
|
171
|
+
return normalizeLinkedinProfileSlug(match[1]);
|
|
172
|
+
}
|
|
173
|
+
|
|
162
174
|
/** Scheme, `www.`, port, path and case removed: `https://WWW.Acme.com/x` -> `acme.com`. */
|
|
163
175
|
export function normalizeRadarDomain(value: unknown): string | null {
|
|
164
176
|
let text = nonEmptyText(value)?.toLowerCase();
|
|
@@ -213,7 +225,8 @@ function stableJson(value: unknown): string {
|
|
|
213
225
|
* Returns null on a match, otherwise the refusal reason.
|
|
214
226
|
*
|
|
215
227
|
* - same `radar_type`;
|
|
216
|
-
* - contact types: the same LinkedIn `/in/<slug
|
|
228
|
+
* - contact types: the same LinkedIn `/in/<slug>`, each side percent-decoded
|
|
229
|
+
* once (`normalizeLinkedinProfileSlug`);
|
|
217
230
|
* - company types and `contact_job_changes`: the same normalized domain;
|
|
218
231
|
* - contact social types: a domain, when expected, may be missing (the one
|
|
219
232
|
* allowed broadening) but never different; an unexpected domain refuses;
|
|
@@ -232,7 +245,13 @@ export function legacyMonitorConfigMismatch(input: {
|
|
|
232
245
|
}
|
|
233
246
|
const contact = isLegacyContactRadarType(expected.radar_type);
|
|
234
247
|
if (contact) {
|
|
235
|
-
|
|
248
|
+
// Decoded here rather than when parsed: sealed approvals store the slug
|
|
249
|
+
// as written, and decoding exactly once keeps `%25` meaning `%`.
|
|
250
|
+
const expectedSlug = expected.profile_slug
|
|
251
|
+
? normalizeLinkedinProfileSlug(expected.profile_slug)
|
|
252
|
+
: null;
|
|
253
|
+
const liveSlug = linkedinProfileSlug(payload.profile_url);
|
|
254
|
+
if (!expectedSlug || liveSlug !== expectedSlug) {
|
|
236
255
|
return 'required_monitor_profile_changed';
|
|
237
256
|
}
|
|
238
257
|
}
|