@stigmer/protos 0.3.3 → 0.4.0
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/ai/stigmer/agentic/agentexecution/v1/command_connect.js +2 -2
- package/ai/stigmer/agentic/agentexecution/v1/command_connect.js.map +1 -1
- package/ai/stigmer/agentic/agentexecution/v1/command_pb.d.ts +2 -2
- package/ai/stigmer/agentic/agentexecution/v1/command_pb.js +1 -1
- package/ai/stigmer/agentic/agentexecution/v1/command_pb.js.map +1 -1
- package/ai/stigmer/agentic/agentexecution/v1/enum_pb.d.ts +38 -0
- package/ai/stigmer/agentic/agentexecution/v1/enum_pb.js +41 -2
- package/ai/stigmer/agentic/agentexecution/v1/enum_pb.js.map +1 -1
- package/ai/stigmer/agentic/agentexecution/v1/io_pb.d.ts +167 -58
- package/ai/stigmer/agentic/agentexecution/v1/io_pb.js +44 -24
- package/ai/stigmer/agentic/agentexecution/v1/io_pb.js.map +1 -1
- package/ai/stigmer/agentic/agentexecution/v1/message_pb.d.ts +0 -10
- package/ai/stigmer/agentic/agentexecution/v1/message_pb.js +1 -2
- package/ai/stigmer/agentic/agentexecution/v1/message_pb.js.map +1 -1
- package/ai/stigmer/agentic/agentexecution/v1/query_connect.d.ts +14 -1
- package/ai/stigmer/agentic/agentexecution/v1/query_connect.js +15 -2
- package/ai/stigmer/agentic/agentexecution/v1/query_connect.js.map +1 -1
- package/ai/stigmer/agentic/agentexecution/v1/query_pb.d.ts +14 -2
- package/ai/stigmer/agentic/agentexecution/v1/query_pb.js +1 -1
- package/ai/stigmer/agentic/agentexecution/v1/query_pb.js.map +1 -1
- package/ai/stigmer/agentic/agentexecution/v1/usage_pb.d.ts +701 -262
- package/ai/stigmer/agentic/agentexecution/v1/usage_pb.js +271 -9
- package/ai/stigmer/agentic/agentexecution/v1/usage_pb.js.map +1 -1
- package/ai/stigmer/billing/v1/billing_account_pb.d.ts +245 -0
- package/ai/stigmer/billing/v1/billing_account_pb.js +31 -0
- package/ai/stigmer/billing/v1/billing_account_pb.js.map +1 -0
- package/ai/stigmer/billing/v1/command_connect.d.ts +135 -0
- package/ai/stigmer/billing/v1/command_connect.js +144 -0
- package/ai/stigmer/billing/v1/command_connect.js.map +1 -0
- package/ai/stigmer/billing/v1/command_pb.d.ts +132 -0
- package/ai/stigmer/billing/v1/command_pb.js +23 -0
- package/ai/stigmer/billing/v1/command_pb.js.map +1 -0
- package/ai/stigmer/billing/v1/credit_pb.d.ts +492 -0
- package/ai/stigmer/billing/v1/credit_pb.js +47 -0
- package/ai/stigmer/billing/v1/credit_pb.js.map +1 -0
- package/ai/stigmer/billing/v1/enum_pb.d.ts +318 -0
- package/ai/stigmer/billing/v1/enum_pb.js +329 -0
- package/ai/stigmer/billing/v1/enum_pb.js.map +1 -0
- package/ai/stigmer/billing/v1/io_pb.d.ts +801 -0
- package/ai/stigmer/billing/v1/io_pb.js +130 -0
- package/ai/stigmer/billing/v1/io_pb.js.map +1 -0
- package/ai/stigmer/billing/v1/policy_pb.d.ts +138 -0
- package/ai/stigmer/billing/v1/policy_pb.js +20 -0
- package/ai/stigmer/billing/v1/policy_pb.js.map +1 -0
- package/ai/stigmer/billing/v1/query_connect.d.ts +68 -0
- package/ai/stigmer/billing/v1/query_connect.js +76 -0
- package/ai/stigmer/billing/v1/query_connect.js.map +1 -0
- package/ai/stigmer/billing/v1/query_pb.d.ts +67 -0
- package/ai/stigmer/billing/v1/query_pb.js +20 -0
- package/ai/stigmer/billing/v1/query_pb.js.map +1 -0
- package/ai/stigmer/iam/identityaccount/v1/command_connect.d.ts +9 -9
- package/ai/stigmer/iam/identityaccount/v1/command_connect.js +12 -12
- package/ai/stigmer/iam/identityaccount/v1/command_connect.js.map +1 -1
- package/ai/stigmer/iam/identityaccount/v1/command_pb.d.ts +11 -11
- package/ai/stigmer/iam/identityaccount/v1/command_pb.js +1 -1
- package/ai/stigmer/iam/identityaccount/v1/command_pb.js.map +1 -1
- package/ai/stigmer/iam/v1/enum_pb.d.ts +18 -1
- package/ai/stigmer/iam/v1/enum_pb.js +18 -1
- package/ai/stigmer/iam/v1/enum_pb.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* BillingCommandController handles write operations for the billing bounded context.
|
|
3
|
+
*
|
|
4
|
+
* Billing is not a standard API Resource — there is no api_resource_kind annotation.
|
|
5
|
+
* RPCs authorize against the organization resource kind.
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* @generated from service ai.stigmer.billing.v1.BillingCommandController
|
|
9
|
+
*/
|
|
10
|
+
export declare const BillingCommandController: {
|
|
11
|
+
readonly typeName: "ai.stigmer.billing.v1.BillingCommandController";
|
|
12
|
+
readonly methods: {
|
|
13
|
+
/**
|
|
14
|
+
* Provision or retrieve the billing account for an organization.
|
|
15
|
+
* Idempotent: creates the account on first call, returns existing on subsequent calls.
|
|
16
|
+
*
|
|
17
|
+
* @internal
|
|
18
|
+
* Called during org creation or first billing interaction.
|
|
19
|
+
* Initializes balance to zero with default thresholds.
|
|
20
|
+
*
|
|
21
|
+
* @generated from rpc ai.stigmer.billing.v1.BillingCommandController.getOrCreateBillingAccount
|
|
22
|
+
*/
|
|
23
|
+
readonly getOrCreateBillingAccount: {
|
|
24
|
+
readonly name: "getOrCreateBillingAccount";
|
|
25
|
+
readonly I: any;
|
|
26
|
+
readonly O: any;
|
|
27
|
+
readonly kind: any;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Manually adjust an org's credit balance.
|
|
31
|
+
* Produces an immutable ledger entry for audit. Requires admin privileges.
|
|
32
|
+
*
|
|
33
|
+
* @generated from rpc ai.stigmer.billing.v1.BillingCommandController.adjustCredits
|
|
34
|
+
*/
|
|
35
|
+
readonly adjustCredits: {
|
|
36
|
+
readonly name: "adjustCredits";
|
|
37
|
+
readonly I: any;
|
|
38
|
+
readonly O: any;
|
|
39
|
+
readonly kind: any;
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* Reserve credits before starting an agent execution.
|
|
43
|
+
* Returns authorization status and reservation details.
|
|
44
|
+
*
|
|
45
|
+
* @internal
|
|
46
|
+
* Called by the Temporal workflow before dispatching to the agent runner.
|
|
47
|
+
* The runner must not start if authorized is false.
|
|
48
|
+
*
|
|
49
|
+
* @generated from rpc ai.stigmer.billing.v1.BillingCommandController.authorizeExecution
|
|
50
|
+
*/
|
|
51
|
+
readonly authorizeExecution: {
|
|
52
|
+
readonly name: "authorizeExecution";
|
|
53
|
+
readonly I: any;
|
|
54
|
+
readonly O: any;
|
|
55
|
+
readonly kind: any;
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* Record a single LLM call's usage for billing.
|
|
59
|
+
* Computes cost server-side from the model registry, inserts an immutable
|
|
60
|
+
* LlmCallUsageRecord, and debits credits from the execution's reservation.
|
|
61
|
+
*
|
|
62
|
+
* @internal
|
|
63
|
+
* Called by the proxy after each LLM SSE stream completes.
|
|
64
|
+
* Deduplicated by (execution_id, sequence, metering_source).
|
|
65
|
+
*
|
|
66
|
+
* @generated from rpc ai.stigmer.billing.v1.BillingCommandController.recordLlmCallUsage
|
|
67
|
+
*/
|
|
68
|
+
readonly recordLlmCallUsage: {
|
|
69
|
+
readonly name: "recordLlmCallUsage";
|
|
70
|
+
readonly I: any;
|
|
71
|
+
readonly O: any;
|
|
72
|
+
readonly kind: any;
|
|
73
|
+
};
|
|
74
|
+
/**
|
|
75
|
+
* Settle billing for a completed execution.
|
|
76
|
+
* Releases unused reservation credits and produces the final billing record.
|
|
77
|
+
*
|
|
78
|
+
* @internal
|
|
79
|
+
* Called by the Temporal workflow after the agent runner completes.
|
|
80
|
+
*
|
|
81
|
+
* @generated from rpc ai.stigmer.billing.v1.BillingCommandController.finalizeExecution
|
|
82
|
+
*/
|
|
83
|
+
readonly finalizeExecution: {
|
|
84
|
+
readonly name: "finalizeExecution";
|
|
85
|
+
readonly I: any;
|
|
86
|
+
readonly O: any;
|
|
87
|
+
readonly kind: any;
|
|
88
|
+
};
|
|
89
|
+
/**
|
|
90
|
+
* Create a Stripe Checkout Session to purchase a credit pack.
|
|
91
|
+
* Returns a checkout URL for the client to redirect the user.
|
|
92
|
+
*
|
|
93
|
+
* The caller's email is resolved server-side for Stripe Customer creation.
|
|
94
|
+
* Credits are provisioned asynchronously via the checkout.session.completed webhook.
|
|
95
|
+
*
|
|
96
|
+
* @generated from rpc ai.stigmer.billing.v1.BillingCommandController.createCreditCheckoutSession
|
|
97
|
+
*/
|
|
98
|
+
readonly createCreditCheckoutSession: {
|
|
99
|
+
readonly name: "createCreditCheckoutSession";
|
|
100
|
+
readonly I: any;
|
|
101
|
+
readonly O: any;
|
|
102
|
+
readonly kind: any;
|
|
103
|
+
};
|
|
104
|
+
/**
|
|
105
|
+
* Open a Stripe Customer Portal session for payment method management.
|
|
106
|
+
* Returns a portal URL for the client to redirect the user.
|
|
107
|
+
*
|
|
108
|
+
* Requires an existing Stripe Customer (created during first credit purchase).
|
|
109
|
+
* The portal allows users to add, update, or remove saved payment methods.
|
|
110
|
+
*
|
|
111
|
+
* @generated from rpc ai.stigmer.billing.v1.BillingCommandController.createBillingPortalSession
|
|
112
|
+
*/
|
|
113
|
+
readonly createBillingPortalSession: {
|
|
114
|
+
readonly name: "createBillingPortalSession";
|
|
115
|
+
readonly I: any;
|
|
116
|
+
readonly O: any;
|
|
117
|
+
readonly kind: any;
|
|
118
|
+
};
|
|
119
|
+
/**
|
|
120
|
+
* Configure automatic credit recharge for an organization.
|
|
121
|
+
* Returns the updated BillingAccount with the new config applied.
|
|
122
|
+
*
|
|
123
|
+
* Enabling requires an active account with a saved payment method.
|
|
124
|
+
* Disabling preserves the threshold/amount/cap for easy re-enablement.
|
|
125
|
+
*
|
|
126
|
+
* @generated from rpc ai.stigmer.billing.v1.BillingCommandController.setAutoRechargeConfig
|
|
127
|
+
*/
|
|
128
|
+
readonly setAutoRechargeConfig: {
|
|
129
|
+
readonly name: "setAutoRechargeConfig";
|
|
130
|
+
readonly I: any;
|
|
131
|
+
readonly O: any;
|
|
132
|
+
readonly kind: any;
|
|
133
|
+
};
|
|
134
|
+
};
|
|
135
|
+
};
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
// @generated by protoc-gen-connect-es v1.6.1 with parameter "target=ts,import_extension=js"
|
|
2
|
+
// @generated from file ai/stigmer/billing/v1/command.proto (package ai.stigmer.billing.v1, syntax proto3)
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
// @ts-nocheck
|
|
5
|
+
import { AdjustCreditsInput, AuthorizeExecutionInput, AuthorizeExecutionResponse, CreateBillingPortalSessionInput, CreateBillingPortalSessionResponse, CreateCreditCheckoutSessionInput, CreateCreditCheckoutSessionResponse, FinalizeExecutionInput, FinalizeExecutionResponse, GetOrCreateBillingAccountInput, RecordLlmCallUsageInput, RecordLlmCallUsageResponse, SetAutoRechargeConfigInput } from "./io_pbjs";
|
|
6
|
+
import { BillingAccount } from "./billing_account_pbjs";
|
|
7
|
+
import { MethodKind } from "@bufbuild/protobuf";
|
|
8
|
+
import { CreditLedgerEntry } from "./credit_pbjs";
|
|
9
|
+
/**
|
|
10
|
+
* BillingCommandController handles write operations for the billing bounded context.
|
|
11
|
+
*
|
|
12
|
+
* Billing is not a standard API Resource — there is no api_resource_kind annotation.
|
|
13
|
+
* RPCs authorize against the organization resource kind.
|
|
14
|
+
*
|
|
15
|
+
*
|
|
16
|
+
* @generated from service ai.stigmer.billing.v1.BillingCommandController
|
|
17
|
+
*/
|
|
18
|
+
export const BillingCommandController = {
|
|
19
|
+
typeName: "ai.stigmer.billing.v1.BillingCommandController",
|
|
20
|
+
methods: {
|
|
21
|
+
/**
|
|
22
|
+
* Provision or retrieve the billing account for an organization.
|
|
23
|
+
* Idempotent: creates the account on first call, returns existing on subsequent calls.
|
|
24
|
+
*
|
|
25
|
+
* @internal
|
|
26
|
+
* Called during org creation or first billing interaction.
|
|
27
|
+
* Initializes balance to zero with default thresholds.
|
|
28
|
+
*
|
|
29
|
+
* @generated from rpc ai.stigmer.billing.v1.BillingCommandController.getOrCreateBillingAccount
|
|
30
|
+
*/
|
|
31
|
+
getOrCreateBillingAccount: {
|
|
32
|
+
name: "getOrCreateBillingAccount",
|
|
33
|
+
I: GetOrCreateBillingAccountInput,
|
|
34
|
+
O: BillingAccount,
|
|
35
|
+
kind: MethodKind.Unary,
|
|
36
|
+
},
|
|
37
|
+
/**
|
|
38
|
+
* Manually adjust an org's credit balance.
|
|
39
|
+
* Produces an immutable ledger entry for audit. Requires admin privileges.
|
|
40
|
+
*
|
|
41
|
+
* @generated from rpc ai.stigmer.billing.v1.BillingCommandController.adjustCredits
|
|
42
|
+
*/
|
|
43
|
+
adjustCredits: {
|
|
44
|
+
name: "adjustCredits",
|
|
45
|
+
I: AdjustCreditsInput,
|
|
46
|
+
O: CreditLedgerEntry,
|
|
47
|
+
kind: MethodKind.Unary,
|
|
48
|
+
},
|
|
49
|
+
/**
|
|
50
|
+
* Reserve credits before starting an agent execution.
|
|
51
|
+
* Returns authorization status and reservation details.
|
|
52
|
+
*
|
|
53
|
+
* @internal
|
|
54
|
+
* Called by the Temporal workflow before dispatching to the agent runner.
|
|
55
|
+
* The runner must not start if authorized is false.
|
|
56
|
+
*
|
|
57
|
+
* @generated from rpc ai.stigmer.billing.v1.BillingCommandController.authorizeExecution
|
|
58
|
+
*/
|
|
59
|
+
authorizeExecution: {
|
|
60
|
+
name: "authorizeExecution",
|
|
61
|
+
I: AuthorizeExecutionInput,
|
|
62
|
+
O: AuthorizeExecutionResponse,
|
|
63
|
+
kind: MethodKind.Unary,
|
|
64
|
+
},
|
|
65
|
+
/**
|
|
66
|
+
* Record a single LLM call's usage for billing.
|
|
67
|
+
* Computes cost server-side from the model registry, inserts an immutable
|
|
68
|
+
* LlmCallUsageRecord, and debits credits from the execution's reservation.
|
|
69
|
+
*
|
|
70
|
+
* @internal
|
|
71
|
+
* Called by the proxy after each LLM SSE stream completes.
|
|
72
|
+
* Deduplicated by (execution_id, sequence, metering_source).
|
|
73
|
+
*
|
|
74
|
+
* @generated from rpc ai.stigmer.billing.v1.BillingCommandController.recordLlmCallUsage
|
|
75
|
+
*/
|
|
76
|
+
recordLlmCallUsage: {
|
|
77
|
+
name: "recordLlmCallUsage",
|
|
78
|
+
I: RecordLlmCallUsageInput,
|
|
79
|
+
O: RecordLlmCallUsageResponse,
|
|
80
|
+
kind: MethodKind.Unary,
|
|
81
|
+
},
|
|
82
|
+
/**
|
|
83
|
+
* Settle billing for a completed execution.
|
|
84
|
+
* Releases unused reservation credits and produces the final billing record.
|
|
85
|
+
*
|
|
86
|
+
* @internal
|
|
87
|
+
* Called by the Temporal workflow after the agent runner completes.
|
|
88
|
+
*
|
|
89
|
+
* @generated from rpc ai.stigmer.billing.v1.BillingCommandController.finalizeExecution
|
|
90
|
+
*/
|
|
91
|
+
finalizeExecution: {
|
|
92
|
+
name: "finalizeExecution",
|
|
93
|
+
I: FinalizeExecutionInput,
|
|
94
|
+
O: FinalizeExecutionResponse,
|
|
95
|
+
kind: MethodKind.Unary,
|
|
96
|
+
},
|
|
97
|
+
/**
|
|
98
|
+
* Create a Stripe Checkout Session to purchase a credit pack.
|
|
99
|
+
* Returns a checkout URL for the client to redirect the user.
|
|
100
|
+
*
|
|
101
|
+
* The caller's email is resolved server-side for Stripe Customer creation.
|
|
102
|
+
* Credits are provisioned asynchronously via the checkout.session.completed webhook.
|
|
103
|
+
*
|
|
104
|
+
* @generated from rpc ai.stigmer.billing.v1.BillingCommandController.createCreditCheckoutSession
|
|
105
|
+
*/
|
|
106
|
+
createCreditCheckoutSession: {
|
|
107
|
+
name: "createCreditCheckoutSession",
|
|
108
|
+
I: CreateCreditCheckoutSessionInput,
|
|
109
|
+
O: CreateCreditCheckoutSessionResponse,
|
|
110
|
+
kind: MethodKind.Unary,
|
|
111
|
+
},
|
|
112
|
+
/**
|
|
113
|
+
* Open a Stripe Customer Portal session for payment method management.
|
|
114
|
+
* Returns a portal URL for the client to redirect the user.
|
|
115
|
+
*
|
|
116
|
+
* Requires an existing Stripe Customer (created during first credit purchase).
|
|
117
|
+
* The portal allows users to add, update, or remove saved payment methods.
|
|
118
|
+
*
|
|
119
|
+
* @generated from rpc ai.stigmer.billing.v1.BillingCommandController.createBillingPortalSession
|
|
120
|
+
*/
|
|
121
|
+
createBillingPortalSession: {
|
|
122
|
+
name: "createBillingPortalSession",
|
|
123
|
+
I: CreateBillingPortalSessionInput,
|
|
124
|
+
O: CreateBillingPortalSessionResponse,
|
|
125
|
+
kind: MethodKind.Unary,
|
|
126
|
+
},
|
|
127
|
+
/**
|
|
128
|
+
* Configure automatic credit recharge for an organization.
|
|
129
|
+
* Returns the updated BillingAccount with the new config applied.
|
|
130
|
+
*
|
|
131
|
+
* Enabling requires an active account with a saved payment method.
|
|
132
|
+
* Disabling preserves the threshold/amount/cap for easy re-enablement.
|
|
133
|
+
*
|
|
134
|
+
* @generated from rpc ai.stigmer.billing.v1.BillingCommandController.setAutoRechargeConfig
|
|
135
|
+
*/
|
|
136
|
+
setAutoRechargeConfig: {
|
|
137
|
+
name: "setAutoRechargeConfig",
|
|
138
|
+
I: SetAutoRechargeConfigInput,
|
|
139
|
+
O: BillingAccount,
|
|
140
|
+
kind: MethodKind.Unary,
|
|
141
|
+
},
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
//# sourceMappingURL=command_connect.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command_connect.js","sourceRoot":"","sources":["../../../../../ai/stigmer/billing/v1/command_connect.ts"],"names":[],"mappings":"AAAA,4FAA4F;AAC5F,0GAA0G;AAC1G,oBAAoB;AACpB,cAAc;AAEd,OAAO,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,0BAA0B,EAAE,+BAA+B,EAAE,kCAAkC,EAAE,gCAAgC,EAAE,mCAAmC,EAAE,sBAAsB,EAAE,yBAAyB,EAAE,8BAA8B,EAAE,uBAAuB,EAAE,0BAA0B,EAAE,0BAA0B,EAAE,MAAM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ACD;;;;;;;;WAQG;QACH,0BAA0B,EAAE;YAC1B,IAAI,EAAE,4BAA4B;YAClC,CAAC,EAAE,+BAA+B;YAClC,CAAC,EAAE,kCAAkC;YACrC,IAAI,EAAE,UAAU,CAAC,KAAK;SACvB;QACD;;;;;;;;WAQG;QACH,qBAAqB,EAAE;YACrB,IAAI,EAAE,uBAAuB;YAC7B,CAAC,EAAE,0BAA0B;YAC7B,CAAC,EAAE,cAAc;YACjB,IAAI,EAAE,UAAU,CAAC,KAAK;SACvB;KACF;CACO,CAAC"}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import type { GenFile, GenService } from "@bufbuild/protobuf/codegenv1";
|
|
2
|
+
import type { BillingAccountSchema } from "./billing_account_pb.js";
|
|
3
|
+
import type { CreditLedgerEntrySchema } from "./credit_pb.js";
|
|
4
|
+
import type { AdjustCreditsInputSchema, AuthorizeExecutionInputSchema, AuthorizeExecutionResponseSchema, CreateBillingPortalSessionInputSchema, CreateBillingPortalSessionResponseSchema, CreateCreditCheckoutSessionInputSchema, CreateCreditCheckoutSessionResponseSchema, FinalizeExecutionInputSchema, FinalizeExecutionResponseSchema, GetOrCreateBillingAccountInputSchema, RecordLlmCallUsageInputSchema, RecordLlmCallUsageResponseSchema, SetAutoRechargeConfigInputSchema } from "./io_pb.js";
|
|
5
|
+
/**
|
|
6
|
+
* Describes the file ai/stigmer/billing/v1/command.proto.
|
|
7
|
+
*/
|
|
8
|
+
export declare const file_ai_stigmer_billing_v1_command: GenFile;
|
|
9
|
+
/**
|
|
10
|
+
* BillingCommandController handles write operations for the billing bounded context.
|
|
11
|
+
*
|
|
12
|
+
* Billing is not a standard API Resource — there is no api_resource_kind annotation.
|
|
13
|
+
* RPCs authorize against the organization resource kind.
|
|
14
|
+
*
|
|
15
|
+
*
|
|
16
|
+
* @generated from service ai.stigmer.billing.v1.BillingCommandController
|
|
17
|
+
*/
|
|
18
|
+
export declare const BillingCommandController: GenService<{
|
|
19
|
+
/**
|
|
20
|
+
* Provision or retrieve the billing account for an organization.
|
|
21
|
+
* Idempotent: creates the account on first call, returns existing on subsequent calls.
|
|
22
|
+
*
|
|
23
|
+
* @internal
|
|
24
|
+
* Called during org creation or first billing interaction.
|
|
25
|
+
* Initializes balance to zero with default thresholds.
|
|
26
|
+
*
|
|
27
|
+
* @generated from rpc ai.stigmer.billing.v1.BillingCommandController.getOrCreateBillingAccount
|
|
28
|
+
*/
|
|
29
|
+
getOrCreateBillingAccount: {
|
|
30
|
+
methodKind: "unary";
|
|
31
|
+
input: typeof GetOrCreateBillingAccountInputSchema;
|
|
32
|
+
output: typeof BillingAccountSchema;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Manually adjust an org's credit balance.
|
|
36
|
+
* Produces an immutable ledger entry for audit. Requires admin privileges.
|
|
37
|
+
*
|
|
38
|
+
* @generated from rpc ai.stigmer.billing.v1.BillingCommandController.adjustCredits
|
|
39
|
+
*/
|
|
40
|
+
adjustCredits: {
|
|
41
|
+
methodKind: "unary";
|
|
42
|
+
input: typeof AdjustCreditsInputSchema;
|
|
43
|
+
output: typeof CreditLedgerEntrySchema;
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* Reserve credits before starting an agent execution.
|
|
47
|
+
* Returns authorization status and reservation details.
|
|
48
|
+
*
|
|
49
|
+
* @internal
|
|
50
|
+
* Called by the Temporal workflow before dispatching to the agent runner.
|
|
51
|
+
* The runner must not start if authorized is false.
|
|
52
|
+
*
|
|
53
|
+
* @generated from rpc ai.stigmer.billing.v1.BillingCommandController.authorizeExecution
|
|
54
|
+
*/
|
|
55
|
+
authorizeExecution: {
|
|
56
|
+
methodKind: "unary";
|
|
57
|
+
input: typeof AuthorizeExecutionInputSchema;
|
|
58
|
+
output: typeof AuthorizeExecutionResponseSchema;
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* Record a single LLM call's usage for billing.
|
|
62
|
+
* Computes cost server-side from the model registry, inserts an immutable
|
|
63
|
+
* LlmCallUsageRecord, and debits credits from the execution's reservation.
|
|
64
|
+
*
|
|
65
|
+
* @internal
|
|
66
|
+
* Called by the proxy after each LLM SSE stream completes.
|
|
67
|
+
* Deduplicated by (execution_id, sequence, metering_source).
|
|
68
|
+
*
|
|
69
|
+
* @generated from rpc ai.stigmer.billing.v1.BillingCommandController.recordLlmCallUsage
|
|
70
|
+
*/
|
|
71
|
+
recordLlmCallUsage: {
|
|
72
|
+
methodKind: "unary";
|
|
73
|
+
input: typeof RecordLlmCallUsageInputSchema;
|
|
74
|
+
output: typeof RecordLlmCallUsageResponseSchema;
|
|
75
|
+
};
|
|
76
|
+
/**
|
|
77
|
+
* Settle billing for a completed execution.
|
|
78
|
+
* Releases unused reservation credits and produces the final billing record.
|
|
79
|
+
*
|
|
80
|
+
* @internal
|
|
81
|
+
* Called by the Temporal workflow after the agent runner completes.
|
|
82
|
+
*
|
|
83
|
+
* @generated from rpc ai.stigmer.billing.v1.BillingCommandController.finalizeExecution
|
|
84
|
+
*/
|
|
85
|
+
finalizeExecution: {
|
|
86
|
+
methodKind: "unary";
|
|
87
|
+
input: typeof FinalizeExecutionInputSchema;
|
|
88
|
+
output: typeof FinalizeExecutionResponseSchema;
|
|
89
|
+
};
|
|
90
|
+
/**
|
|
91
|
+
* Create a Stripe Checkout Session to purchase a credit pack.
|
|
92
|
+
* Returns a checkout URL for the client to redirect the user.
|
|
93
|
+
*
|
|
94
|
+
* The caller's email is resolved server-side for Stripe Customer creation.
|
|
95
|
+
* Credits are provisioned asynchronously via the checkout.session.completed webhook.
|
|
96
|
+
*
|
|
97
|
+
* @generated from rpc ai.stigmer.billing.v1.BillingCommandController.createCreditCheckoutSession
|
|
98
|
+
*/
|
|
99
|
+
createCreditCheckoutSession: {
|
|
100
|
+
methodKind: "unary";
|
|
101
|
+
input: typeof CreateCreditCheckoutSessionInputSchema;
|
|
102
|
+
output: typeof CreateCreditCheckoutSessionResponseSchema;
|
|
103
|
+
};
|
|
104
|
+
/**
|
|
105
|
+
* Open a Stripe Customer Portal session for payment method management.
|
|
106
|
+
* Returns a portal URL for the client to redirect the user.
|
|
107
|
+
*
|
|
108
|
+
* Requires an existing Stripe Customer (created during first credit purchase).
|
|
109
|
+
* The portal allows users to add, update, or remove saved payment methods.
|
|
110
|
+
*
|
|
111
|
+
* @generated from rpc ai.stigmer.billing.v1.BillingCommandController.createBillingPortalSession
|
|
112
|
+
*/
|
|
113
|
+
createBillingPortalSession: {
|
|
114
|
+
methodKind: "unary";
|
|
115
|
+
input: typeof CreateBillingPortalSessionInputSchema;
|
|
116
|
+
output: typeof CreateBillingPortalSessionResponseSchema;
|
|
117
|
+
};
|
|
118
|
+
/**
|
|
119
|
+
* Configure automatic credit recharge for an organization.
|
|
120
|
+
* Returns the updated BillingAccount with the new config applied.
|
|
121
|
+
*
|
|
122
|
+
* Enabling requires an active account with a saved payment method.
|
|
123
|
+
* Disabling preserves the threshold/amount/cap for easy re-enablement.
|
|
124
|
+
*
|
|
125
|
+
* @generated from rpc ai.stigmer.billing.v1.BillingCommandController.setAutoRechargeConfig
|
|
126
|
+
*/
|
|
127
|
+
setAutoRechargeConfig: {
|
|
128
|
+
methodKind: "unary";
|
|
129
|
+
input: typeof SetAutoRechargeConfigInputSchema;
|
|
130
|
+
output: typeof BillingAccountSchema;
|
|
131
|
+
};
|
|
132
|
+
}>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// @generated by protoc-gen-es v2.2.2 with parameter "target=ts,import_extension=js"
|
|
2
|
+
// @generated from file ai/stigmer/billing/v1/command.proto (package ai.stigmer.billing.v1, syntax proto3)
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
import { fileDesc, serviceDesc } from "@bufbuild/protobuf/codegenv1";
|
|
5
|
+
import { file_ai_stigmer_billing_v1_billing_account } from "./billing_account_pb.js";
|
|
6
|
+
import { file_ai_stigmer_billing_v1_credit } from "./credit_pb.js";
|
|
7
|
+
import { file_ai_stigmer_billing_v1_io } from "./io_pb.js";
|
|
8
|
+
import { file_ai_stigmer_commons_rpc_method_options } from "../../commons/rpc/method_options_pb.js";
|
|
9
|
+
/**
|
|
10
|
+
* Describes the file ai/stigmer/billing/v1/command.proto.
|
|
11
|
+
*/
|
|
12
|
+
export const file_ai_stigmer_billing_v1_command = /*@__PURE__*/ fileDesc("CiNhaS9zdGlnbWVyL2JpbGxpbmcvdjEvY29tbWFuZC5wcm90bxIVYWkuc3RpZ21lci5iaWxsaW5nLnYxMtQMChhCaWxsaW5nQ29tbWFuZENvbnRyb2xsZXISwQEKGWdldE9yQ3JlYXRlQmlsbGluZ0FjY291bnQSNS5haS5zdGlnbWVyLmJpbGxpbmcudjEuR2V0T3JDcmVhdGVCaWxsaW5nQWNjb3VudElucHV0GiUuYWkuc3RpZ21lci5iaWxsaW5nLnYxLkJpbGxpbmdBY2NvdW50IkbCuBhCCBwQHiIGb3JnX2lkKjR1bmF1dGhvcml6ZWQgdG8gbWFuYWdlIGJpbGxpbmcgZm9yIHRoaXMgb3JnYW5pemF0aW9uEqwBCg1hZGp1c3RDcmVkaXRzEikuYWkuc3RpZ21lci5iaWxsaW5nLnYxLkFkanVzdENyZWRpdHNJbnB1dBooLmFpLnN0aWdtZXIuYmlsbGluZy52MS5DcmVkaXRMZWRnZXJFbnRyeSJGwrgYQggcEB4iBm9yZ19pZCo0dW5hdXRob3JpemVkIHRvIGFkanVzdCBjcmVkaXRzIGZvciB0aGlzIG9yZ2FuaXphdGlvbhLCAQoSYXV0aG9yaXplRXhlY3V0aW9uEi4uYWkuc3RpZ21lci5iaWxsaW5nLnYxLkF1dGhvcml6ZUV4ZWN1dGlvbklucHV0GjEuYWkuc3RpZ21lci5iaWxsaW5nLnYxLkF1dGhvcml6ZUV4ZWN1dGlvblJlc3BvbnNlIknCuBhFCB0QHyo2b25seSBwbGF0Zm9ybSBvcGVyYXRvcnMgY2FuIGV4ZWN1dGUgYmlsbGluZyBvcGVyYXRpb25zMgdzdGlnbWVyEsIBChJyZWNvcmRMbG1DYWxsVXNhZ2USL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ZvciB0aGlzIG9yZ2FuaXphdGlvbhK/AQoVc2V0QXV0b1JlY2hhcmdlQ29uZmlnEjEuYWkuc3RpZ21lci5iaWxsaW5nLnYxLlNldEF1dG9SZWNoYXJnZUNvbmZpZ0lucHV0GiUuYWkuc3RpZ21lci5iaWxsaW5nLnYxLkJpbGxpbmdBY2NvdW50IkzCuBhICBwQHiIGb3JnX2lkKjp1bmF1dGhvcml6ZWQgdG8gbWFuYWdlIGF1dG8tcmVjaGFyZ2UgZm9yIHRoaXMgb3JnYW5pemF0aW9uYgZwcm90bzM", [file_ai_stigmer_billing_v1_billing_account, file_ai_stigmer_billing_v1_credit, file_ai_stigmer_billing_v1_io, file_ai_stigmer_commons_rpc_method_options]);
|
|
13
|
+
/**
|
|
14
|
+
* BillingCommandController handles write operations for the billing bounded context.
|
|
15
|
+
*
|
|
16
|
+
* Billing is not a standard API Resource — there is no api_resource_kind annotation.
|
|
17
|
+
* RPCs authorize against the organization resource kind.
|
|
18
|
+
*
|
|
19
|
+
*
|
|
20
|
+
* @generated from service ai.stigmer.billing.v1.BillingCommandController
|
|
21
|
+
*/
|
|
22
|
+
export const BillingCommandController = /*@__PURE__*/ serviceDesc(file_ai_stigmer_billing_v1_command, 0);
|
|
23
|
+
//# sourceMappingURL=command_pb.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command_pb.js","sourceRoot":"","sources":["../../../../../ai/stigmer/billing/v1/command_pb.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,0GAA0G;AAC1G,oBAAoB;AAGpB,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAErE,OAAO,EAAE,0CAA0C,EAAE,MAAM,yBAAyB,CAAC;AAErF,OAAO,EAAE,iCAAiC,EAAE,MAAM,gBAAgB,CAAC;AAEnE,OAAO,EAAE,6BAA6B,EAAE,MAAM,YAAY,CAAC;AAC3D,OAAO,EAAE,0CAA0C,EAAE,MAAM,wCAAwC,CAAC;AAEpG;;GAEG;AACH,MAAM,CAAC,MAAM,kCAAkC,GAAY,aAAa,CACtE,QAAQ,CAAC,itEAAitE,EAAE,CAAC,0CAA0C,EAAE,iCAAiC,EAAE,6BAA6B,EAAE,0CAA0C,CAAC,CAAC,CAAC;AAE13E;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAkHhC,aAAa,CAChB,WAAW,CAAC,kCAAkC,EAAE,CAAC,CAAC,CAAC"}
|