glitch-javascript-sdk 3.2.1 → 3.2.2
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/cjs/index.js +29 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/Agents.d.ts +17 -0
- package/dist/esm/index.js +29 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +17 -0
- package/package.json +1 -1
- package/src/api/Agents.ts +29 -0
- package/src/routes/AgentsRoute.ts +4 -0
package/dist/index.d.ts
CHANGED
|
@@ -9176,10 +9176,27 @@ declare class Agents {
|
|
|
9176
9176
|
* AI dollars spent vs the configured monthly AI budget). Powers usage meters and limit warnings.
|
|
9177
9177
|
*/
|
|
9178
9178
|
static usage<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
9179
|
+
/**
|
|
9180
|
+
* Get the prepaid agent credit balance and ledger (Pay-As-You-Go plan).
|
|
9181
|
+
*/
|
|
9182
|
+
static credits<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
9183
|
+
/**
|
|
9184
|
+
* Buy prepaid agent credits (Pay-As-You-Go). Charges the card up front; the agent draws down
|
|
9185
|
+
* credits per run and stops when they run out. data: { paymentMethod, amount_usd }.
|
|
9186
|
+
*/
|
|
9187
|
+
static purchaseCredits<T>(title_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
9179
9188
|
/**
|
|
9180
9189
|
* Start a Stripe-backed agent trial/subscription after setup.
|
|
9181
9190
|
*/
|
|
9182
9191
|
static startTrial<T>(title_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
9192
|
+
/**
|
|
9193
|
+
* Cross-title agency cockpit: per-title agent status, billing/credits, and portfolio totals.
|
|
9194
|
+
*/
|
|
9195
|
+
static agencyOverview<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
9196
|
+
/**
|
|
9197
|
+
* Unified cross-title "needs you" inbox (open guidance + pending approvals across all titles).
|
|
9198
|
+
*/
|
|
9199
|
+
static agencyInbox<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
9183
9200
|
}
|
|
9184
9201
|
|
|
9185
9202
|
interface Route {
|
package/package.json
CHANGED
package/src/api/Agents.ts
CHANGED
|
@@ -138,12 +138,41 @@ class Agents {
|
|
|
138
138
|
return Requests.processRoute(AgentsRoute.routes.usage, {}, { title_id }, params);
|
|
139
139
|
}
|
|
140
140
|
|
|
141
|
+
/**
|
|
142
|
+
* Get the prepaid agent credit balance and ledger (Pay-As-You-Go plan).
|
|
143
|
+
*/
|
|
144
|
+
public static credits<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
145
|
+
return Requests.processRoute(AgentsRoute.routes.credits, {}, { title_id }, params);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* Buy prepaid agent credits (Pay-As-You-Go). Charges the card up front; the agent draws down
|
|
150
|
+
* credits per run and stops when they run out. data: { paymentMethod, amount_usd }.
|
|
151
|
+
*/
|
|
152
|
+
public static purchaseCredits<T>(title_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
153
|
+
return Requests.processRoute(AgentsRoute.routes.purchaseCredits, data, { title_id }, params);
|
|
154
|
+
}
|
|
155
|
+
|
|
141
156
|
/**
|
|
142
157
|
* Start a Stripe-backed agent trial/subscription after setup.
|
|
143
158
|
*/
|
|
144
159
|
public static startTrial<T>(title_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
145
160
|
return Requests.processRoute(AgentsRoute.routes.startTrial, data, { title_id }, params);
|
|
146
161
|
}
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* Cross-title agency cockpit: per-title agent status, billing/credits, and portfolio totals.
|
|
165
|
+
*/
|
|
166
|
+
public static agencyOverview<T>(params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
167
|
+
return Requests.processRoute(AgentsRoute.routes.agencyOverview, {}, {}, params);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* Unified cross-title "needs you" inbox (open guidance + pending approvals across all titles).
|
|
172
|
+
*/
|
|
173
|
+
public static agencyInbox<T>(params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
174
|
+
return Requests.processRoute(AgentsRoute.routes.agencyInbox, {}, {}, params);
|
|
175
|
+
}
|
|
147
176
|
}
|
|
148
177
|
|
|
149
178
|
export default Agents;
|
|
@@ -22,7 +22,11 @@ class AgentsRoute {
|
|
|
22
22
|
listMemories: { url: "/agents/titles/{title_id}/memories", method: HTTP_METHODS.GET },
|
|
23
23
|
results: { url: "/agents/titles/{title_id}/results", method: HTTP_METHODS.GET },
|
|
24
24
|
usage: { url: "/agents/titles/{title_id}/usage", method: HTTP_METHODS.GET },
|
|
25
|
+
credits: { url: "/agents/titles/{title_id}/credits", method: HTTP_METHODS.GET },
|
|
26
|
+
purchaseCredits: { url: "/agents/titles/{title_id}/credits/purchase", method: HTTP_METHODS.POST },
|
|
25
27
|
startTrial: { url: "/agents/titles/{title_id}/subscription/trial", method: HTTP_METHODS.POST },
|
|
28
|
+
agencyOverview: { url: "/agents/agency/overview", method: HTTP_METHODS.GET },
|
|
29
|
+
agencyInbox: { url: "/agents/agency/inbox", method: HTTP_METHODS.GET },
|
|
26
30
|
};
|
|
27
31
|
}
|
|
28
32
|
|