Skip to content

Commit

Permalink
Sync alphalib
Browse files Browse the repository at this point in the history
  • Loading branch information
kvz committed Dec 9, 2024
1 parent 2282b8a commit e272d0b
Show file tree
Hide file tree
Showing 82 changed files with 6,702 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .cursorrules
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
- Favor `contentGapItemSchema = z.object()` over `ContentGapItemSchema = z.object()`
- Favor `async run() {` over `run = async () => {` inside ES6 classes
- Favor `from './PosterboyCommand.ts'` over `from './PosterboyCommand'`
- Favor `return ideas.filter(isPresent)` over `ideas.filter((idea): idea is Idea => idea !== null)`
- Favor `if (!(err instanceof Error)) { throw new Error(`Was thrown a non-error: ${err}`) }` inside
`catch` blocks to ensure the `error` is always an instance of `Error`
- Favor using real paths (`../lib/schemas.ts`) over aliases (`@/app/lib/schemas`).
- Favor using `.tsx` over `.jsx`.
- Favor `for (const comment of comments) {` over `comments.forEach((comment) => {`
- Do not touch `.env` files!
- Favor `satisfies` over `as`, consider `as` a sin
- Favor `unknown` over `any`, consider `any` a sin
- Favor validating data with Zod over using `any` or custom type guards
- Favor Yarn (4) over npm
174 changes: 174 additions & 0 deletions src/alphalib/types/robots/_index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
import { z } from 'zod'

Check failure on line 1 in src/alphalib/types/robots/_index.ts

View workflow job for this annotation

GitHub Actions / typescript

Cannot find module 'zod' or its corresponding type declarations.

import { robotAudioArtworkInstructionsSchema } from './audio-artwork.ts'

Check failure on line 3 in src/alphalib/types/robots/_index.ts

View workflow job for this annotation

GitHub Actions / typescript

An import path can only end with a '.ts' extension when 'allowImportingTsExtensions' is enabled.
import { robotAudioConcatInstructionsSchema } from './audio-concat.ts'

Check failure on line 4 in src/alphalib/types/robots/_index.ts

View workflow job for this annotation

GitHub Actions / typescript

An import path can only end with a '.ts' extension when 'allowImportingTsExtensions' is enabled.
import { robotAudioEncodeInstructionsSchema } from './audio-encode.ts'

Check failure on line 5 in src/alphalib/types/robots/_index.ts

View workflow job for this annotation

GitHub Actions / typescript

An import path can only end with a '.ts' extension when 'allowImportingTsExtensions' is enabled.
import { robotAudioLoopInstructionsSchema } from './audio-loop.ts'

Check failure on line 6 in src/alphalib/types/robots/_index.ts

View workflow job for this annotation

GitHub Actions / typescript

An import path can only end with a '.ts' extension when 'allowImportingTsExtensions' is enabled.
import { robotAudioMergeInstructionsSchema } from './audio-merge.ts'

Check failure on line 7 in src/alphalib/types/robots/_index.ts

View workflow job for this annotation

GitHub Actions / typescript

An import path can only end with a '.ts' extension when 'allowImportingTsExtensions' is enabled.
import { robotAudioWaveformInstructionsSchema } from './audio-waveform.ts'

Check failure on line 8 in src/alphalib/types/robots/_index.ts

View workflow job for this annotation

GitHub Actions / typescript

An import path can only end with a '.ts' extension when 'allowImportingTsExtensions' is enabled.
import { robotAzureImportInstructionsSchema } from './azure-import.ts'

Check failure on line 9 in src/alphalib/types/robots/_index.ts

View workflow job for this annotation

GitHub Actions / typescript

An import path can only end with a '.ts' extension when 'allowImportingTsExtensions' is enabled.
import { robotAzureStoreInstructionsSchema } from './azure-store.ts'

Check failure on line 10 in src/alphalib/types/robots/_index.ts

View workflow job for this annotation

GitHub Actions / typescript

An import path can only end with a '.ts' extension when 'allowImportingTsExtensions' is enabled.
import { robotBackblazeImportInstructionsSchema } from './backblaze-import.ts'

Check failure on line 11 in src/alphalib/types/robots/_index.ts

View workflow job for this annotation

GitHub Actions / typescript

