@indigoai-us/hq-cli 5.345.159 → 5.345.160
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 +24 -0
- package/dist/command-catalog.generated.d.ts +4 -4
- package/dist/command-catalog.generated.js +4 -4
- package/dist/commands/access.d.ts +6 -0
- package/dist/commands/access.js +18 -1
- package/dist/commands/acl-lock.d.ts +41 -0
- package/dist/commands/acl-lock.js +28 -0
- package/dist/commands/agent-enroll.d.ts +2 -0
- package/dist/commands/agent-enroll.js +9 -4
- package/dist/commands/agents.js +5 -11
- package/dist/commands/billing-sponsor.d.ts +4 -4
- package/dist/commands/billing-sponsor.js +11 -11
- package/dist/commands/billing-usage.d.ts +22 -8
- package/dist/commands/billing-usage.js +57 -22
- package/dist/commands/billing.d.ts +7 -7
- package/dist/commands/billing.js +13 -13
- package/dist/commands/cloud-provision.js +2 -2
- package/dist/commands/cloud.js +7 -7
- package/dist/commands/db-remote-deps.js +12 -1
- package/dist/commands/files.js +19 -7
- package/dist/commands/meetings.d.ts +4 -4
- package/dist/commands/meetings.js +17 -8
- package/dist/commands/skill.js +6 -6
- package/dist/commands/whoami.js +1 -1
- package/dist/hook-engine-path.js +13 -2
- package/dist/hq-cloud-sync-runner/bin/sync-runner.js +982 -426
- package/dist/hq-cloud-sync-runner/package.json +1 -1
- package/dist/lib/billing/plan-limit-refusals.d.ts +13 -3
- package/dist/lib/billing/plan-limit-refusals.js +26 -3
- package/dist/lib/billing/plan-limit-upgrade-url.d.ts +8 -0
- package/dist/lib/billing/plan-limit-upgrade-url.js +18 -0
- package/dist/lib/billing/plan-lock.d.ts +22 -6
- package/dist/lib/billing/plan-lock.js +58 -30
- package/dist/lib/billing/usage-cost.d.ts +24 -2
- package/dist/lib/billing/usage-cost.js +103 -3
- package/dist/lib/billing/usage-only.d.ts +37 -1
- package/dist/lib/billing/usage-only.js +89 -4
- package/dist/lib/billing/usage-pause.d.ts +27 -0
- package/dist/lib/billing/usage-pause.js +50 -0
- package/dist/lib/db/control-plane.d.ts +5 -0
- package/dist/lib/db/control-plane.js +10 -0
- package/dist/lib/flag-registry-worker-source.generated.d.ts +1 -1
- package/dist/lib/flag-registry-worker-source.generated.js +1 -1
- package/dist/lib/hook-engine/resolve.d.ts +14 -0
- package/dist/lib/hook-engine/resolve.js +55 -1
- package/dist/lib/plan-limit-nag.d.ts +0 -16
- package/dist/lib/plan-limit-nag.js +17 -18
- package/dist/main.d.ts +0 -2
- package/dist/main.js +19 -57
- package/dist/utils/plan-gate-error.d.ts +30 -14
- package/dist/utils/plan-gate-error.js +60 -46
- package/dist/utils/team-upgrade.d.ts +19 -6
- package/dist/utils/team-upgrade.js +37 -39
- package/package.json +8 -8
|
@@ -1,58 +1,56 @@
|
|
|
1
1
|
import { isHeadless } from "./headless.js";
|
|
2
2
|
import open from "open";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
import { usageSwitchPageUrl } from "../lib/billing/plan-limit-upgrade-url.js";
|
|
4
|
+
import { resolveProcessFlagCompanyContext } from "../lib/process-flag-company-context.js";
|
|
5
|
+
/** The lines printed before the switch page link. Names no plan. */
|
|
6
|
+
export function usageSwitchLines(url) {
|
|
7
|
+
return [
|
|
8
|
+
"The flat plans are closed to new subscribers. To move this company onto usage pricing, switch from its Billing page.",
|
|
9
|
+
"Usage pricing has no plan fee: you pay for what you use.",
|
|
10
|
+
"Add a card first with `hq billing checkout`, then switch here (company owners only):",
|
|
11
|
+
url,
|
|
12
|
+
];
|
|
9
13
|
}
|
|
14
|
+
/** The fallback sentence when no console origin can be derived. */
|
|
15
|
+
export const USAGE_SWITCH_NO_URL_MESSAGE = "Switch this company to usage pricing from its Billing page in the HQ Console.";
|
|
10
16
|
/**
|
|
11
|
-
*
|
|
12
|
-
*
|
|
17
|
+
* Print (and open, unless told not to) the company's usage-pricing switch
|
|
18
|
+
* page. Returns the URL, or null when none could be built.
|
|
13
19
|
*/
|
|
14
|
-
export async function
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
body: {
|
|
22
|
-
companyUid,
|
|
23
|
-
entrySurface: "cli_limit",
|
|
24
|
-
successUrl: CHECKOUT_SUCCESS_URL,
|
|
25
|
-
cancelUrl: CHECKOUT_CANCEL_URL,
|
|
26
|
-
},
|
|
27
|
-
});
|
|
28
|
-
if (!response.ok) {
|
|
29
|
-
const body = (await response.json().catch(() => ({})));
|
|
30
|
-
if (response.status === 403 || /owner/i.test(`${body.error ?? ""} ${body.message ?? ""}`)) {
|
|
31
|
-
throw ownerUpgradeError();
|
|
20
|
+
export async function openUsageSwitch(opts = {}) {
|
|
21
|
+
const write = opts.write ?? ((text) => process.stdout.write(text));
|
|
22
|
+
const slug = opts.companySlug?.trim() || resolveProcessFlagCompanyContext().companySlug || undefined;
|
|
23
|
+
const url = usageSwitchPageUrl(slug);
|
|
24
|
+
if (!url) {
|
|
25
|
+
if (opts.json) {
|
|
26
|
+
write(`${JSON.stringify({ url: null, message: USAGE_SWITCH_NO_URL_MESSAGE })}\n`);
|
|
32
27
|
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
throw new Error("Checkout response did not include a hosted checkout URL.");
|
|
28
|
+
else {
|
|
29
|
+
write(`${USAGE_SWITCH_NO_URL_MESSAGE}\n`);
|
|
30
|
+
}
|
|
31
|
+
return null;
|
|
38
32
|
}
|
|
39
|
-
const write = opts.write ?? ((text) => process.stdout.write(text));
|
|
40
33
|
if (opts.json) {
|
|
41
|
-
write(`${JSON.stringify({
|
|
34
|
+
write(`${JSON.stringify({
|
|
35
|
+
url,
|
|
36
|
+
legacyPlansClosed: true,
|
|
37
|
+
message: usageSwitchLines(url).slice(0, 3).join(" "),
|
|
38
|
+
})}\n`);
|
|
42
39
|
return url;
|
|
43
40
|
}
|
|
44
|
-
|
|
41
|
+
for (const line of usageSwitchLines(url))
|
|
42
|
+
write(`${line}\n`);
|
|
45
43
|
const skipBrowser = opts.noBrowser || (opts.headless ?? isHeadless());
|
|
46
|
-
if (skipBrowser)
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
44
|
+
if (!skipBrowser)
|
|
45
|
+
await openInBrowser(url, opts);
|
|
46
|
+
return url;
|
|
47
|
+
}
|
|
48
|
+
async function openInBrowser(url, opts) {
|
|
50
49
|
try {
|
|
51
50
|
await (opts.openUrl ?? open)(url);
|
|
52
51
|
}
|
|
53
52
|
catch (err) {
|
|
54
53
|
(opts.error ?? ((text) => process.stderr.write(text)))(`Couldn't launch your browser (${err instanceof Error ? err.message : String(err)}). Open this URL to continue: ${url}\n`);
|
|
55
54
|
}
|
|
56
|
-
return url;
|
|
57
55
|
}
|
|
58
56
|
//# sourceMappingURL=team-upgrade.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@indigoai-us/hq-cli",
|
|
3
|
-
"version": "5.345.
|
|
3
|
+
"version": "5.345.160",
|
|
4
4
|
"description": "HQ by Indigo management CLI — modules and cloud sync",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"@aws-sdk/client-iot-data-plane": "^3.1096.0",
|
|
53
53
|
"@aws-sdk/client-s3": "^3.1049.0",
|
|
54
54
|
"@aws-sdk/dsql-signer": "^3.1146.0",
|
|
55
|
-
"@indigoai-us/hq-cloud": "6.18.
|
|
55
|
+
"@indigoai-us/hq-cloud": "6.18.98",
|
|
56
56
|
"@indigoai-us/hq-flags-client": "^0.1.2",
|
|
57
57
|
"@modelcontextprotocol/sdk": "1.29.0",
|
|
58
58
|
"@sentry/node": "^10.49.0",
|
|
@@ -114,11 +114,11 @@
|
|
|
114
114
|
"*.{ts,tsx,mts,cts,js,jsx,mjs,cjs}": "eslint --cache --no-error-on-unmatched-pattern"
|
|
115
115
|
},
|
|
116
116
|
"optionalDependencies": {
|
|
117
|
-
"@indigoai-us/hq-hook-win32-x64": "5.345.
|
|
118
|
-
"@indigoai-us/hq-hook-win32-arm64": "5.345.
|
|
119
|
-
"@indigoai-us/hq-hook-darwin-x64": "5.345.
|
|
120
|
-
"@indigoai-us/hq-hook-darwin-arm64": "5.345.
|
|
121
|
-
"@indigoai-us/hq-hook-linux-x64": "5.345.
|
|
122
|
-
"@indigoai-us/hq-hook-linux-arm64": "5.345.
|
|
117
|
+
"@indigoai-us/hq-hook-win32-x64": "5.345.160",
|
|
118
|
+
"@indigoai-us/hq-hook-win32-arm64": "5.345.160",
|
|
119
|
+
"@indigoai-us/hq-hook-darwin-x64": "5.345.160",
|
|
120
|
+
"@indigoai-us/hq-hook-darwin-arm64": "5.345.160",
|
|
121
|
+
"@indigoai-us/hq-hook-linux-x64": "5.345.160",
|
|
122
|
+
"@indigoai-us/hq-hook-linux-arm64": "5.345.160"
|
|
123
123
|
}
|
|
124
124
|
}
|