@autohq/cli 0.1.359 → 0.1.361
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/agent-bridge.js +120 -8
- package/dist/index.js +131 -10
- package/package.json +1 -1
package/dist/agent-bridge.js
CHANGED
|
@@ -23492,7 +23492,7 @@ Object.assign(lookup, {
|
|
|
23492
23492
|
// package.json
|
|
23493
23493
|
var package_default = {
|
|
23494
23494
|
name: "@autohq/cli",
|
|
23495
|
-
version: "0.1.
|
|
23495
|
+
version: "0.1.361",
|
|
23496
23496
|
license: "SEE LICENSE IN README.md",
|
|
23497
23497
|
publishConfig: {
|
|
23498
23498
|
access: "public"
|
|
@@ -24190,6 +24190,8 @@ var AuthScopeSchema = external_exports.enum([
|
|
|
24190
24190
|
"provider_grants:write",
|
|
24191
24191
|
"provider_grants:use",
|
|
24192
24192
|
"members:read",
|
|
24193
|
+
"billing:read",
|
|
24194
|
+
"billing:write",
|
|
24193
24195
|
"secrets:read",
|
|
24194
24196
|
"secrets:write",
|
|
24195
24197
|
"secrets:use",
|
|
@@ -26023,6 +26025,8 @@ var GITHUB_MCP_TOOL_NAMES = [
|
|
|
26023
26025
|
"update_pull_request_branch"
|
|
26024
26026
|
];
|
|
26025
26027
|
var GITHUB_MCP_PROXY_TOOL_NAMES = [
|
|
26028
|
+
"actions_secret_list",
|
|
26029
|
+
"actions_secret_write",
|
|
26026
26030
|
"enable_pull_request_auto_merge",
|
|
26027
26031
|
"upsert_issue_comment"
|
|
26028
26032
|
];
|
|
@@ -26034,6 +26038,13 @@ var GITHUB_MCP_MERGE_TOOLS = [
|
|
|
26034
26038
|
"merge_pull_request",
|
|
26035
26039
|
"enable_pull_request_auto_merge"
|
|
26036
26040
|
];
|
|
26041
|
+
var GITHUB_MCP_SECRETS_TOOLS = [
|
|
26042
|
+
"actions_secret_list",
|
|
26043
|
+
"actions_secret_write"
|
|
26044
|
+
];
|
|
26045
|
+
var GITHUB_MCP_SECRETS_WRITE_TOOLS = [
|
|
26046
|
+
"actions_secret_write"
|
|
26047
|
+
];
|
|
26037
26048
|
var GITHUB_MCP_WRITE_TOOLS = [
|
|
26038
26049
|
"actions_run_trigger",
|
|
26039
26050
|
"add_comment_to_pending_review",
|
|
@@ -26058,7 +26069,9 @@ var githubMcpToolNameSet = new Set(
|
|
|
26058
26069
|
);
|
|
26059
26070
|
var githubMcpWriteToolSet = /* @__PURE__ */ new Set([
|
|
26060
26071
|
...GITHUB_MCP_WRITE_TOOLS,
|
|
26061
|
-
...GITHUB_MCP_PROXY_TOOL_NAMES
|
|
26072
|
+
...GITHUB_MCP_PROXY_TOOL_NAMES.filter(
|
|
26073
|
+
(name23) => name23 !== "actions_secret_list"
|
|
26074
|
+
)
|
|
26062
26075
|
]);
|
|
26063
26076
|
var githubMcpProxyToolSet = new Set(
|
|
26064
26077
|
GITHUB_MCP_PROXY_TOOL_NAMES
|
|
@@ -26066,6 +26079,12 @@ var githubMcpProxyToolSet = new Set(
|
|
|
26066
26079
|
var githubMcpMergeToolSet = new Set(
|
|
26067
26080
|
GITHUB_MCP_MERGE_TOOLS
|
|
26068
26081
|
);
|
|
26082
|
+
var githubMcpSecretsToolSet = new Set(
|
|
26083
|
+
GITHUB_MCP_SECRETS_TOOLS
|
|
26084
|
+
);
|
|
26085
|
+
var githubMcpSecretsWriteToolSet = new Set(
|
|
26086
|
+
GITHUB_MCP_SECRETS_WRITE_TOOLS
|
|
26087
|
+
);
|
|
26069
26088
|
|
|
26070
26089
|
// ../../packages/schemas/src/mounts.ts
|
|
26071
26090
|
var AbsoluteMountPathSchema = external_exports.string().trim().min(1).refine((value2) => value2.startsWith("/"), {
|
|
@@ -26090,6 +26109,7 @@ var DEFAULT_GITHUB_MOUNT_CAPABILITIES = {
|
|
|
26090
26109
|
checks: "read",
|
|
26091
26110
|
actions: "read",
|
|
26092
26111
|
workflows: "none",
|
|
26112
|
+
secrets: "none",
|
|
26093
26113
|
merge: "none"
|
|
26094
26114
|
};
|
|
26095
26115
|
var GitMountAuthSchema = external_exports.discriminatedUnion("kind", [
|
|
@@ -26112,6 +26132,10 @@ var GitMountAuthSchema = external_exports.discriminatedUnion("kind", [
|
|
|
26112
26132
|
checks: GithubMountCapabilityLevelSchema.default("read"),
|
|
26113
26133
|
actions: GithubMountCapabilityLevelSchema.default("read"),
|
|
26114
26134
|
workflows: GithubMountCapabilityLevelSchema.default("none"),
|
|
26135
|
+
// Grants the GitHub Actions secrets API (repository and environment
|
|
26136
|
+
// secrets). Secret values are write-only on GitHub's side; read grants
|
|
26137
|
+
// listing secret names, never values.
|
|
26138
|
+
secrets: GithubMountCapabilityLevelSchema.default("none"),
|
|
26115
26139
|
merge: GithubMountMergeCapabilityLevelSchema.default("none")
|
|
26116
26140
|
}).superRefine((capabilities, context) => {
|
|
26117
26141
|
if (capabilities.merge === "write" && (capabilities.contents !== "write" || capabilities.pullRequests !== "write")) {
|
|
@@ -27907,6 +27931,89 @@ var OrganizationIdentityPolicySchema = external_exports.object({
|
|
|
27907
27931
|
});
|
|
27908
27932
|
var UpdateOrganizationIdentityPolicyRequestSchema = OrganizationIdentityPolicySchema.strict();
|
|
27909
27933
|
|
|
27934
|
+
// ../../packages/schemas/src/billing.ts
|
|
27935
|
+
var FEE_CARD_2026_07_06 = {
|
|
27936
|
+
version: "2026-07-06",
|
|
27937
|
+
effectiveAt: "2026-07-06T00:00:00.000Z",
|
|
27938
|
+
feeRate: 0.05
|
|
27939
|
+
};
|
|
27940
|
+
var BILLING_FEE_CARDS = {
|
|
27941
|
+
[FEE_CARD_2026_07_06.version]: FEE_CARD_2026_07_06
|
|
27942
|
+
};
|
|
27943
|
+
var CURRENT_BILLING_FEE_VERSION = FEE_CARD_2026_07_06.version;
|
|
27944
|
+
var CREDIT_EVENT_TYPES = [
|
|
27945
|
+
"signup_grant",
|
|
27946
|
+
"purchase",
|
|
27947
|
+
"auto_topup",
|
|
27948
|
+
"adjustment"
|
|
27949
|
+
];
|
|
27950
|
+
var CreditEventTypeSchema = external_exports.enum(CREDIT_EVENT_TYPES);
|
|
27951
|
+
var UsdAmountSchema = external_exports.number().finite();
|
|
27952
|
+
var NonNegativeUsdSchema = external_exports.number().finite().nonnegative();
|
|
27953
|
+
var PositiveUsdSchema = external_exports.number().finite().positive();
|
|
27954
|
+
var CreditEventSchema = external_exports.object({
|
|
27955
|
+
organizationId: OrganizationIdSchema,
|
|
27956
|
+
type: CreditEventTypeSchema,
|
|
27957
|
+
amountUsd: UsdAmountSchema,
|
|
27958
|
+
description: external_exports.string().trim().min(1).nullable().default(null),
|
|
27959
|
+
// The acting user for manual purchases/adjustments; null for system-issued
|
|
27960
|
+
// rows (signup grants, auto-top-ups).
|
|
27961
|
+
createdByUserId: external_exports.string().trim().min(1).nullable().default(null)
|
|
27962
|
+
}).refine(
|
|
27963
|
+
(event) => event.type === "adjustment" || event.amountUsd > 0,
|
|
27964
|
+
"Only adjustment credit events may carry a non-positive amount"
|
|
27965
|
+
);
|
|
27966
|
+
var CreditEventRecordSchema = external_exports.object({
|
|
27967
|
+
id: external_exports.string().trim().min(1),
|
|
27968
|
+
organizationId: OrganizationIdSchema,
|
|
27969
|
+
type: CreditEventTypeSchema,
|
|
27970
|
+
amountUsd: UsdAmountSchema,
|
|
27971
|
+
description: external_exports.string().trim().min(1).nullable(),
|
|
27972
|
+
createdByUserId: external_exports.string().trim().min(1).nullable(),
|
|
27973
|
+
createdAt: external_exports.string().datetime()
|
|
27974
|
+
});
|
|
27975
|
+
var SPENDING_LIMIT_WINDOWS = ["hour", "day", "week", "month"];
|
|
27976
|
+
var SpendingLimitWindowSchema = external_exports.enum(SPENDING_LIMIT_WINDOWS);
|
|
27977
|
+
var BilledSpendWindowsSchema = external_exports.object({
|
|
27978
|
+
hourUsd: NonNegativeUsdSchema,
|
|
27979
|
+
dayUsd: NonNegativeUsdSchema,
|
|
27980
|
+
weekUsd: NonNegativeUsdSchema,
|
|
27981
|
+
monthUsd: NonNegativeUsdSchema
|
|
27982
|
+
});
|
|
27983
|
+
var OrganizationBillingSettingsSchema = external_exports.object({
|
|
27984
|
+
organizationId: OrganizationIdSchema,
|
|
27985
|
+
// Null means no limit for that window.
|
|
27986
|
+
spendLimitHourUsd: PositiveUsdSchema.nullable(),
|
|
27987
|
+
spendLimitDayUsd: PositiveUsdSchema.nullable(),
|
|
27988
|
+
spendLimitWeekUsd: PositiveUsdSchema.nullable(),
|
|
27989
|
+
spendLimitMonthUsd: PositiveUsdSchema.nullable(),
|
|
27990
|
+
autoTopUpEnabled: external_exports.boolean(),
|
|
27991
|
+
// Balance at or below the threshold triggers a top-up of the configured
|
|
27992
|
+
// amount. Both must be set for auto-top-up to arm.
|
|
27993
|
+
autoTopUpThresholdUsd: NonNegativeUsdSchema.nullable(),
|
|
27994
|
+
autoTopUpAmountUsd: PositiveUsdSchema.nullable()
|
|
27995
|
+
});
|
|
27996
|
+
var UpdateOrganizationBillingSettingsRequestSchema = external_exports.object({
|
|
27997
|
+
spendLimitHourUsd: PositiveUsdSchema.nullable().optional(),
|
|
27998
|
+
spendLimitDayUsd: PositiveUsdSchema.nullable().optional(),
|
|
27999
|
+
spendLimitWeekUsd: PositiveUsdSchema.nullable().optional(),
|
|
28000
|
+
spendLimitMonthUsd: PositiveUsdSchema.nullable().optional(),
|
|
28001
|
+
autoTopUpEnabled: external_exports.boolean().optional(),
|
|
28002
|
+
autoTopUpThresholdUsd: NonNegativeUsdSchema.nullable().optional(),
|
|
28003
|
+
autoTopUpAmountUsd: PositiveUsdSchema.nullable().optional()
|
|
28004
|
+
}).strict();
|
|
28005
|
+
var OrganizationCreditsResponseSchema = external_exports.object({
|
|
28006
|
+
organizationId: OrganizationIdSchema,
|
|
28007
|
+
balanceUsd: UsdAmountSchema,
|
|
28008
|
+
totalCreditsUsd: UsdAmountSchema,
|
|
28009
|
+
totalBilledUsageUsd: NonNegativeUsdSchema,
|
|
28010
|
+
events: external_exports.array(CreditEventRecordSchema)
|
|
28011
|
+
});
|
|
28012
|
+
var AddOrganizationCreditsRequestSchema = external_exports.object({
|
|
28013
|
+
amountUsd: PositiveUsdSchema.max(1e4),
|
|
28014
|
+
description: external_exports.string().trim().min(1).max(500).optional()
|
|
28015
|
+
}).strict();
|
|
28016
|
+
|
|
27910
28017
|
// ../../packages/schemas/src/pricing.ts
|
|
27911
28018
|
var RATE_CARD_2026_06_23 = {
|
|
27912
28019
|
version: "2026-06-23",
|
|
@@ -36683,7 +36790,7 @@ var ModelCredentialFundingSourceSchema = external_exports.enum([
|
|
|
36683
36790
|
"tenant_provider_grant"
|
|
36684
36791
|
]);
|
|
36685
36792
|
var NonNegativeTokenCountSchema = external_exports.number().int().nonnegative();
|
|
36686
|
-
var
|
|
36793
|
+
var NonNegativeUsdSchema2 = external_exports.number().nonnegative();
|
|
36687
36794
|
var UsageEventSchema = external_exports.object({
|
|
36688
36795
|
// Tenant + lineage attribution. projectId is nullable because a resource can
|
|
36689
36796
|
// belong directly to an organization with no project.
|
|
@@ -36702,11 +36809,16 @@ var UsageEventSchema = external_exports.object({
|
|
|
36702
36809
|
cacheReadTokens: NonNegativeTokenCountSchema,
|
|
36703
36810
|
// The provider's own cost when it reports one, kept only for reconciliation.
|
|
36704
36811
|
// Nullable/absent because it can be 0 or missing — never the billing source.
|
|
36705
|
-
providerCostUsd:
|
|
36812
|
+
providerCostUsd: NonNegativeUsdSchema2.nullable(),
|
|
36706
36813
|
// Platform-derived cost and the rate-card version it was derived under, so a
|
|
36707
36814
|
// later rate-card change never silently rewrites historical cost.
|
|
36708
|
-
derivedCostUsd:
|
|
36815
|
+
derivedCostUsd: NonNegativeUsdSchema2,
|
|
36709
36816
|
pricingVersion: external_exports.string().trim().min(1),
|
|
36817
|
+
// What this call debits from the organization's credit balance, and the fee
|
|
36818
|
+
// card it was derived under (see `./billing`). Required — a writer that
|
|
36819
|
+
// forgets it would silently record unbilled usage, so there is no default.
|
|
36820
|
+
billedCostUsd: NonNegativeUsdSchema2,
|
|
36821
|
+
billingFeeVersion: external_exports.string().trim().min(1),
|
|
36710
36822
|
// Historical funding attribution for the model call. The provider grant id is
|
|
36711
36823
|
// denormalized and nullable for platform-funded usage, matching the ledger's
|
|
36712
36824
|
// no-FK audit-trail contract.
|
|
@@ -36728,7 +36840,7 @@ var UsageTotalsSchema = external_exports.object({
|
|
|
36728
36840
|
cacheCreationTokens: NonNegativeTokenCountSchema,
|
|
36729
36841
|
cacheReadTokens: NonNegativeTokenCountSchema,
|
|
36730
36842
|
totalTokens: NonNegativeTokenCountSchema,
|
|
36731
|
-
|
|
36843
|
+
billedCostUsd: NonNegativeUsdSchema2
|
|
36732
36844
|
});
|
|
36733
36845
|
var SessionUsageModelSummarySchema = UsageTotalsSchema.extend({
|
|
36734
36846
|
model: external_exports.string().trim().min(1)
|
|
@@ -36762,11 +36874,11 @@ var ProjectUsageModelSummarySchema = UsageTotalsSchema.extend({
|
|
|
36762
36874
|
});
|
|
36763
36875
|
var ProjectUsageDayAgentSliceSchema = external_exports.object({
|
|
36764
36876
|
agentResourceId: external_exports.string().trim().min(1),
|
|
36765
|
-
|
|
36877
|
+
billedCostUsd: NonNegativeUsdSchema2
|
|
36766
36878
|
});
|
|
36767
36879
|
var ProjectUsageDayModelSliceSchema = external_exports.object({
|
|
36768
36880
|
model: external_exports.string().trim().min(1),
|
|
36769
|
-
|
|
36881
|
+
billedCostUsd: NonNegativeUsdSchema2
|
|
36770
36882
|
});
|
|
36771
36883
|
var ProjectUsageDayPointSchema = UsageTotalsSchema.extend({
|
|
36772
36884
|
date: UtcDateSchema,
|
package/dist/index.js
CHANGED
|
@@ -15424,6 +15424,8 @@ var init_auth = __esm({
|
|
|
15424
15424
|
"provider_grants:write",
|
|
15425
15425
|
"provider_grants:use",
|
|
15426
15426
|
"members:read",
|
|
15427
|
+
"billing:read",
|
|
15428
|
+
"billing:write",
|
|
15427
15429
|
"secrets:read",
|
|
15428
15430
|
"secrets:write",
|
|
15429
15431
|
"secrets:use",
|
|
@@ -17392,7 +17394,7 @@ var init_github_credentials = __esm({
|
|
|
17392
17394
|
});
|
|
17393
17395
|
|
|
17394
17396
|
// ../../packages/schemas/src/github-mcp-catalog.ts
|
|
17395
|
-
var GITHUB_MCP_TOOL_NAMES, GITHUB_MCP_PROXY_TOOL_NAMES, GITHUB_MCP_SELECTABLE_TOOL_NAMES, GITHUB_MCP_MERGE_TOOLS, GITHUB_MCP_WRITE_TOOLS, githubMcpToolNameSet, githubMcpWriteToolSet, githubMcpProxyToolSet, githubMcpMergeToolSet;
|
|
17397
|
+
var GITHUB_MCP_TOOL_NAMES, GITHUB_MCP_PROXY_TOOL_NAMES, GITHUB_MCP_SELECTABLE_TOOL_NAMES, GITHUB_MCP_MERGE_TOOLS, GITHUB_MCP_SECRETS_TOOLS, GITHUB_MCP_SECRETS_WRITE_TOOLS, GITHUB_MCP_WRITE_TOOLS, githubMcpToolNameSet, githubMcpWriteToolSet, githubMcpProxyToolSet, githubMcpMergeToolSet, githubMcpSecretsToolSet, githubMcpSecretsWriteToolSet;
|
|
17396
17398
|
var init_github_mcp_catalog = __esm({
|
|
17397
17399
|
"../../packages/schemas/src/github-mcp-catalog.ts"() {
|
|
17398
17400
|
"use strict";
|
|
@@ -17440,6 +17442,8 @@ var init_github_mcp_catalog = __esm({
|
|
|
17440
17442
|
"update_pull_request_branch"
|
|
17441
17443
|
];
|
|
17442
17444
|
GITHUB_MCP_PROXY_TOOL_NAMES = [
|
|
17445
|
+
"actions_secret_list",
|
|
17446
|
+
"actions_secret_write",
|
|
17443
17447
|
"enable_pull_request_auto_merge",
|
|
17444
17448
|
"upsert_issue_comment"
|
|
17445
17449
|
];
|
|
@@ -17451,6 +17455,13 @@ var init_github_mcp_catalog = __esm({
|
|
|
17451
17455
|
"merge_pull_request",
|
|
17452
17456
|
"enable_pull_request_auto_merge"
|
|
17453
17457
|
];
|
|
17458
|
+
GITHUB_MCP_SECRETS_TOOLS = [
|
|
17459
|
+
"actions_secret_list",
|
|
17460
|
+
"actions_secret_write"
|
|
17461
|
+
];
|
|
17462
|
+
GITHUB_MCP_SECRETS_WRITE_TOOLS = [
|
|
17463
|
+
"actions_secret_write"
|
|
17464
|
+
];
|
|
17454
17465
|
GITHUB_MCP_WRITE_TOOLS = [
|
|
17455
17466
|
"actions_run_trigger",
|
|
17456
17467
|
"add_comment_to_pending_review",
|
|
@@ -17475,7 +17486,9 @@ var init_github_mcp_catalog = __esm({
|
|
|
17475
17486
|
);
|
|
17476
17487
|
githubMcpWriteToolSet = /* @__PURE__ */ new Set([
|
|
17477
17488
|
...GITHUB_MCP_WRITE_TOOLS,
|
|
17478
|
-
...GITHUB_MCP_PROXY_TOOL_NAMES
|
|
17489
|
+
...GITHUB_MCP_PROXY_TOOL_NAMES.filter(
|
|
17490
|
+
(name) => name !== "actions_secret_list"
|
|
17491
|
+
)
|
|
17479
17492
|
]);
|
|
17480
17493
|
githubMcpProxyToolSet = new Set(
|
|
17481
17494
|
GITHUB_MCP_PROXY_TOOL_NAMES
|
|
@@ -17483,6 +17496,12 @@ var init_github_mcp_catalog = __esm({
|
|
|
17483
17496
|
githubMcpMergeToolSet = new Set(
|
|
17484
17497
|
GITHUB_MCP_MERGE_TOOLS
|
|
17485
17498
|
);
|
|
17499
|
+
githubMcpSecretsToolSet = new Set(
|
|
17500
|
+
GITHUB_MCP_SECRETS_TOOLS
|
|
17501
|
+
);
|
|
17502
|
+
githubMcpSecretsWriteToolSet = new Set(
|
|
17503
|
+
GITHUB_MCP_SECRETS_WRITE_TOOLS
|
|
17504
|
+
);
|
|
17486
17505
|
}
|
|
17487
17506
|
});
|
|
17488
17507
|
|
|
@@ -17514,6 +17533,7 @@ var init_mounts = __esm({
|
|
|
17514
17533
|
checks: "read",
|
|
17515
17534
|
actions: "read",
|
|
17516
17535
|
workflows: "none",
|
|
17536
|
+
secrets: "none",
|
|
17517
17537
|
merge: "none"
|
|
17518
17538
|
};
|
|
17519
17539
|
GitMountAuthSchema = external_exports.discriminatedUnion("kind", [
|
|
@@ -17536,6 +17556,10 @@ var init_mounts = __esm({
|
|
|
17536
17556
|
checks: GithubMountCapabilityLevelSchema.default("read"),
|
|
17537
17557
|
actions: GithubMountCapabilityLevelSchema.default("read"),
|
|
17538
17558
|
workflows: GithubMountCapabilityLevelSchema.default("none"),
|
|
17559
|
+
// Grants the GitHub Actions secrets API (repository and environment
|
|
17560
|
+
// secrets). Secret values are write-only on GitHub's side; read grants
|
|
17561
|
+
// listing secret names, never values.
|
|
17562
|
+
secrets: GithubMountCapabilityLevelSchema.default("none"),
|
|
17539
17563
|
merge: GithubMountMergeCapabilityLevelSchema.default("none")
|
|
17540
17564
|
}).superRefine((capabilities, context) => {
|
|
17541
17565
|
if (capabilities.merge === "write" && (capabilities.contents !== "write" || capabilities.pullRequests !== "write")) {
|
|
@@ -19532,6 +19556,97 @@ var init_organization_settings = __esm({
|
|
|
19532
19556
|
}
|
|
19533
19557
|
});
|
|
19534
19558
|
|
|
19559
|
+
// ../../packages/schemas/src/billing.ts
|
|
19560
|
+
var FEE_CARD_2026_07_06, BILLING_FEE_CARDS, CURRENT_BILLING_FEE_VERSION, CREDIT_EVENT_TYPES, CreditEventTypeSchema, UsdAmountSchema, NonNegativeUsdSchema, PositiveUsdSchema, CreditEventSchema, CreditEventRecordSchema, SPENDING_LIMIT_WINDOWS, SpendingLimitWindowSchema, BilledSpendWindowsSchema, OrganizationBillingSettingsSchema, UpdateOrganizationBillingSettingsRequestSchema, OrganizationCreditsResponseSchema, AddOrganizationCreditsRequestSchema;
|
|
19561
|
+
var init_billing = __esm({
|
|
19562
|
+
"../../packages/schemas/src/billing.ts"() {
|
|
19563
|
+
"use strict";
|
|
19564
|
+
init_zod();
|
|
19565
|
+
init_ids();
|
|
19566
|
+
FEE_CARD_2026_07_06 = {
|
|
19567
|
+
version: "2026-07-06",
|
|
19568
|
+
effectiveAt: "2026-07-06T00:00:00.000Z",
|
|
19569
|
+
feeRate: 0.05
|
|
19570
|
+
};
|
|
19571
|
+
BILLING_FEE_CARDS = {
|
|
19572
|
+
[FEE_CARD_2026_07_06.version]: FEE_CARD_2026_07_06
|
|
19573
|
+
};
|
|
19574
|
+
CURRENT_BILLING_FEE_VERSION = FEE_CARD_2026_07_06.version;
|
|
19575
|
+
CREDIT_EVENT_TYPES = [
|
|
19576
|
+
"signup_grant",
|
|
19577
|
+
"purchase",
|
|
19578
|
+
"auto_topup",
|
|
19579
|
+
"adjustment"
|
|
19580
|
+
];
|
|
19581
|
+
CreditEventTypeSchema = external_exports.enum(CREDIT_EVENT_TYPES);
|
|
19582
|
+
UsdAmountSchema = external_exports.number().finite();
|
|
19583
|
+
NonNegativeUsdSchema = external_exports.number().finite().nonnegative();
|
|
19584
|
+
PositiveUsdSchema = external_exports.number().finite().positive();
|
|
19585
|
+
CreditEventSchema = external_exports.object({
|
|
19586
|
+
organizationId: OrganizationIdSchema,
|
|
19587
|
+
type: CreditEventTypeSchema,
|
|
19588
|
+
amountUsd: UsdAmountSchema,
|
|
19589
|
+
description: external_exports.string().trim().min(1).nullable().default(null),
|
|
19590
|
+
// The acting user for manual purchases/adjustments; null for system-issued
|
|
19591
|
+
// rows (signup grants, auto-top-ups).
|
|
19592
|
+
createdByUserId: external_exports.string().trim().min(1).nullable().default(null)
|
|
19593
|
+
}).refine(
|
|
19594
|
+
(event) => event.type === "adjustment" || event.amountUsd > 0,
|
|
19595
|
+
"Only adjustment credit events may carry a non-positive amount"
|
|
19596
|
+
);
|
|
19597
|
+
CreditEventRecordSchema = external_exports.object({
|
|
19598
|
+
id: external_exports.string().trim().min(1),
|
|
19599
|
+
organizationId: OrganizationIdSchema,
|
|
19600
|
+
type: CreditEventTypeSchema,
|
|
19601
|
+
amountUsd: UsdAmountSchema,
|
|
19602
|
+
description: external_exports.string().trim().min(1).nullable(),
|
|
19603
|
+
createdByUserId: external_exports.string().trim().min(1).nullable(),
|
|
19604
|
+
createdAt: external_exports.string().datetime()
|
|
19605
|
+
});
|
|
19606
|
+
SPENDING_LIMIT_WINDOWS = ["hour", "day", "week", "month"];
|
|
19607
|
+
SpendingLimitWindowSchema = external_exports.enum(SPENDING_LIMIT_WINDOWS);
|
|
19608
|
+
BilledSpendWindowsSchema = external_exports.object({
|
|
19609
|
+
hourUsd: NonNegativeUsdSchema,
|
|
19610
|
+
dayUsd: NonNegativeUsdSchema,
|
|
19611
|
+
weekUsd: NonNegativeUsdSchema,
|
|
19612
|
+
monthUsd: NonNegativeUsdSchema
|
|
19613
|
+
});
|
|
19614
|
+
OrganizationBillingSettingsSchema = external_exports.object({
|
|
19615
|
+
organizationId: OrganizationIdSchema,
|
|
19616
|
+
// Null means no limit for that window.
|
|
19617
|
+
spendLimitHourUsd: PositiveUsdSchema.nullable(),
|
|
19618
|
+
spendLimitDayUsd: PositiveUsdSchema.nullable(),
|
|
19619
|
+
spendLimitWeekUsd: PositiveUsdSchema.nullable(),
|
|
19620
|
+
spendLimitMonthUsd: PositiveUsdSchema.nullable(),
|
|
19621
|
+
autoTopUpEnabled: external_exports.boolean(),
|
|
19622
|
+
// Balance at or below the threshold triggers a top-up of the configured
|
|
19623
|
+
// amount. Both must be set for auto-top-up to arm.
|
|
19624
|
+
autoTopUpThresholdUsd: NonNegativeUsdSchema.nullable(),
|
|
19625
|
+
autoTopUpAmountUsd: PositiveUsdSchema.nullable()
|
|
19626
|
+
});
|
|
19627
|
+
UpdateOrganizationBillingSettingsRequestSchema = external_exports.object({
|
|
19628
|
+
spendLimitHourUsd: PositiveUsdSchema.nullable().optional(),
|
|
19629
|
+
spendLimitDayUsd: PositiveUsdSchema.nullable().optional(),
|
|
19630
|
+
spendLimitWeekUsd: PositiveUsdSchema.nullable().optional(),
|
|
19631
|
+
spendLimitMonthUsd: PositiveUsdSchema.nullable().optional(),
|
|
19632
|
+
autoTopUpEnabled: external_exports.boolean().optional(),
|
|
19633
|
+
autoTopUpThresholdUsd: NonNegativeUsdSchema.nullable().optional(),
|
|
19634
|
+
autoTopUpAmountUsd: PositiveUsdSchema.nullable().optional()
|
|
19635
|
+
}).strict();
|
|
19636
|
+
OrganizationCreditsResponseSchema = external_exports.object({
|
|
19637
|
+
organizationId: OrganizationIdSchema,
|
|
19638
|
+
balanceUsd: UsdAmountSchema,
|
|
19639
|
+
totalCreditsUsd: UsdAmountSchema,
|
|
19640
|
+
totalBilledUsageUsd: NonNegativeUsdSchema,
|
|
19641
|
+
events: external_exports.array(CreditEventRecordSchema)
|
|
19642
|
+
});
|
|
19643
|
+
AddOrganizationCreditsRequestSchema = external_exports.object({
|
|
19644
|
+
amountUsd: PositiveUsdSchema.max(1e4),
|
|
19645
|
+
description: external_exports.string().trim().min(1).max(500).optional()
|
|
19646
|
+
}).strict();
|
|
19647
|
+
}
|
|
19648
|
+
});
|
|
19649
|
+
|
|
19535
19650
|
// ../../packages/schemas/src/pricing.ts
|
|
19536
19651
|
function tier(inputUsdPerMtok, outputUsdPerMtok) {
|
|
19537
19652
|
return {
|
|
@@ -28525,7 +28640,7 @@ var init_url_slugs = __esm({
|
|
|
28525
28640
|
});
|
|
28526
28641
|
|
|
28527
28642
|
// ../../packages/schemas/src/usage.ts
|
|
28528
|
-
var UsageHarnessSchema, ModelCredentialFundingSourceSchema, NonNegativeTokenCountSchema,
|
|
28643
|
+
var UsageHarnessSchema, ModelCredentialFundingSourceSchema, NonNegativeTokenCountSchema, NonNegativeUsdSchema2, UsageEventSchema, UsageEventRecordSchema, UsageTotalsSchema, SessionUsageModelSummarySchema, SessionUsageResponseSchema, PROJECT_USAGE_RANGE_KEYS, ProjectUsageRangeKeySchema, UtcDateSchema, ProjectUsageTotalsSchema, ProjectUsageAgentSummarySchema, ProjectUsageModelSummarySchema, ProjectUsageDayAgentSliceSchema, ProjectUsageDayModelSliceSchema, ProjectUsageDayPointSchema, ProjectUsageResponseSchema;
|
|
28529
28644
|
var init_usage = __esm({
|
|
28530
28645
|
"../../packages/schemas/src/usage.ts"() {
|
|
28531
28646
|
"use strict";
|
|
@@ -28538,7 +28653,7 @@ var init_usage = __esm({
|
|
|
28538
28653
|
"tenant_provider_grant"
|
|
28539
28654
|
]);
|
|
28540
28655
|
NonNegativeTokenCountSchema = external_exports.number().int().nonnegative();
|
|
28541
|
-
|
|
28656
|
+
NonNegativeUsdSchema2 = external_exports.number().nonnegative();
|
|
28542
28657
|
UsageEventSchema = external_exports.object({
|
|
28543
28658
|
// Tenant + lineage attribution. projectId is nullable because a resource can
|
|
28544
28659
|
// belong directly to an organization with no project.
|
|
@@ -28557,11 +28672,16 @@ var init_usage = __esm({
|
|
|
28557
28672
|
cacheReadTokens: NonNegativeTokenCountSchema,
|
|
28558
28673
|
// The provider's own cost when it reports one, kept only for reconciliation.
|
|
28559
28674
|
// Nullable/absent because it can be 0 or missing — never the billing source.
|
|
28560
|
-
providerCostUsd:
|
|
28675
|
+
providerCostUsd: NonNegativeUsdSchema2.nullable(),
|
|
28561
28676
|
// Platform-derived cost and the rate-card version it was derived under, so a
|
|
28562
28677
|
// later rate-card change never silently rewrites historical cost.
|
|
28563
|
-
derivedCostUsd:
|
|
28678
|
+
derivedCostUsd: NonNegativeUsdSchema2,
|
|
28564
28679
|
pricingVersion: external_exports.string().trim().min(1),
|
|
28680
|
+
// What this call debits from the organization's credit balance, and the fee
|
|
28681
|
+
// card it was derived under (see `./billing`). Required — a writer that
|
|
28682
|
+
// forgets it would silently record unbilled usage, so there is no default.
|
|
28683
|
+
billedCostUsd: NonNegativeUsdSchema2,
|
|
28684
|
+
billingFeeVersion: external_exports.string().trim().min(1),
|
|
28565
28685
|
// Historical funding attribution for the model call. The provider grant id is
|
|
28566
28686
|
// denormalized and nullable for platform-funded usage, matching the ledger's
|
|
28567
28687
|
// no-FK audit-trail contract.
|
|
@@ -28583,7 +28703,7 @@ var init_usage = __esm({
|
|
|
28583
28703
|
cacheCreationTokens: NonNegativeTokenCountSchema,
|
|
28584
28704
|
cacheReadTokens: NonNegativeTokenCountSchema,
|
|
28585
28705
|
totalTokens: NonNegativeTokenCountSchema,
|
|
28586
|
-
|
|
28706
|
+
billedCostUsd: NonNegativeUsdSchema2
|
|
28587
28707
|
});
|
|
28588
28708
|
SessionUsageModelSummarySchema = UsageTotalsSchema.extend({
|
|
28589
28709
|
model: external_exports.string().trim().min(1)
|
|
@@ -28617,11 +28737,11 @@ var init_usage = __esm({
|
|
|
28617
28737
|
});
|
|
28618
28738
|
ProjectUsageDayAgentSliceSchema = external_exports.object({
|
|
28619
28739
|
agentResourceId: external_exports.string().trim().min(1),
|
|
28620
|
-
|
|
28740
|
+
billedCostUsd: NonNegativeUsdSchema2
|
|
28621
28741
|
});
|
|
28622
28742
|
ProjectUsageDayModelSliceSchema = external_exports.object({
|
|
28623
28743
|
model: external_exports.string().trim().min(1),
|
|
28624
|
-
|
|
28744
|
+
billedCostUsd: NonNegativeUsdSchema2
|
|
28625
28745
|
});
|
|
28626
28746
|
ProjectUsageDayPointSchema = UsageTotalsSchema.extend({
|
|
28627
28747
|
date: UtcDateSchema,
|
|
@@ -28667,6 +28787,7 @@ var init_src = __esm({
|
|
|
28667
28787
|
init_model_selection();
|
|
28668
28788
|
init_mounts();
|
|
28669
28789
|
init_organization_settings();
|
|
28790
|
+
init_billing();
|
|
28670
28791
|
init_pricing();
|
|
28671
28792
|
init_provider_grants();
|
|
28672
28793
|
init_project_config();
|
|
@@ -31428,7 +31549,7 @@ var init_package = __esm({
|
|
|
31428
31549
|
"package.json"() {
|
|
31429
31550
|
package_default = {
|
|
31430
31551
|
name: "@autohq/cli",
|
|
31431
|
-
version: "0.1.
|
|
31552
|
+
version: "0.1.361",
|
|
31432
31553
|
license: "SEE LICENSE IN README.md",
|
|
31433
31554
|
publishConfig: {
|
|
31434
31555
|
access: "public"
|