@computesdk/render 1.1.18 → 1.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.
package/dist/index.d.mts CHANGED
@@ -1,29 +1,46 @@
1
- import * as _computesdk_provider from '@computesdk/provider';
1
+ import * as computesdk from 'computesdk';
2
+ import { ComputeConfig } from '@computesdk/provider';
2
3
 
3
4
  /**
4
- * Render Provider - Factory-based Implementation
5
+ * Render provider configuration
5
6
  */
6
- /**
7
- * Render sandbox interface
8
- */
9
- interface RenderSandbox {
10
- serviceId: string;
11
- ownerId: string;
12
- }
13
- interface RenderConfig {
7
+ interface RenderConfig extends ComputeConfig {
14
8
  /** Render API key - if not provided, will fallback to RENDER_API_KEY environment variable */
15
9
  apiKey?: string;
16
10
  /** Render Owner ID - if not provided, will fallback to RENDER_OWNER_ID environment variable */
17
11
  ownerId?: string;
18
12
  }
19
- declare const getAndValidateCredentials: (config: RenderConfig) => {
20
- apiKey: string;
21
- ownerId: string;
22
- };
23
- declare const fetchRender: (apiKey: string, endpoint: string, options?: RequestInit) => Promise<any>;
24
13
  /**
25
- * Create a Render provider instance using the factory pattern
14
+ * Render compute factory - creates configured compute instances
15
+ *
16
+ * Render is an infrastructure provider that becomes a full sandbox provider
17
+ * via the ComputeSDK gateway. The gateway provisions Render services with the
18
+ * daemon pre-installed, enabling full sandbox capabilities.
19
+ *
20
+ * @example
21
+ * ```typescript
22
+ * import { render } from '@computesdk/render';
23
+ *
24
+ * const compute = render({
25
+ * apiKey: 'render_xxx',
26
+ * ownerId: 'owner_xxx'
27
+ * });
28
+ *
29
+ * // Full compute API available (routes through gateway)
30
+ * const sandbox = await compute.sandbox.create();
31
+ *
32
+ * // Execute code
33
+ * const result = await sandbox.runCode('console.log("Hello from Render!")');
34
+ * console.log(result.stdout);
35
+ *
36
+ * // Filesystem operations
37
+ * await sandbox.filesystem.writeFile('/tmp/test.txt', 'Hello!');
38
+ * const content = await sandbox.filesystem.readFile('/tmp/test.txt');
39
+ *
40
+ * // Cleanup
41
+ * await sandbox.destroy();
42
+ * ```
26
43
  */
27
- declare const render: (config: RenderConfig) => _computesdk_provider.Provider<RenderSandbox, any, any>;
44
+ declare const render: (config: RenderConfig) => computesdk.CallableCompute;
28
45
 
29
- export { type RenderConfig, fetchRender, getAndValidateCredentials, render };
46
+ export { type RenderConfig, render };
package/dist/index.d.ts CHANGED
@@ -1,29 +1,46 @@
1
- import * as _computesdk_provider from '@computesdk/provider';
1
+ import * as computesdk from 'computesdk';
2
+ import { ComputeConfig } from '@computesdk/provider';
2
3
 
3
4
  /**
4
- * Render Provider - Factory-based Implementation
5
+ * Render provider configuration
5
6
  */
6
- /**
7
- * Render sandbox interface
8
- */
9
- interface RenderSandbox {
10
- serviceId: string;
11
- ownerId: string;
12
- }
13
- interface RenderConfig {
7
+ interface RenderConfig extends ComputeConfig {
14
8
  /** Render API key - if not provided, will fallback to RENDER_API_KEY environment variable */
15
9
  apiKey?: string;
16
10
  /** Render Owner ID - if not provided, will fallback to RENDER_OWNER_ID environment variable */
17
11
  ownerId?: string;
18
12
  }
19
- declare const getAndValidateCredentials: (config: RenderConfig) => {
20
- apiKey: string;
21
- ownerId: string;
22
- };
23
- declare const fetchRender: (apiKey: string, endpoint: string, options?: RequestInit) => Promise<any>;
24
13
  /**
25
- * Create a Render provider instance using the factory pattern
14
+ * Render compute factory - creates configured compute instances
15
+ *
16
+ * Render is an infrastructure provider that becomes a full sandbox provider
17
+ * via the ComputeSDK gateway. The gateway provisions Render services with the
18
+ * daemon pre-installed, enabling full sandbox capabilities.
19
+ *
20
+ * @example
21
+ * ```typescript
22
+ * import { render } from '@computesdk/render';
23
+ *
24
+ * const compute = render({
25
+ * apiKey: 'render_xxx',
26
+ * ownerId: 'owner_xxx'
27
+ * });
28
+ *
29
+ * // Full compute API available (routes through gateway)
30
+ * const sandbox = await compute.sandbox.create();
31
+ *
32
+ * // Execute code
33
+ * const result = await sandbox.runCode('console.log("Hello from Render!")');
34
+ * console.log(result.stdout);
35
+ *
36
+ * // Filesystem operations
37
+ * await sandbox.filesystem.writeFile('/tmp/test.txt', 'Hello!');
38
+ * const content = await sandbox.filesystem.readFile('/tmp/test.txt');
39
+ *
40
+ * // Cleanup
41
+ * await sandbox.destroy();
42
+ * ```
26
43
  */
27
- declare const render: (config: RenderConfig) => _computesdk_provider.Provider<RenderSandbox, any, any>;
44
+ declare const render: (config: RenderConfig) => computesdk.CallableCompute;
28
45
 
29
- export { type RenderConfig, fetchRender, getAndValidateCredentials, render };
46
+ export { type RenderConfig, render };
package/dist/index.js CHANGED
@@ -20,180 +20,15 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
20
20
  // src/index.ts
21
21
  var index_exports = {};
22
22
  __export(index_exports, {
23
- fetchRender: () => fetchRender,
24
- getAndValidateCredentials: () => getAndValidateCredentials,
25
23
  render: () => render
26
24
  });
27
25
  module.exports = __toCommonJS(index_exports);
28
26
  var import_provider = require("@computesdk/provider");
29
- var getAndValidateCredentials = (config) => {
30
- const apiKey = config.apiKey || typeof process !== "undefined" && process.env?.RENDER_API_KEY || "";
31
- const ownerId = config.ownerId || typeof process !== "undefined" && process.env?.RENDER_OWNER_ID || "";
32
- if (!apiKey) {
33
- throw new Error(
34
- "Missing Render API key. Provide apiKey in config or set RENDER_API_KEY environment variable."
35
- );
36
- }
37
- if (!ownerId) {
38
- throw new Error(
39
- "Missing Render Owner ID. Provide ownerId in config or set RENDER_OWNER_ID environment variable."
40
- );
41
- }
42
- return { apiKey, ownerId };
43
- };
44
- var fetchRender = async (apiKey, endpoint, options = {}) => {
45
- const url = `https://api.render.com/v1${endpoint}`;
46
- const requestOptions = {
47
- method: "GET",
48
- ...options,
49
- headers: {
50
- "Accept": "application/json",
51
- "Authorization": `Bearer ${apiKey}`,
52
- ...options.headers || {}
53
- }
54
- };
55
- const response = await fetch(url, requestOptions);
56
- if (!response.ok) {
57
- throw new Error(`Render API error: ${response.status} ${response.statusText}`);
58
- }
59
- if (response.status === 204) {
60
- return {};
61
- }
62
- return response.json();
63
- };
64
- var render = (0, import_provider.defineProvider)({
65
- name: "render",
66
- methods: {
67
- sandbox: {
68
- // Collection operations (compute.sandbox.*)
69
- create: async (config, options) => {
70
- const { apiKey, ownerId } = getAndValidateCredentials(config);
71
- try {
72
- const createServiceData = {
73
- type: "web_service",
74
- autoDeploy: "yes",
75
- image: {
76
- ownerId,
77
- imagePath: options?.runtime === "node" ? "docker.io/traefik/whoami" : "docker.io/traefik/whoami"
78
- },
79
- serviceDetails: {
80
- runtime: "image",
81
- envSpecificDetails: {
82
- dockerCommand: options?.runtime === "node" ? "/whoami --port 10000" : "/whoami --port 10000"
83
- },
84
- pullRequestPreviewsEnabled: "no"
85
- },
86
- ownerId,
87
- name: `render-sandbox-${Date.now()}`
88
- };
89
- const responseData = await fetchRender(apiKey, "/services", {
90
- method: "POST",
91
- headers: {
92
- "Content-Type": "application/json"
93
- },
94
- body: JSON.stringify(createServiceData)
95
- });
96
- if (!responseData) {
97
- throw new Error("No service returned from Render API");
98
- }
99
- const service = responseData.service;
100
- if (!service || !service.id) {
101
- throw new Error(`Service ID is undefined. Full response: ${JSON.stringify(responseData, null, 2)}`);
102
- }
103
- const renderSandbox = {
104
- serviceId: service.id,
105
- ownerId
106
- };
107
- return {
108
- sandbox: renderSandbox,
109
- sandboxId: service.id
110
- };
111
- } catch (error) {
112
- throw new Error(
113
- `Failed to create Render sandbox: ${error instanceof Error ? error.message : String(error)}`
114
- );
115
- }
116
- },
117
- getById: async (config, sandboxId) => {
118
- const { apiKey, ownerId } = getAndValidateCredentials(config);
119
- try {
120
- const responseData = await fetchRender(apiKey, `/services/${sandboxId}`);
121
- if (!responseData) {
122
- return null;
123
- }
124
- if (!responseData.id) {
125
- throw new Error("Service data is missing from Render response");
126
- }
127
- const renderSandbox = {
128
- serviceId: responseData.id,
129
- ownerId
130
- };
131
- return {
132
- sandbox: renderSandbox,
133
- sandboxId: responseData.id
134
- };
135
- } catch (error) {
136
- if (error instanceof Error && error.message.includes("404")) {
137
- return null;
138
- }
139
- throw new Error(
140
- `Failed to get Render sandbox: ${error instanceof Error ? error.message : String(error)}`
141
- );
142
- }
143
- },
144
- list: async (config) => {
145
- const { apiKey, ownerId } = getAndValidateCredentials(config);
146
- try {
147
- const responseData = await fetchRender(apiKey, "/services?includePreviews=true&limit=20");
148
- const items = responseData || [];
149
- const sandboxes = items.map((item) => {
150
- const service = item.service;
151
- const renderSandbox = {
152
- serviceId: service.id,
153
- ownerId
154
- };
155
- return {
156
- sandbox: renderSandbox,
157
- sandboxId: service.id
158
- };
159
- });
160
- return sandboxes;
161
- } catch (error) {
162
- throw new Error(
163
- `Failed to list Render sandboxes: ${error instanceof Error ? error.message : String(error)}`
164
- );
165
- }
166
- },
167
- destroy: async (config, sandboxId) => {
168
- const { apiKey } = getAndValidateCredentials(config);
169
- try {
170
- await fetchRender(apiKey, `/services/${sandboxId}`, {
171
- method: "DELETE"
172
- });
173
- } catch (error) {
174
- console.warn(`Render destroy warning: ${error instanceof Error ? error.message : String(error)}`);
175
- }
176
- },
177
- // Instance operations (minimal stubs - not implemented yet)
178
- runCode: async (_sandbox, _code, _runtime) => {
179
- throw new Error("Render runCode method not implemented yet");
180
- },
181
- runCommand: async (_sandbox, _command, _options) => {
182
- throw new Error("Render runCommand method not implemented yet");
183
- },
184
- getInfo: async (_sandbox) => {
185
- throw new Error("Render getInfo method not implemented yet");
186
- },
187
- getUrl: async (_sandbox, _options) => {
188
- throw new Error("Render getUrl method not implemented yet");
189
- }
190
- }
191
- }
27
+ var render = (0, import_provider.defineCompute)({
28
+ provider: "render"
192
29
  });
193
30
  // Annotate the CommonJS export names for ESM import in node:
194
31
  0 && (module.exports = {
195
- fetchRender,
196
- getAndValidateCredentials,
197
32
  render
198
33
  });
199
34
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["/**\n * Render Provider - Factory-based Implementation\n */\n\nimport { defineProvider } from '@computesdk/provider';\n\nimport type { Runtime, CodeResult, CommandResult, SandboxInfo, CreateSandboxOptions, FileEntry, RunCommandOptions } from '@computesdk/provider';\n\n/**\n * Render sandbox interface\n */\ninterface RenderSandbox {\n serviceId: string;\n ownerId: string;\n}\n\nexport interface RenderConfig {\n /** Render API key - if not provided, will fallback to RENDER_API_KEY environment variable */\n apiKey?: string;\n /** Render Owner ID - if not provided, will fallback to RENDER_OWNER_ID environment variable */\n ownerId?: string;\n}\n\nexport const getAndValidateCredentials = (config: RenderConfig) => {\n const apiKey = config.apiKey || (typeof process !== 'undefined' && process.env?.RENDER_API_KEY) || '';\n const ownerId = config.ownerId || (typeof process !== 'undefined' && process.env?.RENDER_OWNER_ID) || '';\n\n if (!apiKey) {\n throw new Error(\n 'Missing Render API key. Provide apiKey in config or set RENDER_API_KEY environment variable.'\n );\n }\n\n if (!ownerId) {\n throw new Error(\n 'Missing Render Owner ID. Provide ownerId in config or set RENDER_OWNER_ID environment variable.'\n );\n }\n\n return { apiKey, ownerId };\n};\n\nexport const fetchRender = async (\n apiKey: string,\n endpoint: string,\n options: RequestInit = {}\n) => {\n const url = `https://api.render.com/v1${endpoint}`;\n const requestOptions = {\n method: 'GET',\n ...options,\n headers: {\n 'Accept': 'application/json',\n 'Authorization': `Bearer ${apiKey}`,\n ...(options.headers || {})\n }\n };\n \n const response = await fetch(url, requestOptions);\n\n if (!response.ok) {\n throw new Error(`Render API error: ${response.status} ${response.statusText}`);\n }\n\n // Handle 204 No Content responses (like DELETE operations)\n if (response.status === 204) {\n return {};\n }\n\n return response.json();\n};\n\n\n\n/**\n * Create a Render provider instance using the factory pattern\n */\nexport const render = defineProvider<RenderSandbox, RenderConfig>({\n name: 'render',\n methods: {\n sandbox: {\n // Collection operations (compute.sandbox.*)\n create: async (config: RenderConfig, options?: CreateSandboxOptions) => {\n const { apiKey, ownerId } = getAndValidateCredentials(config);\n\n try {\n const createServiceData = {\n type: 'web_service',\n autoDeploy: 'yes',\n image: {\n ownerId: ownerId,\n imagePath: options?.runtime === 'node' ? 'docker.io/traefik/whoami' : 'docker.io/traefik/whoami'\n },\n serviceDetails: {\n runtime: 'image',\n envSpecificDetails: {\n dockerCommand: options?.runtime === 'node' ? '/whoami --port 10000' : '/whoami --port 10000'\n },\n pullRequestPreviewsEnabled: 'no'\n },\n ownerId: ownerId,\n name: `render-sandbox-${Date.now()}`\n };\n\n\n const responseData = await fetchRender(apiKey, '/services', {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(createServiceData)\n });\n \n if (!responseData) {\n throw new Error('No service returned from Render API');\n }\n \n // Render API returns { service: { id: \"...\", ... }, deployId: \"...\" }\n const service = responseData.service;\n if (!service || !service.id) {\n throw new Error(`Service ID is undefined. Full response: ${JSON.stringify(responseData, null, 2)}`);\n }\n\n const renderSandbox: RenderSandbox = {\n serviceId: service.id,\n ownerId,\n };\n\n return {\n sandbox: renderSandbox,\n sandboxId: service.id\n };\n } catch (error) {\n throw new Error(\n `Failed to create Render sandbox: ${error instanceof Error ? error.message : String(error)}`\n );\n }\n },\n\n getById: async (config: RenderConfig, sandboxId: string) => {\n const { apiKey, ownerId } = getAndValidateCredentials(config);\n\n try {\n const responseData = await fetchRender(apiKey, `/services/${sandboxId}`);\n \n // If service doesn't exist, the API will throw an error which we catch\n if (!responseData) {\n return null;\n }\n \n // Service should be defined if we get here\n if (!responseData.id) {\n throw new Error('Service data is missing from Render response');\n }\n \n const renderSandbox: RenderSandbox = {\n serviceId: responseData.id,\n ownerId,\n };\n\n return {\n sandbox: renderSandbox,\n sandboxId: responseData.id\n };\n } catch (error) {\n // If it's a 404, return null to indicate service not found\n if (error instanceof Error && error.message.includes('404')) {\n return null;\n }\n throw new Error(\n `Failed to get Render sandbox: ${error instanceof Error ? error.message : String(error)}`\n );\n }\n },\n \n list: async (config: RenderConfig) => {\n const { apiKey, ownerId } = getAndValidateCredentials(config);\n\n try {\n const responseData = await fetchRender(apiKey, '/services?includePreviews=true&limit=20');\n \n // Extract services from the array response - each item has a \"service\" property\n const items = responseData || [];\n \n // Transform each service into the expected format\n const sandboxes = items.map((item: any) => {\n const service = item.service;\n const renderSandbox: RenderSandbox = {\n serviceId: service.id,\n ownerId,\n };\n\n return {\n sandbox: renderSandbox,\n sandboxId: service.id\n };\n });\n\n return sandboxes;\n } catch (error) {\n throw new Error(\n `Failed to list Render sandboxes: ${error instanceof Error ? error.message : String(error)}`\n );\n }\n },\n\n destroy: async (config: RenderConfig, sandboxId: string) => {\n const { apiKey } = getAndValidateCredentials(config);\n\n try {\n await fetchRender(apiKey, `/services/${sandboxId}`, {\n method: 'DELETE'\n });\n } catch (error) {\n // For destroy operations, we typically don't throw if the service is already gone\n console.warn(`Render destroy warning: ${error instanceof Error ? error.message : String(error)}`);\n }\n },\n\n // Instance operations (minimal stubs - not implemented yet)\n runCode: async (_sandbox: RenderSandbox, _code: string, _runtime?: Runtime) => {\n throw new Error('Render runCode method not implemented yet');\n },\n\n runCommand: async (_sandbox: RenderSandbox, _command: string, _options?: RunCommandOptions) => {\n throw new Error('Render runCommand method not implemented yet');\n },\n\n getInfo: async (_sandbox: RenderSandbox) => {\n throw new Error('Render getInfo method not implemented yet');\n },\n\n getUrl: async (_sandbox: RenderSandbox, _options: { port: number; protocol?: string }) => {\n throw new Error('Render getUrl method not implemented yet');\n },\n\n },\n },\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,sBAA+B;AAmBxB,IAAM,4BAA4B,CAAC,WAAyB;AACjE,QAAM,SAAS,OAAO,UAAW,OAAO,YAAY,eAAe,QAAQ,KAAK,kBAAmB;AACnG,QAAM,UAAU,OAAO,WAAY,OAAO,YAAY,eAAe,QAAQ,KAAK,mBAAoB;AAEtG,MAAI,CAAC,QAAQ;AACX,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AAEA,MAAI,CAAC,SAAS;AACZ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AAC;","names":[]}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["/**\n * Render Provider - Compute Factory\n *\n * Provides a first-class Render provider experience by routing all operations\n * through the ComputeSDK gateway. The gateway handles infrastructure provisioning\n * via @computesdk/gateway and installs the daemon for full sandbox capabilities.\n */\n\nimport { defineCompute, type ComputeConfig } from '@computesdk/provider';\n\n/**\n * Render provider configuration\n */\nexport interface RenderConfig extends ComputeConfig {\n /** Render API key - if not provided, will fallback to RENDER_API_KEY environment variable */\n apiKey?: string;\n /** Render Owner ID - if not provided, will fallback to RENDER_OWNER_ID environment variable */\n ownerId?: string;\n}\n\n/**\n * Render compute factory - creates configured compute instances\n *\n * Render is an infrastructure provider that becomes a full sandbox provider\n * via the ComputeSDK gateway. The gateway provisions Render services with the\n * daemon pre-installed, enabling full sandbox capabilities.\n *\n * @example\n * ```typescript\n * import { render } from '@computesdk/render';\n *\n * const compute = render({\n * apiKey: 'render_xxx',\n * ownerId: 'owner_xxx'\n * });\n *\n * // Full compute API available (routes through gateway)\n * const sandbox = await compute.sandbox.create();\n *\n * // Execute code\n * const result = await sandbox.runCode('console.log(\"Hello from Render!\")');\n * console.log(result.stdout);\n *\n * // Filesystem operations\n * await sandbox.filesystem.writeFile('/tmp/test.txt', 'Hello!');\n * const content = await sandbox.filesystem.readFile('/tmp/test.txt');\n *\n * // Cleanup\n * await sandbox.destroy();\n * ```\n */\nexport const render = defineCompute<RenderConfig>({\n provider: 'render'\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAQA,sBAAkD;AA2C3C,IAAM,aAAS,+BAA4B;AAAA,EAChD,UAAU;AACZ,CAAC;","names":[]}
package/dist/index.mjs CHANGED
@@ -1,172 +1,9 @@
1
1
  // src/index.ts
2
- import { defineProvider } from "@computesdk/provider";
3
- var getAndValidateCredentials = (config) => {
4
- const apiKey = config.apiKey || typeof process !== "undefined" && process.env?.RENDER_API_KEY || "";
5
- const ownerId = config.ownerId || typeof process !== "undefined" && process.env?.RENDER_OWNER_ID || "";
6
- if (!apiKey) {
7
- throw new Error(
8
- "Missing Render API key. Provide apiKey in config or set RENDER_API_KEY environment variable."
9
- );
10
- }
11
- if (!ownerId) {
12
- throw new Error(
13
- "Missing Render Owner ID. Provide ownerId in config or set RENDER_OWNER_ID environment variable."
14
- );
15
- }
16
- return { apiKey, ownerId };
17
- };
18
- var fetchRender = async (apiKey, endpoint, options = {}) => {
19
- const url = `https://api.render.com/v1${endpoint}`;
20
- const requestOptions = {
21
- method: "GET",
22
- ...options,
23
- headers: {
24
- "Accept": "application/json",
25
- "Authorization": `Bearer ${apiKey}`,
26
- ...options.headers || {}
27
- }
28
- };
29
- const response = await fetch(url, requestOptions);
30
- if (!response.ok) {
31
- throw new Error(`Render API error: ${response.status} ${response.statusText}`);
32
- }
33
- if (response.status === 204) {
34
- return {};
35
- }
36
- return response.json();
37
- };
38
- var render = defineProvider({
39
- name: "render",
40
- methods: {
41
- sandbox: {
42
- // Collection operations (compute.sandbox.*)
43
- create: async (config, options) => {
44
- const { apiKey, ownerId } = getAndValidateCredentials(config);
45
- try {
46
- const createServiceData = {
47
- type: "web_service",
48
- autoDeploy: "yes",
49
- image: {
50
- ownerId,
51
- imagePath: options?.runtime === "node" ? "docker.io/traefik/whoami" : "docker.io/traefik/whoami"
52
- },
53
- serviceDetails: {
54
- runtime: "image",
55
- envSpecificDetails: {
56
- dockerCommand: options?.runtime === "node" ? "/whoami --port 10000" : "/whoami --port 10000"
57
- },
58
- pullRequestPreviewsEnabled: "no"
59
- },
60
- ownerId,
61
- name: `render-sandbox-${Date.now()}`
62
- };
63
- const responseData = await fetchRender(apiKey, "/services", {
64
- method: "POST",
65
- headers: {
66
- "Content-Type": "application/json"
67
- },
68
- body: JSON.stringify(createServiceData)
69
- });
70
- if (!responseData) {
71
- throw new Error("No service returned from Render API");
72
- }
73
- const service = responseData.service;
74
- if (!service || !service.id) {
75
- throw new Error(`Service ID is undefined. Full response: ${JSON.stringify(responseData, null, 2)}`);
76
- }
77
- const renderSandbox = {
78
- serviceId: service.id,
79
- ownerId
80
- };
81
- return {
82
- sandbox: renderSandbox,
83
- sandboxId: service.id
84
- };
85
- } catch (error) {
86
- throw new Error(
87
- `Failed to create Render sandbox: ${error instanceof Error ? error.message : String(error)}`
88
- );
89
- }
90
- },
91
- getById: async (config, sandboxId) => {
92
- const { apiKey, ownerId } = getAndValidateCredentials(config);
93
- try {
94
- const responseData = await fetchRender(apiKey, `/services/${sandboxId}`);
95
- if (!responseData) {
96
- return null;
97
- }
98
- if (!responseData.id) {
99
- throw new Error("Service data is missing from Render response");
100
- }
101
- const renderSandbox = {
102
- serviceId: responseData.id,
103
- ownerId
104
- };
105
- return {
106
- sandbox: renderSandbox,
107
- sandboxId: responseData.id
108
- };
109
- } catch (error) {
110
- if (error instanceof Error && error.message.includes("404")) {
111
- return null;
112
- }
113
- throw new Error(
114
- `Failed to get Render sandbox: ${error instanceof Error ? error.message : String(error)}`
115
- );
116
- }
117
- },
118
- list: async (config) => {
119
- const { apiKey, ownerId } = getAndValidateCredentials(config);
120
- try {
121
- const responseData = await fetchRender(apiKey, "/services?includePreviews=true&limit=20");
122
- const items = responseData || [];
123
- const sandboxes = items.map((item) => {
124
- const service = item.service;
125
- const renderSandbox = {
126
- serviceId: service.id,
127
- ownerId
128
- };
129
- return {
130
- sandbox: renderSandbox,
131
- sandboxId: service.id
132
- };
133
- });
134
- return sandboxes;
135
- } catch (error) {
136
- throw new Error(
137
- `Failed to list Render sandboxes: ${error instanceof Error ? error.message : String(error)}`
138
- );
139
- }
140
- },
141
- destroy: async (config, sandboxId) => {
142
- const { apiKey } = getAndValidateCredentials(config);
143
- try {
144
- await fetchRender(apiKey, `/services/${sandboxId}`, {
145
- method: "DELETE"
146
- });
147
- } catch (error) {
148
- console.warn(`Render destroy warning: ${error instanceof Error ? error.message : String(error)}`);
149
- }
150
- },
151
- // Instance operations (minimal stubs - not implemented yet)
152
- runCode: async (_sandbox, _code, _runtime) => {
153
- throw new Error("Render runCode method not implemented yet");
154
- },
155
- runCommand: async (_sandbox, _command, _options) => {
156
- throw new Error("Render runCommand method not implemented yet");
157
- },
158
- getInfo: async (_sandbox) => {
159
- throw new Error("Render getInfo method not implemented yet");
160
- },
161
- getUrl: async (_sandbox, _options) => {
162
- throw new Error("Render getUrl method not implemented yet");
163
- }
164
- }
165
- }
2
+ import { defineCompute } from "@computesdk/provider";
3
+ var render = defineCompute({
4
+ provider: "render"
166
5
  });
167
6
  export {
168
- fetchRender,
169
- getAndValidateCredentials,
170
7
  render
171
8
  };
172
9
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["/**\n * Render Provider - Factory-based Implementation\n */\n\nimport { defineProvider } from '@computesdk/provider';\n\nimport type { Runtime, CodeResult, CommandResult, SandboxInfo, CreateSandboxOptions, FileEntry, RunCommandOptions } from '@computesdk/provider';\n\n/**\n * Render sandbox interface\n */\ninterface RenderSandbox {\n serviceId: string;\n ownerId: string;\n}\n\nexport interface RenderConfig {\n /** Render API key - if not provided, will fallback to RENDER_API_KEY environment variable */\n apiKey?: string;\n /** Render Owner ID - if not provided, will fallback to RENDER_OWNER_ID environment variable */\n ownerId?: string;\n}\n\nexport const getAndValidateCredentials = (config: RenderConfig) => {\n const apiKey = config.apiKey || (typeof process !== 'undefined' && process.env?.RENDER_API_KEY) || '';\n const ownerId = config.ownerId || (typeof process !== 'undefined' && process.env?.RENDER_OWNER_ID) || '';\n\n if (!apiKey) {\n throw new Error(\n 'Missing Render API key. Provide apiKey in config or set RENDER_API_KEY environment variable.'\n );\n }\n\n if (!ownerId) {\n throw new Error(\n 'Missing Render Owner ID. Provide ownerId in config or set RENDER_OWNER_ID environment variable.'\n );\n }\n\n return { apiKey, ownerId };\n};\n\nexport const fetchRender = async (\n apiKey: string,\n endpoint: string,\n options: RequestInit = {}\n) => {\n const url = `https://api.render.com/v1${endpoint}`;\n const requestOptions = {\n method: 'GET',\n ...options,\n headers: {\n 'Accept': 'application/json',\n 'Authorization': `Bearer ${apiKey}`,\n ...(options.headers || {})\n }\n };\n \n const response = await fetch(url, requestOptions);\n\n if (!response.ok) {\n throw new Error(`Render API error: ${response.status} ${response.statusText}`);\n }\n\n // Handle 204 No Content responses (like DELETE operations)\n if (response.status === 204) {\n return {};\n }\n\n return response.json();\n};\n\n\n\n/**\n * Create a Render provider instance using the factory pattern\n */\nexport const render = defineProvider<RenderSandbox, RenderConfig>({\n name: 'render',\n methods: {\n sandbox: {\n // Collection operations (compute.sandbox.*)\n create: async (config: RenderConfig, options?: CreateSandboxOptions) => {\n const { apiKey, ownerId } = getAndValidateCredentials(config);\n\n try {\n const createServiceData = {\n type: 'web_service',\n autoDeploy: 'yes',\n image: {\n ownerId: ownerId,\n imagePath: options?.runtime === 'node' ? 'docker.io/traefik/whoami' : 'docker.io/traefik/whoami'\n },\n serviceDetails: {\n runtime: 'image',\n envSpecificDetails: {\n dockerCommand: options?.runtime === 'node' ? '/whoami --port 10000' : '/whoami --port 10000'\n },\n pullRequestPreviewsEnabled: 'no'\n },\n ownerId: ownerId,\n name: `render-sandbox-${Date.now()}`\n };\n\n\n const responseData = await fetchRender(apiKey, '/services', {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(createServiceData)\n });\n \n if (!responseData) {\n throw new Error('No service returned from Render API');\n }\n \n // Render API returns { service: { id: \"...\", ... }, deployId: \"...\" }\n const service = responseData.service;\n if (!service || !service.id) {\n throw new Error(`Service ID is undefined. Full response: ${JSON.stringify(responseData, null, 2)}`);\n }\n\n const renderSandbox: RenderSandbox = {\n serviceId: service.id,\n ownerId,\n };\n\n return {\n sandbox: renderSandbox,\n sandboxId: service.id\n };\n } catch (error) {\n throw new Error(\n `Failed to create Render sandbox: ${error instanceof Error ? error.message : String(error)}`\n );\n }\n },\n\n getById: async (config: RenderConfig, sandboxId: string) => {\n const { apiKey, ownerId } = getAndValidateCredentials(config);\n\n try {\n const responseData = await fetchRender(apiKey, `/services/${sandboxId}`);\n \n // If service doesn't exist, the API will throw an error which we catch\n if (!responseData) {\n return null;\n }\n \n // Service should be defined if we get here\n if (!responseData.id) {\n throw new Error('Service data is missing from Render response');\n }\n \n const renderSandbox: RenderSandbox = {\n serviceId: responseData.id,\n ownerId,\n };\n\n return {\n sandbox: renderSandbox,\n sandboxId: responseData.id\n };\n } catch (error) {\n // If it's a 404, return null to indicate service not found\n if (error instanceof Error && error.message.includes('404')) {\n return null;\n }\n throw new Error(\n `Failed to get Render sandbox: ${error instanceof Error ? error.message : String(error)}`\n );\n }\n },\n \n list: async (config: RenderConfig) => {\n const { apiKey, ownerId } = getAndValidateCredentials(config);\n\n try {\n const responseData = await fetchRender(apiKey, '/services?includePreviews=true&limit=20');\n \n // Extract services from the array response - each item has a \"service\" property\n const items = responseData || [];\n \n // Transform each service into the expected format\n const sandboxes = items.map((item: any) => {\n const service = item.service;\n const renderSandbox: RenderSandbox = {\n serviceId: service.id,\n ownerId,\n };\n\n return {\n sandbox: renderSandbox,\n sandboxId: service.id\n };\n });\n\n return sandboxes;\n } catch (error) {\n throw new Error(\n `Failed to list Render sandboxes: ${error instanceof Error ? error.message : String(error)}`\n );\n }\n },\n\n destroy: async (config: RenderConfig, sandboxId: string) => {\n const { apiKey } = getAndValidateCredentials(config);\n\n try {\n await fetchRender(apiKey, `/services/${sandboxId}`, {\n method: 'DELETE'\n });\n } catch (error) {\n // For destroy operations, we typically don't throw if the service is already gone\n console.warn(`Render destroy warning: ${error instanceof Error ? error.message : String(error)}`);\n }\n },\n\n // Instance operations (minimal stubs - not implemented yet)\n runCode: async (_sandbox: RenderSandbox, _code: string, _runtime?: Runtime) => {\n throw new Error('Render runCode method not implemented yet');\n },\n\n runCommand: async (_sandbox: RenderSandbox, _command: string, _options?: RunCommandOptions) => {\n throw new Error('Render runCommand method not implemented yet');\n },\n\n getInfo: async (_sandbox: RenderSandbox) => {\n throw new Error('Render getInfo method not implemented yet');\n },\n\n getUrl: async (_sandbox: RenderSandbox, _options: { port: number; protocol?: string }) => {\n throw new Error('Render getUrl method not implemented yet');\n },\n\n },\n },\n});\n"],"mappings":";AAIA,SAAS,sBAAsB;AAmBxB,IAAM,4BAA4B,CAAC,WAAyB;AACjE,QAAM,SAAS,OAAO,UAAW,OAAO,YAAY,eAAe,QAAQ,KAAK,kBAAmB;AACnG,QAAM,UAAU,OAAO,WAAY,OAAO,YAAY,eAAe,QAAQ,KAAK,mBAAoB;AAEtG,MAAI,CAAC,QAAQ;AACX,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AAEA,MAAI,CAAC,SAAS;AACZ,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AAEA,SAAO,EAAE,QAAQ,QAAQ;AAC3B;AAEO,IAAM,cAAc,OACzB,QACA,UACA,UAAuB,CAAC,MACrB;AACH,QAAM,MAAM,4BAA4B,QAAQ;AAChD,QAAM,iBAAiB;AAAA,IACrB,QAAQ;AAAA,IACR,GAAG;AAAA,IACH,SAAS;AAAA,MACP,UAAU;AAAA,MACV,iBAAiB,UAAU,MAAM;AAAA,MACjC,GAAI,QAAQ,WAAW,CAAC;AAAA,IAC1B;AAAA,EACF;AAEA,QAAM,WAAW,MAAM,MAAM,KAAK,cAAc;AAEhD,MAAI,CAAC,SAAS,IAAI;AAChB,UAAM,IAAI,MAAM,qBAAqB,SAAS,MAAM,IAAI,SAAS,UAAU,EAAE;AAAA,EAC/E;AAGA,MAAI,SAAS,WAAW,KAAK;AAC3B,WAAO,CAAC;AAAA,EACV;AAEA,SAAO,SAAS,KAAK;AACvB;AAOO,IAAM,SAAS,eAA4C;AAAA,EAChE,MAAM;AAAA,EACN,SAAS;AAAA,IACP,SAAS;AAAA;AAAA,MAEP,QAAQ,OAAO,QAAsB,YAAmC;AACtE,cAAM,EAAE,QAAQ,QAAQ,IAAI,0BAA0B,MAAM;AAE5D,YAAI;AACF,gBAAM,oBAAoB;AAAA,YACxB,MA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AE;AAAA,QAClG;AAAA,MACF;AAAA;AAAA,MAGA,SAAS,OAAO,UAAyB,OAAe,aAAuB;AAC7E,cAAM,IAAI,MAAM,2CAA2C;AAAA,MAC7D;AAAA,MAEA,YAAY,OAAO,UAAyB,UAAkB,aAAiC;AAC7F,cAAM,IAAI,MAAM,8CAA8C;AAAA,MAChE;AAAA,MAEA,SAAS,OAAO,aAA4B;AAC1C,cAAM,IAAI,MAAM,2CAA2C;AAAA,MAC7D;AAAA,MAEA,QAAQ,OAAO,UAAyB,aAAkD;AACxF,cAAM,IAAI,MAAM,0CAA0C;AAAA,MAC5D;AAAA,IAEF;AAAA,EACF;AACF,CAAC;","names":[]}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["/**\n * Render Provider - Compute Factory\n *\n * Provides a first-class Render provider experience by routing all operations\n * through the ComputeSDK gateway. The gateway handles infrastructure provisioning\n * via @computesdk/gateway and installs the daemon for full sandbox capabilities.\n */\n\nimport { defineCompute, type ComputeConfig } from '@computesdk/provider';\n\n/**\n * Render provider configuration\n */\nexport interface RenderConfig extends ComputeConfig {\n /** Render API key - if not provided, will fallback to RENDER_API_KEY environment variable */\n apiKey?: string;\n /** Render Owner ID - if not provided, will fallback to RENDER_OWNER_ID environment variable */\n ownerId?: string;\n}\n\n/**\n * Render compute factory - creates configured compute instances\n *\n * Render is an infrastructure provider that becomes a full sandbox provider\n * via the ComputeSDK gateway. The gateway provisions Render services with the\n * daemon pre-installed, enabling full sandbox capabilities.\n *\n * @example\n * ```typescript\n * import { render } from '@computesdk/render';\n *\n * const compute = render({\n * apiKey: 'render_xxx',\n * ownerId: 'owner_xxx'\n * });\n *\n * // Full compute API available (routes through gateway)\n * const sandbox = await compute.sandbox.create();\n *\n * // Execute code\n * const result = await sandbox.runCode('console.log(\"Hello from Render!\")');\n * console.log(result.stdout);\n *\n * // Filesystem operations\n * await sandbox.filesystem.writeFile('/tmp/test.txt', 'Hello!');\n * const content = await sandbox.filesystem.readFile('/tmp/test.txt');\n *\n * // Cleanup\n * await sandbox.destroy();\n * ```\n */\nexport const render = defineCompute<RenderConfig>({\n provider: 'render'\n});\n"],"mappings":";AAQA,SAAS,qBAAyC;AA2C3C,IAAM,SAAS,cAA4B;AAAA,EAChD,UAAU;AACZ,CAAC;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@computesdk/render",
3
- "version": "1.1.18",
3
+ "version": "1.2.0",
4
4
  "description": "Render provider for ComputeSDK - managed cloud containers with automatic scaling",
5
5
  "author": "ComputeSDK Team",
6
6
  "license": "MIT",
@@ -18,8 +18,8 @@
18
18
  "dist"
19
19
  ],
20
20
  "dependencies": {
21
- "@computesdk/provider": "1.0.12",
22
- "computesdk": "1.16.0"
21
+ "@computesdk/provider": "1.0.14",
22
+ "computesdk": "1.18.0"
23
23
  },
24
24
  "keywords": [
25
25
  "computesdk",