MCPcopy Create free account
hub / github.com/acoyfellow/cloudbox / isSafeRelativePath

Function isSafeRelativePath

src/http.ts:499–507  ·  view source on GitHub ↗
(path: unknown)

Source from the content-addressed store, hash-verified

497 .bind(status, new Date().toISOString(), JSON.stringify(result).slice(0, 200_000), changes.snapshotKey ?? null, changes.forkedFrom ?? null, id)
498 .run();
499}
500
501async function storeSnapshot(bucket: R2Bucket | undefined, runId: string, bytes: string): Promise<string> {
502 if (!bucket) throw new Error("ARTIFACTS binding is required for live run snapshots");
503 const key = `snapshots/${runId}/${crypto.randomUUID()}.tar.gz`;
504 await bucket.put(key, Uint8Array.from(atob(bytes), (character) => character.charCodeAt(0)), {
505 httpMetadata: { contentType: "application/gzip" },
506 customMetadata: { runId, createdAt: new Date().toISOString() },
507 });
508 return key;
509}
510

Callers 1

http.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected