Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ FROM moby/buildkit:v0.32.2@sha256:28a898719c18a33f4e8000685287fa36fd0dd9560c6440

FROM mcr.microsoft.com/devcontainers/base:bookworm@sha256:bb7b81b6e5be17b5267f92f4ffda534fea37dab1df97b5e86c1f9b91da5c0b5d

LABEL org.opencontainers.image.source="https://github.com/snapflowio/snapflow"

ARG DEBIAN_FRONTEND=noninteractive
ARG MOON_VERSION=2.4.6
ARG CODEX_VERSION=0.145.0
Expand Down
1 change: 0 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
"3002": { "label": "React Email Preview" },
"3773": { "label": "T3 Code" },
"4321": { "label": "Marketing (Astro)" },
"5173": { "label": "Vite Development Server" },
"8082": { "label": "Snapflow Edge HTTP Ingress" },
"8444": { "label": "Snapflow Edge HTTPS Ingress" },
"23000-23031": { "label": "Snapflow Edge Public TCP/UDP Exposures" },
Expand Down
1 change: 0 additions & 1 deletion .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ services:
tmpfs:
- /run:exec,size=256m
ports:
- "127.0.0.1:5173:5173/tcp"
- "3774:3773/tcp"
- "127.0.0.1:4443:4443/tcp"
- "127.0.0.1:4443:4443/udp"
Expand Down
7 changes: 0 additions & 7 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,12 @@ node_modules
**/.pnpm-store

**/dist
!dist/
dist/*
!dist/libs/
dist/libs/*
!dist/libs/computer-use-amd64

.vite
**/.vite
.svelte-kit
**/.svelte-kit
.moon/cache
.moon/docker
logs
*.log

Expand Down Expand Up @@ -51,7 +45,6 @@ tmp
*.tmp

*.md
docs
assets

**/*.test.ts
Expand Down
9 changes: 0 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,13 @@ tmp
out-tsc
build

/libs/sdk-typescript/cjs/
/libs/sdk-typescript/esm/
/libs/api-client/src/**/*.js
/libs/api-client/src/**/*.d.ts
/libs/toolbox-api-client/src/**/*.js
/libs/toolbox-api-client/src/**/*.d.ts

node_modules
.pnpm-store
.pnpm-debug.log*

.env
.env.local
.env.*.local
.env.production
/deploy/secrets/production/

.vite
Expand Down Expand Up @@ -70,4 +62,3 @@ coverage.out
*.test

.moon/cache
.moon/docker
6 changes: 2 additions & 4 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,7 @@
"**/reference/**": true,
"**/references/**": true,
"**/tmp/**": true,
"**/coverage/**": true,
"**/libs/microvm-go/internal/initrd/static/**": true
"**/coverage/**": true
},
"search.exclude": {
"**/.svelte-kit/**": true,
Expand All @@ -106,8 +105,7 @@
"**/reference/**": true,
"**/references/**": true,
"**/tmp/**": true,
"**/coverage/**": true,
"**/libs/microvm-go/internal/initrd/static/**": true
"**/coverage/**": true
},
"git.ignoreLimitWarning": true
}
1 change: 0 additions & 1 deletion apps/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@
"@types/webpack-node-externals": "catalog:",
"pino-pretty": "^13.1.2",
"tsconfig-paths-webpack-plugin": "catalog:",
"tsx": "catalog:",
"typescript": "catalog:",
"webpack-node-externals": "catalog:"
},
Expand Down
14 changes: 0 additions & 14 deletions apps/api/src/common/utils/api-key.util.ts

This file was deleted.

24 changes: 0 additions & 24 deletions apps/api/src/common/utils/concurrency/sequential-async.util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,27 +35,3 @@ export async function settleSequentially<TItem, TResult>(
}
return results;
}

