glitch-javascript-sdk 3.2.0 → 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 +37 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/Agents.d.ts +22 -0
- package/dist/esm/index.js +37 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +22 -0
- package/package.json +1 -1
- package/src/api/Agents.ts +37 -0
- package/src/routes/AgentsRoute.ts +5 -0
package/dist/esm/api/Agents.d.ts
CHANGED
|
@@ -73,9 +73,31 @@ declare class Agents {
|
|
|
73
73
|
* Get results and outcome summary for title agents. Returns 402 until trial/subscription is active.
|
|
74
74
|
*/
|
|
75
75
|
static results<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
76
|
+
/**
|
|
77
|
+
* Get this title's agent usage against plan limits (agents used/included, monthly runs, and
|
|
78
|
+
* AI dollars spent vs the configured monthly AI budget). Powers usage meters and limit warnings.
|
|
79
|
+
*/
|
|
80
|
+
static usage<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
81
|
+
/**
|
|
82
|
+
* Get the prepaid agent credit balance and ledger (Pay-As-You-Go plan).
|
|
83
|
+
*/
|
|
84
|
+
static credits<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
85
|
+
/**
|
|
86
|
+
* Buy prepaid agent credits (Pay-As-You-Go). Charges the card up front; the agent draws down
|
|
87
|
+
* credits per run and stops when they run out. data: { paymentMethod, amount_usd }.
|
|
88
|
+
*/
|
|
89
|
+
static purchaseCredits<T>(title_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
76
90
|
/**
|
|
77
91
|
* Start a Stripe-backed agent trial/subscription after setup.
|
|
78
92
|
*/
|
|
79
93
|
static startTrial<T>(title_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
94
|
+
/**
|
|
95
|
+
* Cross-title agency cockpit: per-title agent status, billing/credits, and portfolio totals.
|
|
96
|
+
*/
|
|
97
|
+
static agencyOverview<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
98
|
+
/**
|
|
99
|
+
* Unified cross-title "needs you" inbox (open guidance + pending approvals across all titles).
|
|
100
|
+
*/
|
|
101
|
+
static agencyInbox<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
80
102
|
}
|
|
81
103
|
export default Agents;
|
package/dist/esm/index.js
CHANGED
|
@@ -18904,7 +18904,12 @@ var AgentsRoute = /** @class */ (function () {
|
|
|
18904
18904
|
answerGuidance: { url: "/agents/titles/{title_id}/guidance/{guidance_id}/answer", method: HTTP_METHODS.POST },
|
|
18905
18905
|
listMemories: { url: "/agents/titles/{title_id}/memories", method: HTTP_METHODS.GET },
|
|
18906
18906
|
results: { url: "/agents/titles/{title_id}/results", method: HTTP_METHODS.GET },
|
|
18907
|
+
usage: { url: "/agents/titles/{title_id}/usage", method: HTTP_METHODS.GET },
|
|
18908
|
+
credits: { url: "/agents/titles/{title_id}/credits", method: HTTP_METHODS.GET },
|
|
18909
|
+
purchaseCredits: { url: "/agents/titles/{title_id}/credits/purchase", method: HTTP_METHODS.POST },
|
|
18907
18910
|
startTrial: { url: "/agents/titles/{title_id}/subscription/trial", method: HTTP_METHODS.POST },
|
|
18911
|
+
agencyOverview: { url: "/agents/agency/overview", method: HTTP_METHODS.GET },
|
|
18912
|
+
agencyInbox: { url: "/agents/agency/inbox", method: HTTP_METHODS.GET },
|
|
18908
18913
|
};
|
|
18909
18914
|
return AgentsRoute;
|
|
18910
18915
|
}());
|
|
@@ -19020,12 +19025,44 @@ var Agents = /** @class */ (function () {
|
|
|
19020
19025
|
Agents.results = function (title_id, params) {
|
|
19021
19026
|
return Requests.processRoute(AgentsRoute.routes.results, {}, { title_id: title_id }, params);
|
|
19022
19027
|
};
|
|
19028
|
+
/**
|
|
19029
|
+
* Get this title's agent usage against plan limits (agents used/included, monthly runs, and
|
|
19030
|
+
* AI dollars spent vs the configured monthly AI budget). Powers usage meters and limit warnings.
|
|
19031
|
+
*/
|
|
19032
|
+
Agents.usage = function (title_id, params) {
|
|
19033
|
+
return Requests.processRoute(AgentsRoute.routes.usage, {}, { title_id: title_id }, params);
|
|
19034
|
+
};
|
|
19035
|
+
/**
|
|
19036
|
+
* Get the prepaid agent credit balance and ledger (Pay-As-You-Go plan).
|
|
19037
|
+
*/
|
|
19038
|
+
Agents.credits = function (title_id, params) {
|
|
19039
|
+
return Requests.processRoute(AgentsRoute.routes.credits, {}, { title_id: title_id }, params);
|
|
19040
|
+
};
|
|
19041
|
+
/**
|
|
19042
|
+
* Buy prepaid agent credits (Pay-As-You-Go). Charges the card up front; the agent draws down
|
|
19043
|
+
* credits per run and stops when they run out. data: { paymentMethod, amount_usd }.
|
|
19044
|
+
*/
|
|
19045
|
+
Agents.purchaseCredits = function (title_id, data, params) {
|
|
19046
|
+
return Requests.processRoute(AgentsRoute.routes.purchaseCredits, data, { title_id: title_id }, params);
|
|
19047
|
+
};
|
|
19023
19048
|
/**
|
|
19024
19049
|
* Start a Stripe-backed agent trial/subscription after setup.
|
|
19025
19050
|
*/
|
|
19026
19051
|
Agents.startTrial = function (title_id, data, params) {
|
|
19027
19052
|
return Requests.processRoute(AgentsRoute.routes.startTrial, data, { title_id: title_id }, params);
|
|
19028
19053
|
};
|
|
19054
|
+
/**
|
|
19055
|
+
* Cross-title agency cockpit: per-title agent status, billing/credits, and portfolio totals.
|
|
19056
|
+
*/
|
|
19057
|
+
Agents.agencyOverview = function (params) {
|
|
19058
|
+
return Requests.processRoute(AgentsRoute.routes.agencyOverview, {}, {}, params);
|
|
19059
|
+
};
|
|
19060
|
+
/**
|
|
19061
|
+
* Unified cross-title "needs you" inbox (open guidance + pending approvals across all titles).
|
|
19062
|
+
*/
|
|
19063
|
+
Agents.agencyInbox = function (params) {
|
|
19064
|
+
return Requests.processRoute(AgentsRoute.routes.agencyInbox, {}, {}, params);
|
|
19065
|
+
};
|
|
19029
19066
|
return Agents;
|
|
19030
19067
|
}());
|
|
19031
19068
|
|