glitch-javascript-sdk 3.2.2 → 3.2.4

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.
@@ -1,5 +1,5 @@
1
1
  import Response from "../util/Response";
2
- import { AxiosPromise } from "axios";
2
+ import { AxiosPromise, AxiosProgressEvent } from "axios";
3
3
  declare class Agents {
4
4
  /**
5
5
  * List game titles that can be managed in the Agents section.
@@ -37,10 +37,39 @@ declare class Agents {
37
37
  * Run an agent planning cycle. Returns 402 when trial/subscription is required.
38
38
  */
39
39
  static runAgent<T>(title_id: string, agent_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
40
+ /**
41
+ * Upload one file for an agent run. data can include { agent_run_id }.
42
+ */
43
+ static uploadAgentFile<T>(title_id: string, agent_id: string, file: File | Blob, data?: object, params?: Record<string, any>, onUploadProgress?: (progressEvent: AxiosProgressEvent) => void): AxiosPromise<Response<T>>;
44
+ /**
45
+ * Alias for callers that use plural naming while uploading one file at a time.
46
+ */
47
+ static uploadAgentFiles<T>(title_id: string, agent_id: string, file: File | Blob, data?: object, params?: Record<string, any>, onUploadProgress?: (progressEvent: AxiosProgressEvent) => void): AxiosPromise<Response<T>>;
40
48
  /**
41
49
  * List agent runs for a title.
42
50
  */
43
51
  static listRuns<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
52
+ /**
53
+ * View one durable agent run, including events, files, actions, and guidance when loaded by the API.
54
+ */
55
+ static viewRun<T>(title_id: string, run_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
56
+ /**
57
+ * List real-time user-visible events for an agent run.
58
+ */
59
+ static listRunEvents<T>(title_id: string, run_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
60
+ /**
61
+ * Mark a queued or running agent run as being watched live so the UI can stream the loop
62
+ * and the backend can avoid sending delayed background summaries to active viewers.
63
+ */
64
+ static heartbeatRun<T>(title_id: string, run_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
65
+ /**
66
+ * Request cancellation for a queued or running agent run.
67
+ */
68
+ static cancelRun<T>(title_id: string, run_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
69
+ /**
70
+ * Send a course correction to a queued or running agent run.
71
+ */
72
+ static interjectRun<T>(title_id: string, run_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
44
73
  /**
45
74
  * List agent actions/approval queue for a title.
46
75
  */
@@ -91,6 +120,14 @@ declare class Agents {
91
120
  * Start a Stripe-backed agent trial/subscription after setup.
92
121
  */
93
122
  static startTrial<T>(title_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
123
+ /**
124
+ * List social/ad schedulers. Useful when agent setup needs to attach to an existing workflow.
125
+ */
126
+ static listSchedulers<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
127
+ /**
128
+ * Create a scheduler inline from an agent setup flow.
129
+ */
130
+ static createScheduler<T>(data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
94
131
  /**
95
132
  * Cross-title agency cockpit: per-title agent status, billing/credits, and portfolio totals.
96
133
  */
package/dist/esm/index.js CHANGED
@@ -18895,7 +18895,13 @@ var AgentsRoute = /** @class */ (function () {
18895
18895
  updateAgent: { url: "/agents/titles/{title_id}/agents/{agent_id}", method: HTTP_METHODS.PUT },
18896
18896
  deleteAgent: { url: "/agents/titles/{title_id}/agents/{agent_id}", method: HTTP_METHODS.DELETE },
18897
18897
  runAgent: { url: "/agents/titles/{title_id}/agents/{agent_id}/run", method: HTTP_METHODS.POST },
18898
+ uploadAgentFiles: { url: "/agents/titles/{title_id}/agents/{agent_id}/files", method: HTTP_METHODS.POST },
18898
18899
  listRuns: { url: "/agents/titles/{title_id}/runs", method: HTTP_METHODS.GET },
18900
+ viewRun: { url: "/agents/titles/{title_id}/runs/{run_id}", method: HTTP_METHODS.GET },
18901
+ listRunEvents: { url: "/agents/titles/{title_id}/runs/{run_id}/events", method: HTTP_METHODS.GET },
18902
+ heartbeatRun: { url: "/agents/titles/{title_id}/runs/{run_id}/heartbeat", method: HTTP_METHODS.POST },
18903
+ cancelRun: { url: "/agents/titles/{title_id}/runs/{run_id}/cancel", method: HTTP_METHODS.POST },
18904
+ interjectRun: { url: "/agents/titles/{title_id}/runs/{run_id}/interject", method: HTTP_METHODS.POST },
18899
18905
  listActions: { url: "/agents/titles/{title_id}/actions", method: HTTP_METHODS.GET },
18900
18906
  approveAction: { url: "/agents/titles/{title_id}/actions/{action_id}/approve", method: HTTP_METHODS.POST },
18901
18907
  rejectAction: { url: "/agents/titles/{title_id}/actions/{action_id}/reject", method: HTTP_METHODS.POST },
@@ -18908,6 +18914,8 @@ var AgentsRoute = /** @class */ (function () {
18908
18914
  credits: { url: "/agents/titles/{title_id}/credits", method: HTTP_METHODS.GET },
18909
18915
  purchaseCredits: { url: "/agents/titles/{title_id}/credits/purchase", method: HTTP_METHODS.POST },
18910
18916
  startTrial: { url: "/agents/titles/{title_id}/subscription/trial", method: HTTP_METHODS.POST },
18917
+ listSchedulers: { url: "/schedulers", method: HTTP_METHODS.GET },
18918
+ createScheduler: { url: "/schedulers", method: HTTP_METHODS.POST },
18911
18919
  agencyOverview: { url: "/agents/agency/overview", method: HTTP_METHODS.GET },
18912
18920
  agencyInbox: { url: "/agents/agency/inbox", method: HTTP_METHODS.GET },
18913
18921
  };
@@ -18971,12 +18979,58 @@ var Agents = /** @class */ (function () {
18971
18979
  Agents.runAgent = function (title_id, agent_id, data, params) {
18972
18980
  return Requests.processRoute(AgentsRoute.routes.runAgent, data, { title_id: title_id, agent_id: agent_id }, params);
18973
18981
  };
18982
+ /**
18983
+ * Upload one file for an agent run. data can include { agent_run_id }.
18984
+ */
18985
+ Agents.uploadAgentFile = function (title_id, agent_id, file, data, params, onUploadProgress) {
18986
+ var url = AgentsRoute.routes.uploadAgentFiles.url
18987
+ .replace("{title_id}", title_id)
18988
+ .replace("{agent_id}", agent_id);
18989
+ return Requests.uploadFile(url, "file", file, data, params, onUploadProgress);
18990
+ };
18991
+ /**
18992
+ * Alias for callers that use plural naming while uploading one file at a time.
18993
+ */
18994
+ Agents.uploadAgentFiles = function (title_id, agent_id, file, data, params, onUploadProgress) {
18995
+ return Agents.uploadAgentFile(title_id, agent_id, file, data, params, onUploadProgress);
18996
+ };
18974
18997
  /**
18975
18998
  * List agent runs for a title.
18976
18999
  */
18977
19000
  Agents.listRuns = function (title_id, params) {
18978
19001
  return Requests.processRoute(AgentsRoute.routes.listRuns, {}, { title_id: title_id }, params);
18979
19002
  };
19003
+ /**
19004
+ * View one durable agent run, including events, files, actions, and guidance when loaded by the API.
19005
+ */
19006
+ Agents.viewRun = function (title_id, run_id, params) {
19007
+ return Requests.processRoute(AgentsRoute.routes.viewRun, {}, { title_id: title_id, run_id: run_id }, params);
19008
+ };
19009
+ /**
19010
+ * List real-time user-visible events for an agent run.
19011
+ */
19012
+ Agents.listRunEvents = function (title_id, run_id, params) {
19013
+ return Requests.processRoute(AgentsRoute.routes.listRunEvents, {}, { title_id: title_id, run_id: run_id }, params);
19014
+ };
19015
+ /**
19016
+ * Mark a queued or running agent run as being watched live so the UI can stream the loop
19017
+ * and the backend can avoid sending delayed background summaries to active viewers.
19018
+ */
19019
+ Agents.heartbeatRun = function (title_id, run_id, data, params) {
19020
+ return Requests.processRoute(AgentsRoute.routes.heartbeatRun, data || {}, { title_id: title_id, run_id: run_id }, params);
19021
+ };
19022
+ /**
19023
+ * Request cancellation for a queued or running agent run.
19024
+ */
19025
+ Agents.cancelRun = function (title_id, run_id, data, params) {
19026
+ return Requests.processRoute(AgentsRoute.routes.cancelRun, data || {}, { title_id: title_id, run_id: run_id }, params);
19027
+ };
19028
+ /**
19029
+ * Send a course correction to a queued or running agent run.
19030
+ */
19031
+ Agents.interjectRun = function (title_id, run_id, data, params) {
19032
+ return Requests.processRoute(AgentsRoute.routes.interjectRun, data || {}, { title_id: title_id, run_id: run_id }, params);
19033
+ };
18980
19034
  /**
18981
19035
  * List agent actions/approval queue for a title.
18982
19036
  */
@@ -19051,6 +19105,18 @@ var Agents = /** @class */ (function () {
19051
19105
  Agents.startTrial = function (title_id, data, params) {
19052
19106
  return Requests.processRoute(AgentsRoute.routes.startTrial, data, { title_id: title_id }, params);
19053
19107
  };
19108
+ /**
19109
+ * List social/ad schedulers. Useful when agent setup needs to attach to an existing workflow.
19110
+ */
19111
+ Agents.listSchedulers = function (params) {
19112
+ return Requests.processRoute(AgentsRoute.routes.listSchedulers, {}, {}, params);
19113
+ };
19114
+ /**
19115
+ * Create a scheduler inline from an agent setup flow.
19116
+ */
19117
+ Agents.createScheduler = function (data, params) {
19118
+ return Requests.processRoute(AgentsRoute.routes.createScheduler, data || {}, {}, params);
19119
+ };
19054
19120
  /**
19055
19121
  * Cross-title agency cockpit: per-title agent status, billing/credits, and portfolio totals.
19056
19122
  */