export async function mapWithConcurrency<TItem, TResult>(
items: readonly TItem[],
concurrency: number,
operation: (item: TItem, index: number) => Promise<TResult>
): Promise<Awaited<TResult>[]> {
if (!Number.isInteger(concurrency) || concurrency < 1) {
throw new RangeError('Concurrency must be a positive integer');
}

const results: Awaited<TResult>[] = new Array(items.length);
let nextIndex = 0;
const workerCount = Math.min(concurrency, items.length);
const workers = Array.from({ length: workerCount }, async () => {
while (nextIndex < items.length) {
const index = nextIndex;
nextIndex += 1;
results[index] = await operation(items[index], index);
}
});

await Promise.all(workers);
return results;
}
5 changes: 0 additions & 5 deletions apps/api/src/common/utils/fixed-point.util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,3 @@ export function fixed(value: bigint, scale: number): string {
export function moneyToScaledInteger(value: string): bigint {
return parseFixed(value, USAGE_MONEY_SCALE, 'money amount');
}

export function scaledIntegerToMoney(value: bigint): string {
if (value < 0n) throw new Error('Money amount must be nonnegative');
return fixed(value, USAGE_MONEY_SCALE);
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import {

export const authenticationEnvironment = defineEnvironment(
{
name: 'authentication',
title: 'Authentication',
description: 'Session signing secrets and the health check principal',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import {

export const cloudflareEnvironment = defineEnvironment(
{
name: 'cloudflare',
title: 'Cloudflare',
description:
'Custom domains through the Cloudflare zone of the platform domain',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import {

export const databaseEnvironment = defineEnvironment(
{
name: 'database',
title: 'Database',
description:
'PostgreSQL; one-off processes (migrations, CLI) use a single connection',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ const developmentSecret = (description: string) =>

export const developmentEnvironment = defineEnvironment(
{
name: 'development',
title: 'Development',
description:
'Secrets of the local development stack, shared with its other services',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import {

export const emailEnvironment = defineEnvironment(
{
name: 'email',
title: 'Email',
description: 'Transactional email sent through Resend',
note: 'In development, set RESEND_BASE_URL to the devcontainer Resend emulator and any re_ key to capture email locally; without RESEND_API_KEY the API starts but every email send fails.',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import {

export const geoIpEnvironment = defineEnvironment(
{
name: 'geo-ip',
title: 'IP Geolocation',
description:
'The IP geolocation database that locates machines and the callers placing sandboxes',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ const LOOPBACK_PROXY_CIDRS = '127.0.0.0/8,::1/128';

export const networkEnvironment = defineEnvironment(
{
name: 'network',
title: 'Network & Proxies',
description: 'The HTTP listener and the proxies in front of it',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ export type LogLevel = (typeof LOG_LEVELS)[number];

export const observabilityEnvironment = defineEnvironment(
{
name: 'observability',
title: 'Observability',
description: 'Logging and tracing',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import {

export const processEnvironment = defineEnvironment(
{
name: 'process',
title: 'Environment',
description: 'The deployment selector and the process role',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import {

export const publicUrlsEnvironment = defineEnvironment(
{
name: 'public-urls',
title: 'Public URLs & Domain',
description:
'The public origins of the API, website and dashboard, and the sandbox domain',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import {

export const redisEnvironment = defineEnvironment(
{
name: 'redis',
title: 'Redis',
description: 'Redis: locks, throttling, realtime fan-out and caches',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import {

export const snapshotManagerEnvironment = defineEnvironment(
{
name: 'snapshot-manager',
title: 'Snapshot Manager',
description:
'The platform registry that stores snapshot images, backups and build caches',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import {

export const socialSignInEnvironment = defineEnvironment(
{
name: 'social-sign-in',
title: 'Social sign-in',
description:
'OAuth applications for Google and GitHub sign-in; a provider is offered only when both of its variables are set',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import {

export const objectStorageEnvironment = defineEnvironment(
{
name: 'object-storage',
title: 'Object Storage',
description:
'S3-compatible object storage for build contexts, logs and backups',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import {

export const stripeEnvironment = defineEnvironment(
{
name: 'stripe',
title: 'Stripe',
description: 'Stripe Connect top-ups, host payouts and webhooks',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import {

export const vaultEnvironment = defineEnvironment(
{
name: 'vault',
title: 'Vault',
description:
'The Vault Proxy that serves the keyrings and signs tunnel certificates',
Expand Down
7 changes: 0 additions & 7 deletions apps/api/src/config/environment/registry.environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,3 @@ export type EnvironmentValues<
> = UnionToIntersection<
Namespace extends RegisteredNamespace ? z.output<Namespace['schema']> : never
>;

type NamespaceVariableName<Namespace> = Namespace extends RegisteredNamespace
? keyof z.input<Namespace['schema']> & string
: never;

export type EnvironmentVariableName =
NamespaceVariableName<RegisteredNamespace>;
18 changes: 6 additions & 12 deletions apps/api/src/config/environment/utils/environment-variable.util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,26 +29,20 @@ export function environmentVariable<Schema extends z.ZodType>(

export type EnvironmentShape = Readonly<Record<string, z.ZodType>>;

interface EnvironmentGroup<Name extends string = string> {
readonly name: Name;
interface EnvironmentGroup {
readonly title: string;
readonly description: string;
readonly note?: string;
}

export interface EnvironmentNamespace<
Shape extends EnvironmentShape,
Name extends string = string,
> extends EnvironmentGroup<Name> {
export interface EnvironmentNamespace<Shape extends EnvironmentShape>
extends EnvironmentGroup {
readonly schema: z.ZodObject<Shape>;
}

export function defineEnvironment<
const Name extends string,
const Shape extends EnvironmentShape,
>(
group: EnvironmentGroup<Name>,
export function defineEnvironment<const Shape extends EnvironmentShape>(
group: EnvironmentGroup,
variables: Shape
): EnvironmentNamespace<Shape, Name> {
): EnvironmentNamespace<Shape> {
return { ...group, schema: z.object(variables) };
}
2 changes: 0 additions & 2 deletions apps/api/src/generate-openapi.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env tsx

/*
* Copyright (c) 2026 Snapflow. All rights reserved.
*
Expand Down
6 changes: 0 additions & 6 deletions apps/api/src/payments/funds/constants/stripe.constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,12 +135,6 @@ export const StripeDeclineCode = {
AUTHENTICATION_REQUIRED: 'authentication_required',
} as const;

export const StripeDisputeStatus = {
WON: 'won',
LOST: 'lost',
UNDER_REVIEW: 'under_review',
} as const;

export const StripePaymentIntentStatus = {
SUCCEEDED: 'succeeded',
REQUIRES_ACTION: 'requires_action',
Expand Down
10 changes: 0 additions & 10 deletions apps/edge/internal/edge/edgetest/tunnels.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ var _ edge.Tunnels = (*Tunnels)(nil)
type Tunnels struct {
mu sync.Mutex
backends map[uuid.UUID]string
opened int
dialer net.Dialer
changes chan struct{}
}
Expand Down Expand Up @@ -60,22 +59,13 @@ func (tunnels *Tunnels) OpenStream(
) (transport.Stream, error) {
tunnels.mu.Lock()
backend, found := tunnels.backends[route.BackendID]
if found {
tunnels.opened++
}
tunnels.mu.Unlock()
if !found {
return nil, tunnel.ErrMachineUnavailable
}
return tunnels.dialer.DialContext(ctx, tcpNetwork, backend)
}

func (tunnels *Tunnels) OpenedStreams() int {
tunnels.mu.Lock()
defer tunnels.mu.Unlock()
return tunnels.opened
}

func (tunnels *Tunnels) BackendLoad(route routes.Base) (int64, bool) {
tunnels.mu.Lock()
defer tunnels.mu.Unlock()
Expand Down
1 change: 0 additions & 1 deletion apps/guest/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
internal/terminal/static
!internal/terminal/static/index.html
2 changes: 1 addition & 1 deletion apps/marketing/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ COPY apps/marketing/package.json apps/marketing/package.json

RUN --mount=type=cache,id=pnpm-store,target=/pnpm/store \
pnpm install --filter @snapflow/marketing... --frozen-lockfile --ignore-scripts \
&& pnpm rebuild @parcel/watcher esbuild sharp
&& pnpm rebuild esbuild sharp

COPY apps/marketing apps/marketing

Expand Down
Loading
Loading