glitch-javascript-sdk 3.2.2 → 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.
@@ -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,34 @@ 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
+ * Request cancellation for a queued or running agent run.
62
+ */
63
+ static cancelRun<T>(title_id: string, run_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
64
+ /**
65
+ * Send a course correction to a queued or running agent run.
66
+ */
67
+ static interjectRun<T>(title_id: string, run_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
44
68
  /**
45
69
  * List agent actions/approval queue for a title.
46
70
  */
package/dist/esm/index.js CHANGED
@@ -18895,7 +18895,12 @@ 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
+ cancelRun: { url: "/agents/titles/{title_id}/runs/{run_id}/cancel", method: HTTP_METHODS.POST },
18903
+ interjectRun: { url: "/agents/titles/{title_id}/runs/{run_id}/interject", method: HTTP_METHODS.POST },
18899
18904
  listActions: { url: "/agents/titles/{title_id}/actions", method: HTTP_METHODS.GET },
18900
18905
  approveAction: { url: "/agents/titles/{title_id}/actions/{action_id}/approve", method: HTTP_METHODS.POST },
18901
18906
  rejectAction: { url: "/agents/titles/{title_id}/actions/{action_id}/reject", method: HTTP_METHODS.POST },
@@ -18971,12 +18976,51 @@ var Agents = /** @class */ (function () {
18971
18976
  Agents.runAgent = function (title_id, agent_id, data, params) {
18972
18977
  return Requests.processRoute(AgentsRoute.routes.runAgent, data, { title_id: title_id, agent_id: agent_id }, params);
18973
18978
  };
18979
+ /**
18980
+ * Upload one file for an agent run. data can include { agent_run_id }.
18981
+ */
18982
+ Agents.uploadAgentFile = function (title_id, agent_id, file, data, params, onUploadProgress) {
18983
+ var url = AgentsRoute.routes.uploadAgentFiles.url
18984
+ .replace("{title_id}", title_id)
18985
+ .replace("{agent_id}", agent_id);
18986
+ return Requests.uploadFile(url, "file", file, data, params, onUploadProgress);
18987
+ };
18988
+ /**
18989
+ * Alias for callers that use plural naming while uploading one file at a time.
18990
+ */
18991
+ Agents.uploadAgentFiles = function (title_id, agent_id, file, data, params, onUploadProgress) {
18992
+ return Agents.uploadAgentFile(title_id, agent_id, file, data, params, onUploadProgress);
18993
+ };
18974
18994
  /**
18975
18995
  * List agent runs for a title.
18976
18996
  */
18977
18997
  Agents.listRuns = function (title_id, params) {
18978
18998
  return Requests.processRoute(AgentsRoute.routes.listRuns, {}, { title_id: title_id }, params);
18979
18999
  };
19000
+ /**
19001
+ * View one durable agent run, including events, files, actions, and guidance when loaded by the API.
19002
+ */
19003
+ Agents.viewRun = function (title_id, run_id, params) {
19004
+ return Requests.processRoute(AgentsRoute.routes.viewRun, {}, { title_id: title_id, run_id: run_id }, params);
19005
+ };
19006
+ /**
19007
+ * List real-time user-visible events for an agent run.
19008
+ */
19009
+ Agents.listRunEvents = function (title_id, run_id, params) {
19010
+ return Requests.processRoute(AgentsRoute.routes.listRunEvents, {}, { title_id: title_id, run_id: run_id }, params);
19011
+ };
19012
+ /**
19013
+ * Request cancellation for a queued or running agent run.
19014
+ */
19015
+ Agents.cancelRun = function (title_id, run_id, data, params) {
19016
+ return Requests.processRoute(AgentsRoute.routes.cancelRun, data || {}, { title_id: title_id, run_id: run_id }, params);
19017
+ };
19018
+ /**
19019
+ * Send a course correction to a queued or running agent run.
19020
+ */
19021
+ Agents.interjectRun = function (title_id, run_id, data, params) {
19022
+ return Requests.processRoute(AgentsRoute.routes.interjectRun, data || {}, { title_id: title_id, run_id: run_id }, params);
19023
+ };
18980
19024
  /**
18981
19025
  * List agent actions/approval queue for a title.
18982
19026
  */