glitch-javascript-sdk 3.1.6 → 3.2.0

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.
@@ -0,0 +1,81 @@
1
+ import Response from "../util/Response";
2
+ import { AxiosPromise } from "axios";
3
+ declare class Agents {
4
+ /**
5
+ * List game titles that can be managed in the Agents section.
6
+ */
7
+ static listTitles<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
8
+ /**
9
+ * Return the full Laravel API route catalog agents use for route-aware planning.
10
+ */
11
+ static routeCatalog<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
12
+ /**
13
+ * Get a title-scoped agent workspace with setup, billing, counts, and route summary.
14
+ */
15
+ static workspace<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
16
+ /**
17
+ * List agents for a title.
18
+ */
19
+ static listAgents<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
20
+ /**
21
+ * Create an agent before payment. Runs/results remain gated until trial/subscription.
22
+ */
23
+ static createAgent<T>(title_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
24
+ /**
25
+ * View one agent.
26
+ */
27
+ static viewAgent<T>(title_id: string, agent_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
28
+ /**
29
+ * Update an agent's setup, policies, and guidance stop rules.
30
+ */
31
+ static updateAgent<T>(title_id: string, agent_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
32
+ /**
33
+ * Archive an agent.
34
+ */
35
+ static deleteAgent<T>(title_id: string, agent_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
36
+ /**
37
+ * Run an agent planning cycle. Returns 402 when trial/subscription is required.
38
+ */
39
+ static runAgent<T>(title_id: string, agent_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
40
+ /**
41
+ * List agent runs for a title.
42
+ */
43
+ static listRuns<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
44
+ /**
45
+ * List agent actions/approval queue for a title.
46
+ */
47
+ static listActions<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
48
+ /**
49
+ * Approve an agent action.
50
+ */
51
+ static approveAction<T>(title_id: string, action_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
52
+ /**
53
+ * Reject an agent action.
54
+ */
55
+ static rejectAction<T>(title_id: string, action_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
56
+ /**
57
+ * Execute an approved safe action.
58
+ */
59
+ static executeAction<T>(title_id: string, action_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
60
+ /**
61
+ * List guidance requests where agents have stopped for developer direction.
62
+ */
63
+ static listGuidance<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
64
+ /**
65
+ * Answer a guidance request and write structured agent memory.
66
+ */
67
+ static answerGuidance<T>(title_id: string, guidance_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
68
+ /**
69
+ * List structured agent memories for a title.
70
+ */
71
+ static listMemories<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
72
+ /**
73
+ * Get results and outcome summary for title agents. Returns 402 until trial/subscription is active.
74
+ */
75
+ static results<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
76
+ /**
77
+ * Start a Stripe-backed agent trial/subscription after setup.
78
+ */
79
+ static startTrial<T>(title_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
80
+ }
81
+ export default Agents;
@@ -45,6 +45,7 @@ import Education from "./Education";
45
45
  import Crm from "./Crm";
46
46
  import Multiplayer from "./Multiplayer";
47
47
  import ServerOperations from "./ServerOperations";
48
+ import Agents from "./Agents";
48
49
  export { Ads };
49
50
  export { AccessKeys };
50
51
  export { Auth };
@@ -92,3 +93,4 @@ export { Education };
92
93
  export { Crm };
93
94
  export { Multiplayer };
94
95
  export { ServerOperations };
96
+ export { Agents };
@@ -45,6 +45,7 @@ import { Education } from './api';
45
45
  import { Crm } from './api';
46
46
  import { Multiplayer } from './api';
47
47
  import { ServerOperations } from './api';
48
+ import { Agents } from './api';
48
49
  import Requests from "./util/Requests";
49
50
  import Parser from "./util/Parser";
50
51
  import Session from "./util/Session";
@@ -111,6 +112,7 @@ declare class Glitch {
111
112
  Crm: typeof Crm;
112
113
  Multiplayer: typeof Multiplayer;
113
114
  ServerOperations: typeof ServerOperations;
115
+ Agents: typeof Agents;
114
116
  };
115
117
  static util: {
116
118
  Requests: typeof Requests;
package/dist/esm/index.js CHANGED
@@ -18882,6 +18882,153 @@ var ServerOperations = /** @class */ (function () {
18882
18882
  return ServerOperations;
18883
18883
  }());
18884
18884
 
18885
+ var AgentsRoute = /** @class */ (function () {
18886
+ function AgentsRoute() {
18887
+ }
18888
+ AgentsRoute.routes = {
18889
+ listTitles: { url: "/agents/titles", method: HTTP_METHODS.GET },
18890
+ routeCatalog: { url: "/agents/routes/catalog", method: HTTP_METHODS.GET },
18891
+ workspace: { url: "/agents/titles/{title_id}/workspace", method: HTTP_METHODS.GET },
18892
+ listAgents: { url: "/agents/titles/{title_id}/agents", method: HTTP_METHODS.GET },
18893
+ createAgent: { url: "/agents/titles/{title_id}/agents", method: HTTP_METHODS.POST },
18894
+ viewAgent: { url: "/agents/titles/{title_id}/agents/{agent_id}", method: HTTP_METHODS.GET },
18895
+ updateAgent: { url: "/agents/titles/{title_id}/agents/{agent_id}", method: HTTP_METHODS.PUT },
18896
+ deleteAgent: { url: "/agents/titles/{title_id}/agents/{agent_id}", method: HTTP_METHODS.DELETE },
18897
+ runAgent: { url: "/agents/titles/{title_id}/agents/{agent_id}/run", method: HTTP_METHODS.POST },
18898
+ listRuns: { url: "/agents/titles/{title_id}/runs", method: HTTP_METHODS.GET },
18899
+ listActions: { url: "/agents/titles/{title_id}/actions", method: HTTP_METHODS.GET },
18900
+ approveAction: { url: "/agents/titles/{title_id}/actions/{action_id}/approve", method: HTTP_METHODS.POST },
18901
+ rejectAction: { url: "/agents/titles/{title_id}/actions/{action_id}/reject", method: HTTP_METHODS.POST },
18902
+ executeAction: { url: "/agents/titles/{title_id}/actions/{action_id}/execute", method: HTTP_METHODS.POST },
18903
+ listGuidance: { url: "/agents/titles/{title_id}/guidance", method: HTTP_METHODS.GET },
18904
+ answerGuidance: { url: "/agents/titles/{title_id}/guidance/{guidance_id}/answer", method: HTTP_METHODS.POST },
18905
+ listMemories: { url: "/agents/titles/{title_id}/memories", method: HTTP_METHODS.GET },
18906
+ results: { url: "/agents/titles/{title_id}/results", method: HTTP_METHODS.GET },
18907
+ startTrial: { url: "/agents/titles/{title_id}/subscription/trial", method: HTTP_METHODS.POST },
18908
+ };
18909
+ return AgentsRoute;
18910
+ }());
18911
+
18912
+ var Agents = /** @class */ (function () {
18913
+ function Agents() {
18914
+ }
18915
+ /**
18916
+ * List game titles that can be managed in the Agents section.
18917
+ */
18918
+ Agents.listTitles = function (params) {
18919
+ return Requests.processRoute(AgentsRoute.routes.listTitles, {}, {}, params);
18920
+ };
18921
+ /**
18922
+ * Return the full Laravel API route catalog agents use for route-aware planning.
18923
+ */
18924
+ Agents.routeCatalog = function (params) {
18925
+ return Requests.processRoute(AgentsRoute.routes.routeCatalog, {}, {}, params);
18926
+ };
18927
+ /**
18928
+ * Get a title-scoped agent workspace with setup, billing, counts, and route summary.
18929
+ */
18930
+ Agents.workspace = function (title_id, params) {
18931
+ return Requests.processRoute(AgentsRoute.routes.workspace, {}, { title_id: title_id }, params);
18932
+ };
18933
+ /**
18934
+ * List agents for a title.
18935
+ */
18936
+ Agents.listAgents = function (title_id, params) {
18937
+ return Requests.processRoute(AgentsRoute.routes.listAgents, {}, { title_id: title_id }, params);
18938
+ };
18939
+ /**
18940
+ * Create an agent before payment. Runs/results remain gated until trial/subscription.
18941
+ */
18942
+ Agents.createAgent = function (title_id, data, params) {
18943
+ return Requests.processRoute(AgentsRoute.routes.createAgent, data, { title_id: title_id }, params);
18944
+ };
18945
+ /**
18946
+ * View one agent.
18947
+ */
18948
+ Agents.viewAgent = function (title_id, agent_id, params) {
18949
+ return Requests.processRoute(AgentsRoute.routes.viewAgent, {}, { title_id: title_id, agent_id: agent_id }, params);
18950
+ };
18951
+ /**
18952
+ * Update an agent's setup, policies, and guidance stop rules.
18953
+ */
18954
+ Agents.updateAgent = function (title_id, agent_id, data, params) {
18955
+ return Requests.processRoute(AgentsRoute.routes.updateAgent, data, { title_id: title_id, agent_id: agent_id }, params);
18956
+ };
18957
+ /**
18958
+ * Archive an agent.
18959
+ */
18960
+ Agents.deleteAgent = function (title_id, agent_id, params) {
18961
+ return Requests.processRoute(AgentsRoute.routes.deleteAgent, {}, { title_id: title_id, agent_id: agent_id }, params);
18962
+ };
18963
+ /**
18964
+ * Run an agent planning cycle. Returns 402 when trial/subscription is required.
18965
+ */
18966
+ Agents.runAgent = function (title_id, agent_id, data, params) {
18967
+ return Requests.processRoute(AgentsRoute.routes.runAgent, data, { title_id: title_id, agent_id: agent_id }, params);
18968
+ };
18969
+ /**
18970
+ * List agent runs for a title.
18971
+ */
18972
+ Agents.listRuns = function (title_id, params) {
18973
+ return Requests.processRoute(AgentsRoute.routes.listRuns, {}, { title_id: title_id }, params);
18974
+ };
18975
+ /**
18976
+ * List agent actions/approval queue for a title.
18977
+ */
18978
+ Agents.listActions = function (title_id, params) {
18979
+ return Requests.processRoute(AgentsRoute.routes.listActions, {}, { title_id: title_id }, params);
18980
+ };
18981
+ /**
18982
+ * Approve an agent action.
18983
+ */
18984
+ Agents.approveAction = function (title_id, action_id, data, params) {
18985
+ return Requests.processRoute(AgentsRoute.routes.approveAction, data || {}, { title_id: title_id, action_id: action_id }, params);
18986
+ };
18987
+ /**
18988
+ * Reject an agent action.
18989
+ */
18990
+ Agents.rejectAction = function (title_id, action_id, data, params) {
18991
+ return Requests.processRoute(AgentsRoute.routes.rejectAction, data || {}, { title_id: title_id, action_id: action_id }, params);
18992
+ };
18993
+ /**
18994
+ * Execute an approved safe action.
18995
+ */
18996
+ Agents.executeAction = function (title_id, action_id, data, params) {
18997
+ return Requests.processRoute(AgentsRoute.routes.executeAction, data || {}, { title_id: title_id, action_id: action_id }, params);
18998
+ };
18999
+ /**
19000
+ * List guidance requests where agents have stopped for developer direction.
19001
+ */
19002
+ Agents.listGuidance = function (title_id, params) {
19003
+ return Requests.processRoute(AgentsRoute.routes.listGuidance, {}, { title_id: title_id }, params);
19004
+ };
19005
+ /**
19006
+ * Answer a guidance request and write structured agent memory.
19007
+ */
19008
+ Agents.answerGuidance = function (title_id, guidance_id, data, params) {
19009
+ return Requests.processRoute(AgentsRoute.routes.answerGuidance, data, { title_id: title_id, guidance_id: guidance_id }, params);
19010
+ };
19011
+ /**
19012
+ * List structured agent memories for a title.
19013
+ */
19014
+ Agents.listMemories = function (title_id, params) {
19015
+ return Requests.processRoute(AgentsRoute.routes.listMemories, {}, { title_id: title_id }, params);
19016
+ };
19017
+ /**
19018
+ * Get results and outcome summary for title agents. Returns 402 until trial/subscription is active.
19019
+ */
19020
+ Agents.results = function (title_id, params) {
19021
+ return Requests.processRoute(AgentsRoute.routes.results, {}, { title_id: title_id }, params);
19022
+ };
19023
+ /**
19024
+ * Start a Stripe-backed agent trial/subscription after setup.
19025
+ */
19026
+ Agents.startTrial = function (title_id, data, params) {
19027
+ return Requests.processRoute(AgentsRoute.routes.startTrial, data, { title_id: title_id }, params);
19028
+ };
19029
+ return Agents;
19030
+ }());
19031
+
18885
19032
  var Parser = /** @class */ (function () {
18886
19033
  function Parser() {
18887
19034
  }
@@ -19425,6 +19572,7 @@ var Glitch = /** @class */ (function () {
19425
19572
  Crm: Crm,
19426
19573
  Multiplayer: Multiplayer,
19427
19574
  ServerOperations: ServerOperations,
19575
+ Agents: Agents,
19428
19576
  };
19429
19577
  Glitch.util = {
19430
19578
  Requests: Requests,