the universal sandbox runtime for agents and humans. pocketenv.io
sandbox openclaw agent claude-code vercel-sandbox deno-sandbox cloudflare-sandbox atproto sprites daytona
7
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add sandbox integrations, SSH & Tailscale APIs

+1418 -18
+37
apps/api/lexicons/sandbox/createIntegration.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "io.pocketenv.sandbox.createIntegration", 4 + "defs": { 5 + "main": { 6 + "type": "procedure", 7 + "description": "Create a new integration for the sandbox.", 8 + "input": { 9 + "encoding": "application/json", 10 + "schema": { 11 + "type": "object", 12 + "required": [ 13 + "id", 14 + "name" 15 + ], 16 + "properties": { 17 + "id": { 18 + "type": "string", 19 + "description": "The sandbox ID." 20 + }, 21 + "name": { 22 + "type": "string", 23 + "description": "The name of the integration." 24 + } 25 + } 26 + } 27 + }, 28 + "output": { 29 + "encoding": "application/json", 30 + "schema": { 31 + "type": "ref", 32 + "ref": "io.pocketenv.sandbox.defs#integrationView" 33 + } 34 + } 35 + } 36 + } 37 + }
+86
apps/api/lexicons/sandbox/defs.json
··· 309 309 "#volumePref" 310 310 ] 311 311 } 312 + }, 313 + "sshKeysView": { 314 + "type": "object", 315 + "properties": { 316 + "id": { 317 + "type": "string", 318 + "description": "Unique identifier of the SSH key." 319 + }, 320 + "publicKey": { 321 + "type": "string", 322 + "description": "The public SSH key." 323 + }, 324 + "privateKey": { 325 + "type": "string", 326 + "description": "The private SSH key (redacted in API responses)" 327 + }, 328 + "createdAt": { 329 + "type": "string", 330 + "description": "The timestamp when the SSH key was created.", 331 + "format": "datetime" 332 + }, 333 + "updatedAt": { 334 + "type": "string", 335 + "description": "The timestamp when the SSH key was last updated.", 336 + "format": "datetime" 337 + } 338 + } 339 + }, 340 + "tailscaleTokenView": { 341 + "type": "object", 342 + "properties": { 343 + "id": { 344 + "type": "string", 345 + "description": "Unique identifier of the Tailscale token." 346 + }, 347 + "token": { 348 + "type": "string", 349 + "description": "The Tailscale auth token (redacted in API responses)" 350 + }, 351 + "createdAt": { 352 + "type": "string", 353 + "description": "The timestamp when the Tailscale token was created.", 354 + "format": "datetime" 355 + }, 356 + "updatedAt": { 357 + "type": "string", 358 + "description": "The timestamp when the Tailscale token was last updated.", 359 + "format": "datetime" 360 + } 361 + } 362 + }, 363 + "integrationView": { 364 + "type": "object", 365 + "properties": { 366 + "id": { 367 + "type": "string", 368 + "description": "Unique identifier of the integration." 369 + }, 370 + "name": { 371 + "type": "string", 372 + "description": "The name of the integration, e.g. 'GitHub', 'Slack', 'Trello', etc." 373 + }, 374 + "webhookUrl": { 375 + "type": "string", 376 + "description": "The webhook URL of the integration.", 377 + "format": "uri" 378 + }, 379 + "createdAt": { 380 + "type": "string", 381 + "description": "The timestamp when the integration was created.", 382 + "format": "datetime" 383 + }, 384 + "updatedAt": { 385 + "type": "string", 386 + "description": "The timestamp when the integration was last updated.", 387 + "format": "datetime" 388 + } 389 + } 390 + }, 391 + "integrationsView": { 392 + "type": "array", 393 + "items": { 394 + "type": "ref", 395 + "description": "An integration connected to the sandbox", 396 + "ref": "io.pocketenv.sandbox.defs#integrationView" 397 + } 312 398 } 313 399 } 314 400 }
+29
apps/api/lexicons/sandbox/getIntegrations.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "io.pocketenv.sandbox.getIntegrations", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "Get the integrations for a sandbox.", 8 + "parameters": { 9 + "type": "params", 10 + "required": [ 11 + "id" 12 + ], 13 + "properties": { 14 + "id": { 15 + "type": "string", 16 + "description": "The sandbox ID." 17 + } 18 + } 19 + }, 20 + "output": { 21 + "encoding": "application/json", 22 + "schema": { 23 + "type": "ref", 24 + "ref": "io.pocketenv.sandbox.defs#integrationsView" 25 + } 26 + } 27 + } 28 + } 29 + }
+29
apps/api/lexicons/sandbox/getSshKeys.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "io.pocketenv.sandbox.getSshKeys", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "Get the SSH keys for a sandbox.", 8 + "parameters": { 9 + "type": "params", 10 + "required": [ 11 + "id" 12 + ], 13 + "properties": { 14 + "id": { 15 + "type": "string", 16 + "description": "The sandbox ID." 17 + } 18 + } 19 + }, 20 + "output": { 21 + "encoding": "application/json", 22 + "schema": { 23 + "type": "ref", 24 + "ref": "io.pocketenv.sandbox.defs#sshKeysView" 25 + } 26 + } 27 + } 28 + } 29 + }
+29
apps/api/lexicons/sandbox/getTailscaleToken.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "io.pocketenv.sandbox.getTailscaleToken", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "Get the Tailscale token for a sandbox.", 8 + "parameters": { 9 + "type": "params", 10 + "required": [ 11 + "id" 12 + ], 13 + "properties": { 14 + "id": { 15 + "type": "string", 16 + "description": "The sandbox ID." 17 + } 18 + } 19 + }, 20 + "output": { 21 + "encoding": "application/json", 22 + "schema": { 23 + "type": "ref", 24 + "ref": "io.pocketenv.sandbox.defs#tailscaleTokenView" 25 + } 26 + } 27 + } 28 + } 29 + }
+42
apps/api/lexicons/sandbox/putSshKeys.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "io.pocketenv.sandbox.putSshKeys", 4 + "defs": { 5 + "main": { 6 + "type": "procedure", 7 + "description": "Add or update SSH keys for a sandbox.", 8 + "input": { 9 + "encoding": "application/json", 10 + "schema": { 11 + "type": "object", 12 + "required": [ 13 + "id", 14 + "privateKey", 15 + "publicKey" 16 + ], 17 + "properties": { 18 + "id": { 19 + "type": "string", 20 + "description": "The sandbox ID." 21 + }, 22 + "privateKey": { 23 + "type": "string", 24 + "description": "The private SSH key (encrypted)" 25 + }, 26 + "publicKey": { 27 + "type": "string", 28 + "description": "The public SSH key." 29 + } 30 + } 31 + } 32 + }, 33 + "output": { 34 + "encoding": "application/json", 35 + "schema": { 36 + "type": "ref", 37 + "ref": "io.pocketenv.sandbox.defs#sshKeysView" 38 + } 39 + } 40 + } 41 + } 42 + }
+37
apps/api/lexicons/sandbox/putTailscaleToken.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "io.pocketenv.sandbox.putTailscaleToken", 4 + "defs": { 5 + "main": { 6 + "type": "procedure", 7 + "description": "Store a Tailscale token for the sandbox. This token will be used to authenticate with the Tailscale API and manage the sandbox's Tailscale node.", 8 + "input": { 9 + "encoding": "application/json", 10 + "schema": { 11 + "type": "object", 12 + "required": [ 13 + "id", 14 + "token" 15 + ], 16 + "properties": { 17 + "id": { 18 + "type": "string", 19 + "description": "The sandbox ID." 20 + }, 21 + "token": { 22 + "type": "string", 23 + "description": "The Tailscale token (encrypted) to store for the sandbox." 24 + } 25 + } 26 + } 27 + }, 28 + "output": { 29 + "encoding": "application/json", 30 + "schema": { 31 + "type": "ref", 32 + "ref": "io.pocketenv.sandbox.defs#tailscaleTokenView" 33 + } 34 + } 35 + } 36 + } 37 + }
+34
apps/api/pkl/defs/sandbox/createIntegration.pkl
··· 1 + amends "../../schema/lexicon.pkl" 2 + 3 + lexicon = 1 4 + id = "io.pocketenv.sandbox.createIntegration" 5 + defs = new Mapping<String, Procedure> { 6 + ["main"] { 7 + type = "procedure" 8 + description = "Create a new integration for the sandbox." 9 + input { 10 + encoding = "application/json" 11 + schema { 12 + type = "object" 13 + required = List("id", "name") 14 + properties { 15 + ["id"] = new StringType { 16 + type = "string" 17 + description = "The sandbox ID." 18 + } 19 + ["name"] = new StringType { 20 + type = "string" 21 + description = "The name of the integration." 22 + } 23 + } 24 + } 25 + } 26 + output { 27 + encoding = "application/json" 28 + schema = new Ref { 29 + type = "ref" 30 + ref = "io.pocketenv.sandbox.defs#integrationView" 31 + } 32 + } 33 + } 34 + }
+87
apps/api/pkl/defs/sandbox/defs.pkl
··· 316 316 ) 317 317 } 318 318 } 319 + ["sshKeysView"] = new ObjectType { 320 + type = "object" 321 + properties { 322 + ["id"] = new StringType { 323 + type = "string" 324 + description = "Unique identifier of the SSH key." 325 + } 326 + ["publicKey"] = new StringType { 327 + type = "string" 328 + description = "The public SSH key." 329 + } 330 + ["privateKey"] = new StringType { 331 + type = "string" 332 + description = "The private SSH key (redacted in API responses)" 333 + } 334 + ["createdAt"] = new StringType { 335 + type = "string" 336 + description = "The timestamp when the SSH key was created." 337 + format = "datetime" 338 + } 339 + ["updatedAt"] = new StringType { 340 + type = "string" 341 + description = "The timestamp when the SSH key was last updated." 342 + format = "datetime" 343 + } 344 + } 345 + } 346 + ["tailscaleTokenView"] = new ObjectType { 347 + type = "object" 348 + properties { 349 + ["id"] = new StringType { 350 + type = "string" 351 + description = "Unique identifier of the Tailscale token." 352 + } 353 + ["token"] = new StringType { 354 + type = "string" 355 + description = "The Tailscale auth token (redacted in API responses)" 356 + } 357 + ["createdAt"] = new StringType { 358 + type = "string" 359 + description = "The timestamp when the Tailscale token was created." 360 + format = "datetime" 361 + } 362 + ["updatedAt"] = new StringType { 363 + type = "string" 364 + description = "The timestamp when the Tailscale token was last updated." 365 + format = "datetime" 366 + } 367 + } 368 + } 369 + ["integrationView"] = new ObjectType { 370 + type = "object" 371 + properties { 372 + ["id"] = new StringType { 373 + type = "string" 374 + description = "Unique identifier of the integration." 375 + } 376 + ["name"] = new StringType { 377 + type = "string" 378 + description = "The name of the integration, e.g. 'GitHub', 'Slack', 'Trello', etc." 379 + } 380 + ["webhookUrl"] = new StringType { 381 + type = "string" 382 + description = "The webhook URL of the integration." 383 + format = "uri" 384 + } 385 + ["createdAt"] = new StringType { 386 + type = "string" 387 + description = "The timestamp when the integration was created." 388 + format = "datetime" 389 + } 390 + ["updatedAt"] = new StringType { 391 + type = "string" 392 + description = "The timestamp when the integration was last updated." 393 + format = "datetime" 394 + } 395 + } 396 + } 397 + ["integrationsView"] = new Array { 398 + type = "array" 399 + items = new Ref { 400 + type = "ref" 401 + ref = "io.pocketenv.sandbox.defs#integrationView" 402 + description = "An integration connected to the sandbox" 403 + } 404 + } 319 405 } 406 +
+27
apps/api/pkl/defs/sandbox/getIntegrations.pkl
··· 1 + amends "../../schema/lexicon.pkl" 2 + 3 + lexicon = 1 4 + id = "io.pocketenv.sandbox.getIntegrations" 5 + defs = new Mapping<String, Query> { 6 + ["main"] { 7 + type = "query" 8 + description = "Get the integrations for a sandbox." 9 + parameters { 10 + type = "params" 11 + required = List("id") 12 + properties { 13 + ["id"] = new StringType { 14 + type = "string" 15 + description = "The sandbox ID." 16 + } 17 + } 18 + } 19 + output { 20 + encoding = "application/json" 21 + schema = new Ref { 22 + type = "ref" 23 + ref = "io.pocketenv.sandbox.defs#integrationsView" 24 + } 25 + } 26 + } 27 + }
+27
apps/api/pkl/defs/sandbox/getSshKeys.pkl
··· 1 + amends "../../schema/lexicon.pkl" 2 + 3 + lexicon = 1 4 + id = "io.pocketenv.sandbox.getSshKeys" 5 + defs = new Mapping<String, Query> { 6 + ["main"] { 7 + type = "query" 8 + description = "Get the SSH keys for a sandbox." 9 + parameters { 10 + type = "params" 11 + required = List("id") 12 + properties { 13 + ["id"] = new StringType { 14 + type = "string" 15 + description = "The sandbox ID." 16 + } 17 + } 18 + } 19 + output { 20 + encoding = "application/json" 21 + schema = new Ref { 22 + type = "ref" 23 + ref = "io.pocketenv.sandbox.defs#sshKeysView" 24 + } 25 + } 26 + } 27 + }
+27
apps/api/pkl/defs/sandbox/getTailscaleToken.pkl
··· 1 + amends "../../schema/lexicon.pkl" 2 + 3 + lexicon = 1 4 + id = "io.pocketenv.sandbox.getTailscaleToken" 5 + defs = new Mapping<String, Query> { 6 + ["main"] { 7 + type = "query" 8 + description = "Get the Tailscale token for a sandbox." 9 + parameters { 10 + type = "params" 11 + required = List("id") 12 + properties { 13 + ["id"] = new StringType { 14 + type = "string" 15 + description = "The sandbox ID." 16 + } 17 + } 18 + } 19 + output { 20 + encoding = "application/json" 21 + schema = new Ref { 22 + type = "ref" 23 + ref = "io.pocketenv.sandbox.defs#tailscaleTokenView" 24 + } 25 + } 26 + } 27 + }
+38
apps/api/pkl/defs/sandbox/putSshKeys.pkl
··· 1 + amends "../../schema/lexicon.pkl" 2 + 3 + lexicon = 1 4 + id = "io.pocketenv.sandbox.putSshKeys" 5 + defs = new Mapping<String, Procedure> { 6 + ["main"] { 7 + type = "procedure" 8 + description = "Add or update SSH keys for a sandbox." 9 + input { 10 + encoding = "application/json" 11 + schema = new ObjectType { 12 + type = "object" 13 + required = List("id", "privateKey", "publicKey") 14 + properties { 15 + ["id"] = new StringType { 16 + type = "string" 17 + description = "The sandbox ID." 18 + } 19 + ["privateKey"] = new StringType { 20 + type = "string" 21 + description = "The private SSH key (encrypted)" 22 + } 23 + ["publicKey"] = new StringType { 24 + type = "string" 25 + description = "The public SSH key." 26 + } 27 + } 28 + } 29 + } 30 + output { 31 + encoding = "application/json" 32 + schema = new Ref { 33 + type = "ref" 34 + ref = "io.pocketenv.sandbox.defs#sshKeysView" 35 + } 36 + } 37 + } 38 + }
+34
apps/api/pkl/defs/sandbox/putTailscaleToken.pkl
··· 1 + amends "../../schema/lexicon.pkl" 2 + 3 + lexicon = 1 4 + id = "io.pocketenv.sandbox.putTailscaleToken" 5 + defs = new Mapping<String, Procedure> { 6 + ["main"] { 7 + type = "procedure" 8 + description = "Store a Tailscale token for the sandbox. This token will be used to authenticate with the Tailscale API and manage the sandbox's Tailscale node." 9 + input { 10 + encoding = "application/json" 11 + schema = new ObjectType { 12 + type = "object" 13 + required = List("id", "token") 14 + properties { 15 + ["id"] = new StringType { 16 + type = "string" 17 + description = "The sandbox ID." 18 + } 19 + ["token"] = new StringType { 20 + type = "string" 21 + description = "The Tailscale token (encrypted) to store for the sandbox." 22 + } 23 + } 24 + } 25 + } 26 + output { 27 + encoding = "application/json" 28 + schema = new Ref { 29 + type = "ref" 30 + ref = "io.pocketenv.sandbox.defs#tailscaleTokenView" 31 + } 32 + } 33 + } 34 + }
+72
apps/api/src/lexicon/index.ts
··· 16 16 import type * as IoPocketenvFileDeleteFile from "./types/io/pocketenv/file/deleteFile"; 17 17 import type * as IoPocketenvFileGetFiles from "./types/io/pocketenv/file/getFiles"; 18 18 import type * as IoPocketenvSandboxClaimSandbox from "./types/io/pocketenv/sandbox/claimSandbox"; 19 + import type * as IoPocketenvSandboxCreateIntegration from "./types/io/pocketenv/sandbox/createIntegration"; 19 20 import type * as IoPocketenvSandboxCreateSandbox from "./types/io/pocketenv/sandbox/createSandbox"; 20 21 import type * as IoPocketenvSandboxDeleteSandbox from "./types/io/pocketenv/sandbox/deleteSandbox"; 22 + import type * as IoPocketenvSandboxGetIntegrations from "./types/io/pocketenv/sandbox/getIntegrations"; 21 23 import type * as IoPocketenvSandboxGetPreferences from "./types/io/pocketenv/sandbox/getPreferences"; 22 24 import type * as IoPocketenvSandboxGetSandbox from "./types/io/pocketenv/sandbox/getSandbox"; 23 25 import type * as IoPocketenvSandboxGetSandboxes from "./types/io/pocketenv/sandbox/getSandboxes"; 26 + import type * as IoPocketenvSandboxGetSshKeys from "./types/io/pocketenv/sandbox/getSshKeys"; 27 + import type * as IoPocketenvSandboxGetTailscaleToken from "./types/io/pocketenv/sandbox/getTailscaleToken"; 24 28 import type * as IoPocketenvSandboxPutPreferences from "./types/io/pocketenv/sandbox/putPreferences"; 29 + import type * as IoPocketenvSandboxPutSshKeys from "./types/io/pocketenv/sandbox/putSshKeys"; 30 + import type * as IoPocketenvSandboxPutTailscaleToken from "./types/io/pocketenv/sandbox/putTailscaleToken"; 25 31 import type * as IoPocketenvSandboxStartSandbox from "./types/io/pocketenv/sandbox/startSandbox"; 26 32 import type * as IoPocketenvSandboxStopSandbox from "./types/io/pocketenv/sandbox/stopSandbox"; 27 33 import type * as IoPocketenvSandboxUpdateSandboxSettings from "./types/io/pocketenv/sandbox/updateSandboxSettings"; ··· 183 189 return this._server.xrpc.method(nsid, cfg); 184 190 } 185 191 192 + createIntegration<AV extends AuthVerifier>( 193 + cfg: ConfigOf< 194 + AV, 195 + IoPocketenvSandboxCreateIntegration.Handler<ExtractAuth<AV>>, 196 + IoPocketenvSandboxCreateIntegration.HandlerReqCtx<ExtractAuth<AV>> 197 + >, 198 + ) { 199 + const nsid = "io.pocketenv.sandbox.createIntegration"; // @ts-ignore 200 + return this._server.xrpc.method(nsid, cfg); 201 + } 202 + 186 203 createSandbox<AV extends AuthVerifier>( 187 204 cfg: ConfigOf< 188 205 AV, ··· 205 222 return this._server.xrpc.method(nsid, cfg); 206 223 } 207 224 225 + getIntegrations<AV extends AuthVerifier>( 226 + cfg: ConfigOf< 227 + AV, 228 + IoPocketenvSandboxGetIntegrations.Handler<ExtractAuth<AV>>, 229 + IoPocketenvSandboxGetIntegrations.HandlerReqCtx<ExtractAuth<AV>> 230 + >, 231 + ) { 232 + const nsid = "io.pocketenv.sandbox.getIntegrations"; // @ts-ignore 233 + return this._server.xrpc.method(nsid, cfg); 234 + } 235 + 208 236 getPreferences<AV extends AuthVerifier>( 209 237 cfg: ConfigOf< 210 238 AV, ··· 238 266 return this._server.xrpc.method(nsid, cfg); 239 267 } 240 268 269 + getSshKeys<AV extends AuthVerifier>( 270 + cfg: ConfigOf< 271 + AV, 272 + IoPocketenvSandboxGetSshKeys.Handler<ExtractAuth<AV>>, 273 + IoPocketenvSandboxGetSshKeys.HandlerReqCtx<ExtractAuth<AV>> 274 + >, 275 + ) { 276 + const nsid = "io.pocketenv.sandbox.getSshKeys"; // @ts-ignore 277 + return this._server.xrpc.method(nsid, cfg); 278 + } 279 + 280 + getTailscaleToken<AV extends AuthVerifier>( 281 + cfg: ConfigOf< 282 + AV, 283 + IoPocketenvSandboxGetTailscaleToken.Handler<ExtractAuth<AV>>, 284 + IoPocketenvSandboxGetTailscaleToken.HandlerReqCtx<ExtractAuth<AV>> 285 + >, 286 + ) { 287 + const nsid = "io.pocketenv.sandbox.getTailscaleToken"; // @ts-ignore 288 + return this._server.xrpc.method(nsid, cfg); 289 + } 290 + 241 291 putPreferences<AV extends AuthVerifier>( 242 292 cfg: ConfigOf< 243 293 AV, ··· 246 296 >, 247 297 ) { 248 298 const nsid = "io.pocketenv.sandbox.putPreferences"; // @ts-ignore 299 + return this._server.xrpc.method(nsid, cfg); 300 + } 301 + 302 + putSshKeys<AV extends AuthVerifier>( 303 + cfg: ConfigOf< 304 + AV, 305 + IoPocketenvSandboxPutSshKeys.Handler<ExtractAuth<AV>>, 306 + IoPocketenvSandboxPutSshKeys.HandlerReqCtx<ExtractAuth<AV>> 307 + >, 308 + ) { 309 + const nsid = "io.pocketenv.sandbox.putSshKeys"; // @ts-ignore 310 + return this._server.xrpc.method(nsid, cfg); 311 + } 312 + 313 + putTailscaleToken<AV extends AuthVerifier>( 314 + cfg: ConfigOf< 315 + AV, 316 + IoPocketenvSandboxPutTailscaleToken.Handler<ExtractAuth<AV>>, 317 + IoPocketenvSandboxPutTailscaleToken.HandlerReqCtx<ExtractAuth<AV>> 318 + >, 319 + ) { 320 + const nsid = "io.pocketenv.sandbox.putTailscaleToken"; // @ts-ignore 249 321 return this._server.xrpc.method(nsid, cfg); 250 322 } 251 323
+283
apps/api/src/lexicon/lexicons.ts
··· 383 383 }, 384 384 }, 385 385 }, 386 + IoPocketenvSandboxCreateIntegration: { 387 + lexicon: 1, 388 + id: "io.pocketenv.sandbox.createIntegration", 389 + defs: { 390 + main: { 391 + type: "procedure", 392 + description: "Create a new integration for the sandbox.", 393 + input: { 394 + encoding: "application/json", 395 + schema: { 396 + type: "object", 397 + required: ["id", "name"], 398 + properties: { 399 + id: { 400 + type: "string", 401 + description: "The sandbox ID.", 402 + }, 403 + name: { 404 + type: "string", 405 + description: "The name of the integration.", 406 + }, 407 + }, 408 + }, 409 + }, 410 + output: { 411 + encoding: "application/json", 412 + schema: { 413 + type: "ref", 414 + ref: "lex:io.pocketenv.sandbox.defs#integrationView", 415 + }, 416 + }, 417 + }, 418 + }, 419 + }, 386 420 IoPocketenvSandboxCreateSandbox: { 387 421 lexicon: 1, 388 422 id: "io.pocketenv.sandbox.createSandbox", ··· 807 841 ], 808 842 }, 809 843 }, 844 + sshKeysView: { 845 + type: "object", 846 + properties: { 847 + id: { 848 + type: "string", 849 + description: "Unique identifier of the SSH key.", 850 + }, 851 + publicKey: { 852 + type: "string", 853 + description: "The public SSH key.", 854 + }, 855 + privateKey: { 856 + type: "string", 857 + description: "The private SSH key (redacted in API responses)", 858 + }, 859 + createdAt: { 860 + type: "string", 861 + description: "The timestamp when the SSH key was created.", 862 + format: "datetime", 863 + }, 864 + updatedAt: { 865 + type: "string", 866 + description: "The timestamp when the SSH key was last updated.", 867 + format: "datetime", 868 + }, 869 + }, 870 + }, 871 + tailscaleTokenView: { 872 + type: "object", 873 + properties: { 874 + id: { 875 + type: "string", 876 + description: "Unique identifier of the Tailscale token.", 877 + }, 878 + token: { 879 + type: "string", 880 + description: "The Tailscale auth token (redacted in API responses)", 881 + }, 882 + createdAt: { 883 + type: "string", 884 + description: "The timestamp when the Tailscale token was created.", 885 + format: "datetime", 886 + }, 887 + updatedAt: { 888 + type: "string", 889 + description: 890 + "The timestamp when the Tailscale token was last updated.", 891 + format: "datetime", 892 + }, 893 + }, 894 + }, 895 + integrationView: { 896 + type: "object", 897 + properties: { 898 + id: { 899 + type: "string", 900 + description: "Unique identifier of the integration.", 901 + }, 902 + name: { 903 + type: "string", 904 + description: 905 + "The name of the integration, e.g. 'GitHub', 'Slack', 'Trello', etc.", 906 + }, 907 + webhookUrl: { 908 + type: "string", 909 + description: "The webhook URL of the integration.", 910 + format: "uri", 911 + }, 912 + createdAt: { 913 + type: "string", 914 + description: "The timestamp when the integration was created.", 915 + format: "datetime", 916 + }, 917 + updatedAt: { 918 + type: "string", 919 + description: "The timestamp when the integration was last updated.", 920 + format: "datetime", 921 + }, 922 + }, 923 + }, 924 + integrationsView: { 925 + type: "array", 926 + items: { 927 + type: "ref", 928 + description: "An integration connected to the sandbox", 929 + ref: "lex:io.pocketenv.sandbox.defs#integrationView", 930 + }, 931 + }, 810 932 }, 811 933 }, 812 934 IoPocketenvSandboxDeleteSandbox: { ··· 836 958 }, 837 959 }, 838 960 }, 961 + IoPocketenvSandboxGetIntegrations: { 962 + lexicon: 1, 963 + id: "io.pocketenv.sandbox.getIntegrations", 964 + defs: { 965 + main: { 966 + type: "query", 967 + description: "Get the integrations for a sandbox.", 968 + parameters: { 969 + type: "params", 970 + required: ["id"], 971 + properties: { 972 + id: { 973 + type: "string", 974 + description: "The sandbox ID.", 975 + }, 976 + }, 977 + }, 978 + output: { 979 + encoding: "application/json", 980 + schema: { 981 + type: "ref", 982 + ref: "lex:io.pocketenv.sandbox.defs#integrationsView", 983 + }, 984 + }, 985 + }, 986 + }, 987 + }, 839 988 IoPocketenvSandboxGetPreferences: { 840 989 lexicon: 1, 841 990 id: "io.pocketenv.sandbox.getPreferences", ··· 936 1085 }, 937 1086 }, 938 1087 }, 1088 + IoPocketenvSandboxGetSshKeys: { 1089 + lexicon: 1, 1090 + id: "io.pocketenv.sandbox.getSshKeys", 1091 + defs: { 1092 + main: { 1093 + type: "query", 1094 + description: "Get the SSH keys for a sandbox.", 1095 + parameters: { 1096 + type: "params", 1097 + required: ["id"], 1098 + properties: { 1099 + id: { 1100 + type: "string", 1101 + description: "The sandbox ID.", 1102 + }, 1103 + }, 1104 + }, 1105 + output: { 1106 + encoding: "application/json", 1107 + schema: { 1108 + type: "ref", 1109 + ref: "lex:io.pocketenv.sandbox.defs#sshKeysView", 1110 + }, 1111 + }, 1112 + }, 1113 + }, 1114 + }, 1115 + IoPocketenvSandboxGetTailscaleToken: { 1116 + lexicon: 1, 1117 + id: "io.pocketenv.sandbox.getTailscaleToken", 1118 + defs: { 1119 + main: { 1120 + type: "query", 1121 + description: "Get the Tailscale token for a sandbox.", 1122 + parameters: { 1123 + type: "params", 1124 + required: ["id"], 1125 + properties: { 1126 + id: { 1127 + type: "string", 1128 + description: "The sandbox ID.", 1129 + }, 1130 + }, 1131 + }, 1132 + output: { 1133 + encoding: "application/json", 1134 + schema: { 1135 + type: "ref", 1136 + ref: "lex:io.pocketenv.sandbox.defs#tailscaleTokenView", 1137 + }, 1138 + }, 1139 + }, 1140 + }, 1141 + }, 939 1142 IoPocketenvSandboxPutPreferences: { 940 1143 lexicon: 1, 941 1144 id: "io.pocketenv.sandbox.putPreferences", ··· 954 1157 ref: "lex:io.pocketenv.sandbox.defs#preferences", 955 1158 }, 956 1159 }, 1160 + }, 1161 + }, 1162 + }, 1163 + }, 1164 + }, 1165 + IoPocketenvSandboxPutSshKeys: { 1166 + lexicon: 1, 1167 + id: "io.pocketenv.sandbox.putSshKeys", 1168 + defs: { 1169 + main: { 1170 + type: "procedure", 1171 + description: "Add or update SSH keys for a sandbox.", 1172 + input: { 1173 + encoding: "application/json", 1174 + schema: { 1175 + type: "object", 1176 + required: ["id", "privateKey", "publicKey"], 1177 + properties: { 1178 + id: { 1179 + type: "string", 1180 + description: "The sandbox ID.", 1181 + }, 1182 + privateKey: { 1183 + type: "string", 1184 + description: "The private SSH key (encrypted)", 1185 + }, 1186 + publicKey: { 1187 + type: "string", 1188 + description: "The public SSH key.", 1189 + }, 1190 + }, 1191 + }, 1192 + }, 1193 + output: { 1194 + encoding: "application/json", 1195 + schema: { 1196 + type: "ref", 1197 + ref: "lex:io.pocketenv.sandbox.defs#sshKeysView", 1198 + }, 1199 + }, 1200 + }, 1201 + }, 1202 + }, 1203 + IoPocketenvSandboxPutTailscaleToken: { 1204 + lexicon: 1, 1205 + id: "io.pocketenv.sandbox.putTailscaleToken", 1206 + defs: { 1207 + main: { 1208 + type: "procedure", 1209 + description: 1210 + "Store a Tailscale token for the sandbox. This token will be used to authenticate with the Tailscale API and manage the sandbox's Tailscale node.", 1211 + input: { 1212 + encoding: "application/json", 1213 + schema: { 1214 + type: "object", 1215 + required: ["id", "token"], 1216 + properties: { 1217 + id: { 1218 + type: "string", 1219 + description: "The sandbox ID.", 1220 + }, 1221 + token: { 1222 + type: "string", 1223 + description: 1224 + "The Tailscale token (encrypted) to store for the sandbox.", 1225 + }, 1226 + }, 1227 + }, 1228 + }, 1229 + output: { 1230 + encoding: "application/json", 1231 + schema: { 1232 + type: "ref", 1233 + ref: "lex:io.pocketenv.sandbox.defs#tailscaleTokenView", 957 1234 }, 958 1235 }, 959 1236 }, ··· 1737 2014 IoPocketenvFileDeleteFile: "io.pocketenv.file.deleteFile", 1738 2015 IoPocketenvFileGetFiles: "io.pocketenv.file.getFiles", 1739 2016 IoPocketenvSandboxClaimSandbox: "io.pocketenv.sandbox.claimSandbox", 2017 + IoPocketenvSandboxCreateIntegration: "io.pocketenv.sandbox.createIntegration", 1740 2018 IoPocketenvSandboxCreateSandbox: "io.pocketenv.sandbox.createSandbox", 1741 2019 IoPocketenvSandboxDefs: "io.pocketenv.sandbox.defs", 1742 2020 IoPocketenvSandboxDeleteSandbox: "io.pocketenv.sandbox.deleteSandbox", 2021 + IoPocketenvSandboxGetIntegrations: "io.pocketenv.sandbox.getIntegrations", 1743 2022 IoPocketenvSandboxGetPreferences: "io.pocketenv.sandbox.getPreferences", 1744 2023 IoPocketenvSandboxGetSandbox: "io.pocketenv.sandbox.getSandbox", 1745 2024 IoPocketenvSandboxGetSandboxes: "io.pocketenv.sandbox.getSandboxes", 2025 + IoPocketenvSandboxGetSshKeys: "io.pocketenv.sandbox.getSshKeys", 2026 + IoPocketenvSandboxGetTailscaleToken: "io.pocketenv.sandbox.getTailscaleToken", 1746 2027 IoPocketenvSandboxPutPreferences: "io.pocketenv.sandbox.putPreferences", 2028 + IoPocketenvSandboxPutSshKeys: "io.pocketenv.sandbox.putSshKeys", 2029 + IoPocketenvSandboxPutTailscaleToken: "io.pocketenv.sandbox.putTailscaleToken", 1747 2030 IoPocketenvSandbox: "io.pocketenv.sandbox", 1748 2031 IoPocketenvSandboxStartSandbox: "io.pocketenv.sandbox.startSandbox", 1749 2032 IoPocketenvSandboxStopSandbox: "io.pocketenv.sandbox.stopSandbox",
+51
apps/api/src/lexicon/types/io/pocketenv/sandbox/createIntegration.ts
··· 1 + /** 2 + * GENERATED CODE - DO NOT MODIFY 3 + */ 4 + import type express from "express"; 5 + import { ValidationResult, BlobRef } from "@atproto/lexicon"; 6 + import { lexicons } from "../../../../lexicons"; 7 + import { isObj, hasProp } from "../../../../util"; 8 + import { CID } from "multiformats/cid"; 9 + import type { HandlerAuth, HandlerPipeThrough } from "@atproto/xrpc-server"; 10 + import type * as IoPocketenvSandboxDefs from "./defs"; 11 + 12 + export type QueryParams = {}; 13 + 14 + export interface InputSchema { 15 + /** The sandbox ID. */ 16 + id: string; 17 + /** The name of the integration. */ 18 + name: string; 19 + [k: string]: unknown; 20 + } 21 + 22 + export type OutputSchema = IoPocketenvSandboxDefs.IntegrationView; 23 + 24 + export interface HandlerInput { 25 + encoding: "application/json"; 26 + body: InputSchema; 27 + } 28 + 29 + export interface HandlerSuccess { 30 + encoding: "application/json"; 31 + body: OutputSchema; 32 + headers?: { [key: string]: string }; 33 + } 34 + 35 + export interface HandlerError { 36 + status: number; 37 + message?: string; 38 + } 39 + 40 + export type HandlerOutput = HandlerError | HandlerSuccess | HandlerPipeThrough; 41 + export type HandlerReqCtx<HA extends HandlerAuth = never> = { 42 + auth: HA; 43 + params: QueryParams; 44 + input: HandlerInput; 45 + req: express.Request; 46 + res: express.Response; 47 + resetRouteRateLimits: () => Promise<void>; 48 + }; 49 + export type Handler<HA extends HandlerAuth = never> = ( 50 + ctx: HandlerReqCtx<HA>, 51 + ) => Promise<HandlerOutput> | HandlerOutput;
+78
apps/api/src/lexicon/types/io/pocketenv/sandbox/defs.ts
··· 224 224 | VolumePref 225 225 | { $type: string; [k: string]: unknown } 226 226 )[]; 227 + 228 + export interface SshKeysView { 229 + /** Unique identifier of the SSH key. */ 230 + id?: string; 231 + /** The public SSH key. */ 232 + publicKey?: string; 233 + /** The private SSH key (redacted in API responses) */ 234 + privateKey?: string; 235 + /** The timestamp when the SSH key was created. */ 236 + createdAt?: string; 237 + /** The timestamp when the SSH key was last updated. */ 238 + updatedAt?: string; 239 + [k: string]: unknown; 240 + } 241 + 242 + export function isSshKeysView(v: unknown): v is SshKeysView { 243 + return ( 244 + isObj(v) && 245 + hasProp(v, "$type") && 246 + v.$type === "io.pocketenv.sandbox.defs#sshKeysView" 247 + ); 248 + } 249 + 250 + export function validateSshKeysView(v: unknown): ValidationResult { 251 + return lexicons.validate("io.pocketenv.sandbox.defs#sshKeysView", v); 252 + } 253 + 254 + export interface TailscaleTokenView { 255 + /** Unique identifier of the Tailscale token. */ 256 + id?: string; 257 + /** The Tailscale auth token (redacted in API responses) */ 258 + token?: string; 259 + /** The timestamp when the Tailscale token was created. */ 260 + createdAt?: string; 261 + /** The timestamp when the Tailscale token was last updated. */ 262 + updatedAt?: string; 263 + [k: string]: unknown; 264 + } 265 + 266 + export function isTailscaleTokenView(v: unknown): v is TailscaleTokenView { 267 + return ( 268 + isObj(v) && 269 + hasProp(v, "$type") && 270 + v.$type === "io.pocketenv.sandbox.defs#tailscaleTokenView" 271 + ); 272 + } 273 + 274 + export function validateTailscaleTokenView(v: unknown): ValidationResult { 275 + return lexicons.validate("io.pocketenv.sandbox.defs#tailscaleTokenView", v); 276 + } 277 + 278 + export interface IntegrationView { 279 + /** Unique identifier of the integration. */ 280 + id?: string; 281 + /** The name of the integration, e.g. 'GitHub', 'Slack', 'Trello', etc. */ 282 + name?: string; 283 + /** The webhook URL of the integration. */ 284 + webhookUrl?: string; 285 + /** The timestamp when the integration was created. */ 286 + createdAt?: string; 287 + /** The timestamp when the integration was last updated. */ 288 + updatedAt?: string; 289 + [k: string]: unknown; 290 + } 291 + 292 + export function isIntegrationView(v: unknown): v is IntegrationView { 293 + return ( 294 + isObj(v) && 295 + hasProp(v, "$type") && 296 + v.$type === "io.pocketenv.sandbox.defs#integrationView" 297 + ); 298 + } 299 + 300 + export function validateIntegrationView(v: unknown): ValidationResult { 301 + return lexicons.validate("io.pocketenv.sandbox.defs#integrationView", v); 302 + } 303 + 304 + export type IntegrationsView = IntegrationView[];
+43
apps/api/src/lexicon/types/io/pocketenv/sandbox/getIntegrations.ts
··· 1 + /** 2 + * GENERATED CODE - DO NOT MODIFY 3 + */ 4 + import type express from "express"; 5 + import { ValidationResult, BlobRef } from "@atproto/lexicon"; 6 + import { lexicons } from "../../../../lexicons"; 7 + import { isObj, hasProp } from "../../../../util"; 8 + import { CID } from "multiformats/cid"; 9 + import type { HandlerAuth, HandlerPipeThrough } from "@atproto/xrpc-server"; 10 + import type * as IoPocketenvSandboxDefs from "./defs"; 11 + 12 + export interface QueryParams { 13 + /** The sandbox ID. */ 14 + id: string; 15 + } 16 + 17 + export type InputSchema = undefined; 18 + export type OutputSchema = IoPocketenvSandboxDefs.IntegrationsView; 19 + export type HandlerInput = undefined; 20 + 21 + export interface HandlerSuccess { 22 + encoding: "application/json"; 23 + body: OutputSchema; 24 + headers?: { [key: string]: string }; 25 + } 26 + 27 + export interface HandlerError { 28 + status: number; 29 + message?: string; 30 + } 31 + 32 + export type HandlerOutput = HandlerError | HandlerSuccess | HandlerPipeThrough; 33 + export type HandlerReqCtx<HA extends HandlerAuth = never> = { 34 + auth: HA; 35 + params: QueryParams; 36 + input: HandlerInput; 37 + req: express.Request; 38 + res: express.Response; 39 + resetRouteRateLimits: () => Promise<void>; 40 + }; 41 + export type Handler<HA extends HandlerAuth = never> = ( 42 + ctx: HandlerReqCtx<HA>, 43 + ) => Promise<HandlerOutput> | HandlerOutput;
+43
apps/api/src/lexicon/types/io/pocketenv/sandbox/getSshKeys.ts
··· 1 + /** 2 + * GENERATED CODE - DO NOT MODIFY 3 + */ 4 + import type express from "express"; 5 + import { ValidationResult, BlobRef } from "@atproto/lexicon"; 6 + import { lexicons } from "../../../../lexicons"; 7 + import { isObj, hasProp } from "../../../../util"; 8 + import { CID } from "multiformats/cid"; 9 + import type { HandlerAuth, HandlerPipeThrough } from "@atproto/xrpc-server"; 10 + import type * as IoPocketenvSandboxDefs from "./defs"; 11 + 12 + export interface QueryParams { 13 + /** The sandbox ID. */ 14 + id: string; 15 + } 16 + 17 + export type InputSchema = undefined; 18 + export type OutputSchema = IoPocketenvSandboxDefs.SshKeysView; 19 + export type HandlerInput = undefined; 20 + 21 + export interface HandlerSuccess { 22 + encoding: "application/json"; 23 + body: OutputSchema; 24 + headers?: { [key: string]: string }; 25 + } 26 + 27 + export interface HandlerError { 28 + status: number; 29 + message?: string; 30 + } 31 + 32 + export type HandlerOutput = HandlerError | HandlerSuccess | HandlerPipeThrough; 33 + export type HandlerReqCtx<HA extends HandlerAuth = never> = { 34 + auth: HA; 35 + params: QueryParams; 36 + input: HandlerInput; 37 + req: express.Request; 38 + res: express.Response; 39 + resetRouteRateLimits: () => Promise<void>; 40 + }; 41 + export type Handler<HA extends HandlerAuth = never> = ( 42 + ctx: HandlerReqCtx<HA>, 43 + ) => Promise<HandlerOutput> | HandlerOutput;
+43
apps/api/src/lexicon/types/io/pocketenv/sandbox/getTailscaleToken.ts
··· 1 + /** 2 + * GENERATED CODE - DO NOT MODIFY 3 + */ 4 + import type express from "express"; 5 + import { ValidationResult, BlobRef } from "@atproto/lexicon"; 6 + import { lexicons } from "../../../../lexicons"; 7 + import { isObj, hasProp } from "../../../../util"; 8 + import { CID } from "multiformats/cid"; 9 + import type { HandlerAuth, HandlerPipeThrough } from "@atproto/xrpc-server"; 10 + import type * as IoPocketenvSandboxDefs from "./defs"; 11 + 12 + export interface QueryParams { 13 + /** The sandbox ID. */ 14 + id: string; 15 + } 16 + 17 + export type InputSchema = undefined; 18 + export type OutputSchema = IoPocketenvSandboxDefs.TailscaleTokenView; 19 + export type HandlerInput = undefined; 20 + 21 + export interface HandlerSuccess { 22 + encoding: "application/json"; 23 + body: OutputSchema; 24 + headers?: { [key: string]: string }; 25 + } 26 + 27 + export interface HandlerError { 28 + status: number; 29 + message?: string; 30 + } 31 + 32 + export type HandlerOutput = HandlerError | HandlerSuccess | HandlerPipeThrough; 33 + export type HandlerReqCtx<HA extends HandlerAuth = never> = { 34 + auth: HA; 35 + params: QueryParams; 36 + input: HandlerInput; 37 + req: express.Request; 38 + res: express.Response; 39 + resetRouteRateLimits: () => Promise<void>; 40 + }; 41 + export type Handler<HA extends HandlerAuth = never> = ( 42 + ctx: HandlerReqCtx<HA>, 43 + ) => Promise<HandlerOutput> | HandlerOutput;
+53
apps/api/src/lexicon/types/io/pocketenv/sandbox/putSshKeys.ts
··· 1 + /** 2 + * GENERATED CODE - DO NOT MODIFY 3 + */ 4 + import type express from "express"; 5 + import { ValidationResult, BlobRef } from "@atproto/lexicon"; 6 + import { lexicons } from "../../../../lexicons"; 7 + import { isObj, hasProp } from "../../../../util"; 8 + import { CID } from "multiformats/cid"; 9 + import type { HandlerAuth, HandlerPipeThrough } from "@atproto/xrpc-server"; 10 + import type * as IoPocketenvSandboxDefs from "./defs"; 11 + 12 + export type QueryParams = {}; 13 + 14 + export interface InputSchema { 15 + /** The sandbox ID. */ 16 + id: string; 17 + /** The private SSH key (encrypted) */ 18 + privateKey: string; 19 + /** The public SSH key. */ 20 + publicKey: string; 21 + [k: string]: unknown; 22 + } 23 + 24 + export type OutputSchema = IoPocketenvSandboxDefs.SshKeysView; 25 + 26 + export interface HandlerInput { 27 + encoding: "application/json"; 28 + body: InputSchema; 29 + } 30 + 31 + export interface HandlerSuccess { 32 + encoding: "application/json"; 33 + body: OutputSchema; 34 + headers?: { [key: string]: string }; 35 + } 36 + 37 + export interface HandlerError { 38 + status: number; 39 + message?: string; 40 + } 41 + 42 + export type HandlerOutput = HandlerError | HandlerSuccess | HandlerPipeThrough; 43 + export type HandlerReqCtx<HA extends HandlerAuth = never> = { 44 + auth: HA; 45 + params: QueryParams; 46 + input: HandlerInput; 47 + req: express.Request; 48 + res: express.Response; 49 + resetRouteRateLimits: () => Promise<void>; 50 + }; 51 + export type Handler<HA extends HandlerAuth = never> = ( 52 + ctx: HandlerReqCtx<HA>, 53 + ) => Promise<HandlerOutput> | HandlerOutput;
+51
apps/api/src/lexicon/types/io/pocketenv/sandbox/putTailscaleToken.ts
··· 1 + /** 2 + * GENERATED CODE - DO NOT MODIFY 3 + */ 4 + import type express from "express"; 5 + import { ValidationResult, BlobRef } from "@atproto/lexicon"; 6 + import { lexicons } from "../../../../lexicons"; 7 + import { isObj, hasProp } from "../../../../util"; 8 + import { CID } from "multiformats/cid"; 9 + import type { HandlerAuth, HandlerPipeThrough } from "@atproto/xrpc-server"; 10 + import type * as IoPocketenvSandboxDefs from "./defs"; 11 + 12 + export type QueryParams = {}; 13 + 14 + export interface InputSchema { 15 + /** The sandbox ID. */ 16 + id: string; 17 + /** The Tailscale token (encrypted) to store for the sandbox. */ 18 + token: string; 19 + [k: string]: unknown; 20 + } 21 + 22 + export type OutputSchema = IoPocketenvSandboxDefs.TailscaleTokenView; 23 + 24 + export interface HandlerInput { 25 + encoding: "application/json"; 26 + body: InputSchema; 27 + } 28 + 29 + export interface HandlerSuccess { 30 + encoding: "application/json"; 31 + body: OutputSchema; 32 + headers?: { [key: string]: string }; 33 + } 34 + 35 + export interface HandlerError { 36 + status: number; 37 + message?: string; 38 + } 39 + 40 + export type HandlerOutput = HandlerError | HandlerSuccess | HandlerPipeThrough; 41 + export type HandlerReqCtx<HA extends HandlerAuth = never> = { 42 + auth: HA; 43 + params: QueryParams; 44 + input: HandlerInput; 45 + req: express.Request; 46 + res: express.Response; 47 + resetRouteRateLimits: () => Promise<void>; 48 + }; 49 + export type Handler<HA extends HandlerAuth = never> = ( 50 + ctx: HandlerReqCtx<HA>, 51 + ) => Promise<HandlerOutput> | HandlerOutput;
+1 -3
apps/api/src/schema/integrations.ts
··· 5 5 const integrations = pgTable( 6 6 "integrations", 7 7 { 8 - id: text("id") 9 - .primaryKey() 10 - .default(sql`xata_id()`), 8 + id: text("id").primaryKey().default(sql`xata_id()`), 11 9 sandboxId: text("sandbox_id") 12 10 .notNull() 13 11 .references(() => sandboxes.id),
+1 -3
apps/api/src/schema/sandbox-variables.ts
··· 6 6 const sandboxVariables = pgTable( 7 7 "sandbox_variables", 8 8 { 9 - id: text("id") 10 - .primaryKey() 11 - .default(sql`xata_id()`), 9 + id: text("id").primaryKey().default(sql`xata_id()`), 12 10 sandboxId: text("sandbox_id") 13 11 .notNull() 14 12 .references(() => sandboxes.id),
+1 -3
apps/api/src/schema/secrets.ts
··· 2 2 import { pgTable, text, timestamp } from "drizzle-orm/pg-core"; 3 3 4 4 const secrets = pgTable("secrets", { 5 - id: text("id") 6 - .primaryKey() 7 - .default(sql`secret_id()`), 5 + id: text("id").primaryKey().default(sql`secret_id()`), 8 6 name: text("name").notNull(), 9 7 value: text("value").notNull(), 10 8 redacted: text("redacted"),
+1 -3
apps/api/src/schema/ssh-keys.ts
··· 3 3 import sandboxes from "./sandboxes"; 4 4 5 5 const sshKeys = pgTable("ssh_keys", { 6 - id: text("id") 7 - .primaryKey() 8 - .default(sql`xata_id()`), 6 + id: text("id").primaryKey().default(sql`xata_id()`), 9 7 sandboxId: text("sandbox_id").references(() => sandboxes.id), 10 8 publicKey: text("public_key").notNull(), 11 9 privateKey: text("private_key").notNull(),
+1 -3
apps/api/src/schema/tailscale-tokens.ts
··· 3 3 import sandboxes from "./sandboxes"; 4 4 5 5 const tailscaleTokens = pgTable("tailscale_tokens", { 6 - id: text("id") 7 - .primaryKey() 8 - .default(sql`xata_id()`), 6 + id: text("id").primaryKey().default(sql`xata_id()`), 9 7 sandboxId: text("sandbox_id").references(() => sandboxes.id), 10 8 tokens: text("tokens").notNull(), 11 9 redacted: text("redacted").notNull(),
+1 -3
apps/api/src/schema/users.ts
··· 2 2 import { pgTable, text, timestamp } from "drizzle-orm/pg-core"; 3 3 4 4 const users = pgTable("users", { 5 - id: text("id") 6 - .primaryKey() 7 - .default(sql`xata_id()`), 5 + id: text("id").primaryKey().default(sql`xata_id()`), 8 6 did: text("did").unique().notNull(), 9 7 displayName: text("display_name"), 10 8 handle: text("handle").unique().notNull(),
+12
apps/api/src/xrpc/index.ts
··· 23 23 import getPreferences from "./io/pocketenv/sandbox/getPreferences"; 24 24 import addVariable from "./io/pocketenv/variable/addVariable"; 25 25 import getVariables from "./io/pocketenv/variable/getVariables"; 26 + import createIntegration from "./io/pocketenv/sandbox/createIntegration"; 27 + import getIntegrations from "./io/pocketenv/sandbox/getIntegrations"; 28 + import getSshKeys from "./io/pocketenv/sandbox/getSshKeys"; 29 + import getTailscaleToken from "./io/pocketenv/sandbox/getTailscaleToken"; 30 + import putSshKeys from "./io/pocketenv/sandbox/putSshKeys"; 31 + import putTailscaleToken from "./io/pocketenv/sandbox/putTailscaleToken"; 26 32 27 33 export default function (server: Server, ctx: Context) { 28 34 // io.pocketenv ··· 49 55 addVolume(server, ctx); 50 56 deleteVolume(server, ctx); 51 57 getVolumes(server, ctx); 58 + createIntegration(server, ctx); 59 + getIntegrations(server, ctx); 60 + getSshKeys(server, ctx); 61 + getTailscaleToken(server, ctx); 62 + putSshKeys(server, ctx); 63 + putTailscaleToken(server, ctx); 52 64 53 65 return server; 54 66 }
+20
apps/api/src/xrpc/io/pocketenv/sandbox/createIntegration.ts
··· 1 + import { XRPCError, type HandlerAuth } from "@atproto/xrpc-server"; 2 + import type { Context } from "context"; 3 + import type { Server } from "lexicon"; 4 + import type { InputSchema } from "lexicon/types/io/pocketenv/sandbox/createIntegration"; 5 + 6 + export default function (server: Server, ctx: Context) { 7 + const createIntegration = async (input: InputSchema, auth: HandlerAuth) => { 8 + return {}; 9 + }; 10 + server.io.pocketenv.sandbox.createIntegration({ 11 + auth: ctx.authVerifier, 12 + handler: async ({ input, auth }) => { 13 + const result = await createIntegration(input.body, auth); 14 + return { 15 + encoding: "application/json", 16 + body: result as any, // TODO: Implement createIntegration 17 + }; 18 + }, 19 + }); 20 + }
+20
apps/api/src/xrpc/io/pocketenv/sandbox/getIntegrations.ts
··· 1 + import { XRPCError, type HandlerAuth } from "@atproto/xrpc-server"; 2 + import type { Context } from "context"; 3 + import type { Server } from "lexicon"; 4 + import type { QueryParams } from "lexicon/types/io/pocketenv/sandbox/getIntegrations"; 5 + 6 + export default function (server: Server, ctx: Context) { 7 + const getIntegrations = async (params: QueryParams, auth: HandlerAuth) => { 8 + return {}; 9 + }; 10 + server.io.pocketenv.sandbox.getIntegrations({ 11 + auth: ctx.authVerifier, 12 + handler: async ({ params, auth }) => { 13 + const result = await getIntegrations(params, auth); 14 + return { 15 + encoding: "application/json", 16 + body: result as any, // TODO: Implement getIntegrations 17 + }; 18 + }, 19 + }); 20 + }
+20
apps/api/src/xrpc/io/pocketenv/sandbox/getSshKeys.ts
··· 1 + import { XRPCError, type HandlerAuth } from "@atproto/xrpc-server"; 2 + import type { Context } from "context"; 3 + import type { Server } from "lexicon"; 4 + import type { QueryParams } from "lexicon/types/io/pocketenv/sandbox/getSshKeys"; 5 + 6 + export default function (server: Server, ctx: Context) { 7 + const getSshKeys = async (params: QueryParams, auth: HandlerAuth) => { 8 + return {}; 9 + }; 10 + server.io.pocketenv.sandbox.getSshKeys({ 11 + auth: ctx.authVerifier, 12 + handler: async ({ params, auth }) => { 13 + const result = await getSshKeys(params, auth); 14 + return { 15 + encoding: "application/json", 16 + body: result as any, // TODO: Implement getSshKeys 17 + }; 18 + }, 19 + }); 20 + }
+20
apps/api/src/xrpc/io/pocketenv/sandbox/getTailscaleToken.ts
··· 1 + import { XRPCError, type HandlerAuth } from "@atproto/xrpc-server"; 2 + import type { Context } from "context"; 3 + import type { Server } from "lexicon"; 4 + import type { QueryParams } from "lexicon/types/io/pocketenv/sandbox/getTailscaleToken"; 5 + 6 + export default function (server: Server, ctx: Context) { 7 + const getTailscaleToken = async (params: QueryParams, auth: HandlerAuth) => { 8 + return {}; 9 + }; 10 + server.io.pocketenv.sandbox.getIntegrations({ 11 + auth: ctx.authVerifier, 12 + handler: async ({ params, auth }) => { 13 + const result = await getTailscaleToken(params, auth); 14 + return { 15 + encoding: "application/json", 16 + body: result as any, // TODO: Implement getIntegrations 17 + }; 18 + }, 19 + }); 20 + }
+20
apps/api/src/xrpc/io/pocketenv/sandbox/putSshKeys.ts
··· 1 + import { XRPCError, type HandlerAuth } from "@atproto/xrpc-server"; 2 + import type { Context } from "context"; 3 + import type { Server } from "lexicon"; 4 + import type { InputSchema } from "lexicon/types/io/pocketenv/sandbox/putSshKeys"; 5 + 6 + export default function (server: Server, ctx: Context) { 7 + const putSshKeys = async (input: InputSchema, auth: HandlerAuth) => { 8 + return {}; 9 + }; 10 + server.io.pocketenv.sandbox.putSshKeys({ 11 + auth: ctx.authVerifier, 12 + handler: async ({ input, auth }) => { 13 + const result = await putSshKeys(input.body, auth); 14 + return { 15 + encoding: "application/json", 16 + body: result as any, // TODO: Implement putSshKeys 17 + }; 18 + }, 19 + }); 20 + }
+20
apps/api/src/xrpc/io/pocketenv/sandbox/putTailscaleToken.ts
··· 1 + import { XRPCError, type HandlerAuth } from "@atproto/xrpc-server"; 2 + import type { Context } from "context"; 3 + import type { Server } from "lexicon"; 4 + import type { InputSchema } from "lexicon/types/io/pocketenv/sandbox/putTailscaleToken"; 5 + 6 + export default function (server: Server, ctx: Context) { 7 + const putTailscaleToken = async (input: InputSchema, auth: HandlerAuth) => { 8 + return {}; 9 + }; 10 + server.io.pocketenv.sandbox.putTailscaleToken({ 11 + auth: ctx.authVerifier, 12 + handler: async ({ input, auth }) => { 13 + const result = await putTailscaleToken(input.body, auth); 14 + return { 15 + encoding: "application/json", 16 + body: result as any, // TODO: Implement createIntegration 17 + }; 18 + }, 19 + }); 20 + }