glitch-javascript-sdk 3.2.1 → 3.2.3

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 CHANGED
@@ -30893,7 +30893,12 @@ var AgentsRoute = /** @class */ (function () {
30893
30893
  updateAgent: { url: "/agents/titles/{title_id}/agents/{agent_id}", method: HTTP_METHODS.PUT },
30894
30894
  deleteAgent: { url: "/agents/titles/{title_id}/agents/{agent_id}", method: HTTP_METHODS.DELETE },
30895
30895
  runAgent: { url: "/agents/titles/{title_id}/agents/{agent_id}/run", method: HTTP_METHODS.POST },
30896
+ uploadAgentFiles: { url: "/agents/titles/{title_id}/agents/{agent_id}/files", method: HTTP_METHODS.POST },
30896
30897
  listRuns: { url: "/agents/titles/{title_id}/runs", method: HTTP_METHODS.GET },
30898
+ viewRun: { url: "/agents/titles/{title_id}/runs/{run_id}", method: HTTP_METHODS.GET },
30899
+ listRunEvents: { url: "/agents/titles/{title_id}/runs/{run_id}/events", method: HTTP_METHODS.GET },
30900
+ cancelRun: { url: "/agents/titles/{title_id}/runs/{run_id}/cancel", method: HTTP_METHODS.POST },
30901
+ interjectRun: { url: "/agents/titles/{title_id}/runs/{run_id}/interject", method: HTTP_METHODS.POST },
30897
30902
  listActions: { url: "/agents/titles/{title_id}/actions", method: HTTP_METHODS.GET },
30898
30903
  approveAction: { url: "/agents/titles/{title_id}/actions/{action_id}/approve", method: HTTP_METHODS.POST },
30899
30904
  rejectAction: { url: "/agents/titles/{title_id}/actions/{action_id}/reject", method: HTTP_METHODS.POST },
@@ -30903,7 +30908,11 @@ var AgentsRoute = /** @class */ (function () {
30903
30908
  listMemories: { url: "/agents/titles/{title_id}/memories", method: HTTP_METHODS.GET },
30904
30909
  results: { url: "/agents/titles/{title_id}/results", method: HTTP_METHODS.GET },
30905
30910
  usage: { url: "/agents/titles/{title_id}/usage", method: HTTP_METHODS.GET },
30911
+ credits: { url: "/agents/titles/{title_id}/credits", method: HTTP_METHODS.GET },
30912
+ purchaseCredits: { url: "/agents/titles/{title_id}/credits/purchase", method: HTTP_METHODS.POST },
30906
30913
  startTrial: { url: "/agents/titles/{title_id}/subscription/trial", method: HTTP_METHODS.POST },
30914
+ agencyOverview: { url: "/agents/agency/overview", method: HTTP_METHODS.GET },
30915
+ agencyInbox: { url: "/agents/agency/inbox", method: HTTP_METHODS.GET },
30907
30916
  };
30908
30917
  return AgentsRoute;
30909
30918
  }());
@@ -30965,12 +30974,51 @@ var Agents = /** @class */ (function () {
30965
30974
  Agents.runAgent = function (title_id, agent_id, data, params) {
30966
30975
  return Requests.processRoute(AgentsRoute.routes.runAgent, data, { title_id: title_id, agent_id: agent_id }, params);
30967
30976
  };
30977
+ /**
30978
+ * Upload one file for an agent run. data can include { agent_run_id }.
30979
+ */
30980
+ Agents.uploadAgentFile = function (title_id, agent_id, file, data, params, onUploadProgress) {
30981
+ var url = AgentsRoute.routes.uploadAgentFiles.url
30982
+ .replace("{title_id}", title_id)
30983
+ .replace("{agent_id}", agent_id);
30984
+ return Requests.uploadFile(url, "file", file, data, params, onUploadProgress);
30985
+ };
30986
+ /**
30987
+ * Alias for callers that use plural naming while uploading one file at a time.
30988
+ */
30989
+ Agents.uploadAgentFiles = function (title_id, agent_id, file, data, params, onUploadProgress) {
30990
+ return Agents.uploadAgentFile(title_id, agent_id, file, data, params, onUploadProgress);
30991
+ };
30968
30992
  /**
30969
30993
  * List agent runs for a title.
30970
30994
  */
30971
30995
  Agents.listRuns = function (title_id, params) {
30972
30996
  return Requests.processRoute(AgentsRoute.routes.listRuns, {}, { title_id: title_id }, params);
30973
30997
  };
30998
+ /**
30999
+ * View one durable agent run, including events, files, actions, and guidance when loaded by the API.
31000
+ */
31001
+ Agents.viewRun = function (title_id, run_id, params) {
31002
+ return Requests.processRoute(AgentsRoute.routes.viewRun, {}, { title_id: title_id, run_id: run_id }, params);
31003
+ };
31004
+ /**
31005
+ * List real-time user-visible events for an agent run.
31006
+ */
31007
+ Agents.listRunEvents = function (title_id, run_id, params) {
31008
+ return Requests.processRoute(AgentsRoute.routes.listRunEvents, {}, { title_id: title_id, run_id: run_id }, params);
31009
+ };
31010
+ /**
31011
+ * Request cancellation for a queued or running agent run.
31012
+ */
31013
+ Agents.cancelRun = function (title_id, run_id, data, params) {
31014
+ return Requests.processRoute(AgentsRoute.routes.cancelRun, data || {}, { title_id: title_id, run_id: run_id }, params);
31015
+ };
31016
+ /**
31017
+ * Send a course correction to a queued or running agent run.
31018
+ */
31019
+ Agents.interjectRun = function (title_id, run_id, data, params) {
31020
+ return Requests.processRoute(AgentsRoute.routes.interjectRun, data || {}, { title_id: title_id, run_id: run_id }, params);
31021
+ };
30974
31022
  /**
30975
31023
  * List agent actions/approval queue for a title.
30976
31024
  */
@@ -31026,12 +31074,37 @@ var Agents = /** @class */ (function () {
31026
31074
  Agents.usage = function (title_id, params) {
31027
31075
  return Requests.processRoute(AgentsRoute.routes.usage, {}, { title_id: title_id }, params);
31028
31076
  };
31077
+ /**
31078
+ * Get the prepaid agent credit balance and ledger (Pay-As-You-Go plan).
31079
+ */
31080
+ Agents.credits = function (title_id, params) {
31081
+ return Requests.processRoute(AgentsRoute.routes.credits, {}, { title_id: title_id }, params);
31082
+ };
31083
+ /**
31084
+ * Buy prepaid agent credits (Pay-As-You-Go). Charges the card up front; the agent draws down
31085
+ * credits per run and stops when they run out. data: { paymentMethod, amount_usd }.
31086
+ */
31087
+ Agents.purchaseCredits = function (title_id, data, params) {
31088
+ return Requests.processRoute(AgentsRoute.routes.purchaseCredits, data, { title_id: title_id }, params);
31089
+ };
31029
31090
  /**
31030
31091
  * Start a Stripe-backed agent trial/subscription after setup.
31031
31092
  */
31032
31093
  Agents.startTrial = function (title_id, data, params) {
31033
31094
  return Requests.processRoute(AgentsRoute.routes.startTrial, data, { title_id: title_id }, params);
31034
31095
  };
31096
+ /**
31097
+ * Cross-title agency cockpit: per-title agent status, billing/credits, and portfolio totals.
31098
+ */
31099
+ Agents.agencyOverview = function (params) {
31100
+ return Requests.processRoute(AgentsRoute.routes.agencyOverview, {}, {}, params);
31101
+ };
31102
+ /**
31103
+ * Unified cross-title "needs you" inbox (open guidance + pending approvals across all titles).
31104
+ */
31105
+ Agents.agencyInbox = function (params) {
31106
+ return Requests.processRoute(AgentsRoute.routes.agencyInbox, {}, {}, params);
31107
+ };
31035
31108
  return Agents;
31036
31109
  }());
31037
31110