An import path can only end with a '.ts' extension when 'allowImportingTsExtensions' is enabled.
import { robotBackblazeStoreInstructionsSchema } from './backblaze-store.ts'
import { robotCloudfilesImportInstructionsSchema } from './cloudfiles-import.ts'
import { robotCloudfilesStoreInstructionsSchema } from './cloudfiles-store.ts'
import { robotCloudflareImportInstructionsSchema } from './cloudflare-import.ts'
import { robotCloudflareStoreInstructionsSchema } from './cloudflare-store.ts'
import { robotDigitaloceanImportInstructionsSchema } from './digitalocean-import.ts'
import { robotDigitaloceanStoreInstructionsSchema } from './digitalocean-store.ts'
import { robotDocumentAutorotateInstructionsSchema } from './document-autorotate.ts'
import { robotDocumentConvertInstructionsSchema } from './document-convert.ts'
import { robotDocumentMergeInstructionsSchema } from './document-merge.ts'
import { robotDocumentOcrInstructionsSchema } from './document-ocr.ts'
import { robotDocumentThumbsInstructionsSchema } from './document-thumbs.ts'
import { robotDropboxImportInstructionsSchema } from './dropbox-import.ts'
import { robotDropboxStoreInstructionsSchema } from './dropbox-store.ts'
import { robotEdglyDeliverInstructionsSchema } from './edgly-deliver.ts'
import { robotFileCompressInstructionsSchema } from './file-compress.ts'
import { robotFileDecompressInstructionsSchema } from './file-decompress.ts'
import { robotFileFilterInstructionsSchema } from './file-filter.ts'
import { robotFileHashInstructionsSchema } from './file-hash.ts'
import { robotFilePreviewInstructionsSchema } from './file-preview.ts'
import { robotFileReadInstructionsSchema } from './file-read.ts'
import { robotFileServeInstructionsSchema } from './file-serve.ts'
import { robotFileVerifyInstructionsSchema } from './file-verify.ts'
import { robotFileVirusscanInstructionsSchema } from './file-virusscan.ts'
import { robotFileWatermarkInstructionsSchema } from './file-watermark.ts'
import { robotFtpImportInstructionsSchema } from './ftp-import.ts'
import { robotFtpStoreInstructionsSchema } from './ftp-store.ts'
import { robotGoogleImportInstructionsSchema } from './google-import.ts'
import { robotGoogleStoreInstructionsSchema } from './google-store.ts'
import { robotHtmlConvertInstructionsSchema } from './html-convert.ts'
import { robotHttpImportInstructionsSchema } from './http-import.ts'
import { robotImageDescribeInstructionsSchema } from './image-describe.ts'
import { robotImageFacedetectInstructionsSchema } from './image-facedetect.ts'
import { robotImageGenerateInstructionsSchema } from './image-generate.ts'
import { robotImageMergeInstructionsSchema } from './image-merge.ts'
import { robotImageOcrInstructionsSchema } from './image-ocr.ts'
import { robotImageOptimizeInstructionsSchema } from './image-optimize.ts'
import { robotImageRemoveBackgroundInstructionsSchema } from './image-remove-background.ts'
import { robotImageResizeInstructionsSchema } from './image-resize.ts'
import { robotMediaPlaylistInstructionsSchema } from './media-playlist.ts'
import { robotMetaWriteInstructionsSchema } from './meta-write.ts'
import { robotMinioImportInstructionsSchema } from './minio-import.ts'
import { robotMinioStoreInstructionsSchema } from './minio-store.ts'
import { robotProgressSimulateInstructionsSchema } from './progress-simulate.ts'
import { robotS3ImportInstructionsSchema } from './s3-import.ts'
import { robotS3StoreInstructionsSchema } from './s3-store.ts'
import { robotScriptRunInstructionsSchema } from './script-run.ts'
import { robotSftpImportInstructionsSchema } from './sftp-import.ts'
import { robotSftpStoreInstructionsSchema } from './sftp-store.ts'
import { robotSpeechTranscribeInstructionsSchema } from './speech-transcribe.ts'
import { robotSupabaseImportInstructionsSchema } from './supabase-import.ts'
import { robotSupabaseStoreInstructionsSchema } from './supabase-store.ts'
import { robotSwiftImportInstructionsSchema } from './swift-import.ts'
import { robotSwiftStoreInstructionsSchema } from './swift-store.ts'
import { robotTextSpeakInstructionsSchema } from './text-speak.ts'
import { robotTextTranslateInstructionsSchema } from './text-translate.ts'
import { robotTlcdnDeliverInstructionsSchema } from './tlcdn-deliver.ts'
import { robotTusStoreInstructionsSchema } from './tus-store.ts'
import { robotUploadHandleInstructionsSchema } from './upload-handle.ts'
import { robotVideoAdaptiveInstructionsSchema } from './video-adaptive.ts'
import { robotVideoConcatInstructionsSchema } from './video-concat.ts'
import { robotVideoEncodeInstructionsSchema } from './video-encode.ts'
import { robotVideoMergeInstructionsSchema } from './video-merge.ts'
import { robotVideoSubtitleInstructionsSchema } from './video-subtitle.ts'
import { robotVideoThumbsInstructionsSchema } from './video-thumbs.ts'
import { robotVimeoStoreInstructionsSchema } from './vimeo-store.ts'
import { robotWasabiImportInstructionsSchema } from './wasabi-import.ts'
import { robotWasabiStoreInstructionsSchema } from './wasabi-store.ts'
import { robotYoutubeStoreInstructionsSchema } from './youtube-store.ts'

const robotStepsInstructions = [
robotAudioArtworkInstructionsSchema,
robotAudioConcatInstructionsSchema,
robotAudioEncodeInstructionsSchema,
robotAudioLoopInstructionsSchema,
robotAudioMergeInstructionsSchema,
robotAudioWaveformInstructionsSchema,
robotAzureImportInstructionsSchema,
robotAzureStoreInstructionsSchema,
robotBackblazeImportInstructionsSchema,
robotBackblazeStoreInstructionsSchema,
robotCloudfilesImportInstructionsSchema,
robotCloudfilesStoreInstructionsSchema,
robotCloudflareImportInstructionsSchema,
robotCloudflareStoreInstructionsSchema,
robotDigitaloceanImportInstructionsSchema,
robotDigitaloceanStoreInstructionsSchema,
robotDocumentAutorotateInstructionsSchema,
robotDocumentConvertInstructionsSchema,
robotDocumentMergeInstructionsSchema,
robotDocumentOcrInstructionsSchema,
robotFileReadInstructionsSchema,
robotDocumentThumbsInstructionsSchema,
robotDropboxImportInstructionsSchema,
robotDropboxStoreInstructionsSchema,
robotEdglyDeliverInstructionsSchema,
robotFileCompressInstructionsSchema,
robotFileDecompressInstructionsSchema,
robotFileFilterInstructionsSchema,
robotFileHashInstructionsSchema,
robotFilePreviewInstructionsSchema,
robotFileServeInstructionsSchema,
robotFileVerifyInstructionsSchema,
robotFileVirusscanInstructionsSchema,
robotFtpImportInstructionsSchema,
robotFtpStoreInstructionsSchema,
robotGoogleImportInstructionsSchema,
robotGoogleStoreInstructionsSchema,
robotHtmlConvertInstructionsSchema,
robotHttpImportInstructionsSchema,
robotImageDescribeInstructionsSchema,
robotImageFacedetectInstructionsSchema,
robotImageMergeInstructionsSchema,
robotImageOcrInstructionsSchema,
robotImageOptimizeInstructionsSchema,
robotImageResizeInstructionsSchema,
robotMediaPlaylistInstructionsSchema,
robotMetaWriteInstructionsSchema,
robotMinioImportInstructionsSchema,
robotMinioStoreInstructionsSchema,
robotS3ImportInstructionsSchema,
robotS3StoreInstructionsSchema,
robotScriptRunInstructionsSchema,
robotSftpImportInstructionsSchema,
robotSftpStoreInstructionsSchema,
robotSpeechTranscribeInstructionsSchema,
robotSupabaseImportInstructionsSchema,
robotSupabaseStoreInstructionsSchema,
robotSwiftImportInstructionsSchema,
robotSwiftStoreInstructionsSchema,
robotTextSpeakInstructionsSchema,
robotTextTranslateInstructionsSchema,
robotTlcdnDeliverInstructionsSchema,
robotTusStoreInstructionsSchema,
robotUploadHandleInstructionsSchema,
robotVideoAdaptiveInstructionsSchema,
robotVideoConcatInstructionsSchema,
robotVideoEncodeInstructionsSchema,
robotVideoMergeInstructionsSchema,
robotVideoSubtitleInstructionsSchema,
robotVideoThumbsInstructionsSchema,
robotVimeoStoreInstructionsSchema,
robotWasabiImportInstructionsSchema,
robotWasabiStoreInstructionsSchema,
robotYoutubeStoreInstructionsSchema,
] as const

/**
* Public robot instructions
*/
export const robotStepsInstructionsSchema = z.union(robotStepsInstructions)

/**
* All robot instructions, including private ones.
*/
export const robotAnyInstructionsSchema = z.union([
...robotStepsInstructions,
robotFileWatermarkInstructionsSchema,
robotImageGenerateInstructionsSchema,
robotImageRemoveBackgroundInstructionsSchema,
robotProgressSimulateInstructionsSchema,
])
export type RobotAnyInstructions = z.infer<typeof robotAnyInstructionsSchema>
Loading

0 comments on commit e272d0b

Please sign in to comment.