Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
453b551
Bump the development group with 2 updates
dependabot[bot] Oct 13, 2024
6bf8033
Merge pull request #74 from GregoryGost/dependabot/npm_and_yarn/devel…
GregoryGost Oct 13, 2024
865fbb1
Bump @types/node from 22.7.5 to 22.7.7 in the development group
dependabot[bot] Oct 20, 2024
9e518f2
Merge pull request #75 from GregoryGost/dependabot/npm_and_yarn/devel…
GregoryGost Oct 20, 2024
443a487
Bump the development group with 2 updates
dependabot[bot] Oct 27, 2024
35eec95
Merge pull request #76 from GregoryGost/dependabot/npm_and_yarn/devel…
GregoryGost Oct 27, 2024
8515afd
version for dev
GregoryGost Oct 28, 2024
887805a
Bump @types/node from 22.8.1 to 22.8.7 in the development group
dependabot[bot] Nov 3, 2024
d9976f3
Merge pull request #77 from GregoryGost/dependabot/npm_and_yarn/devel…
GregoryGost Nov 3, 2024
845466f
Bump the development group with 3 updates
dependabot[bot] Nov 10, 2024
4fb8c3b
Merge pull request #78 from GregoryGost/dependabot/npm_and_yarn/devel…
GregoryGost Nov 13, 2024
ced7ab6
from varcel to tsup, up lib, dependabot interval from weekly to monthly
GregoryGost Nov 18, 2024
9d5064a
Merge pull request #80 from GregoryGost/from-vercelncc-to-tsup
GregoryGost Nov 18, 2024
d391742
update readme
GregoryGost Nov 18, 2024
4ce1459
Bump the development group with 4 updates
dependabot[bot] Nov 24, 2024
82e05e7
Bump super-linter/super-linter in the actions-minor group
dependabot[bot] Nov 24, 2024
cb733f0
Merge pull request #81 from GregoryGost/dependabot/npm_and_yarn/devel…
GregoryGost Nov 24, 2024
75960ca
Merge pull request #82 from GregoryGost/dependabot/github_actions/dev…
GregoryGost Nov 24, 2024
cbce059
Bump the development group with 5 updates
dependabot[bot] Dec 1, 2024
cbe0594
Merge pull request #83 from GregoryGost/dependabot/npm_and_yarn/devel…
GregoryGost Dec 1, 2024
1f290d9
change setup-node node version file
GregoryGost Dec 1, 2024
fc0b7d3
Merge pull request #84 from GregoryGost/setup-node
GregoryGost Dec 1, 2024
38b7241
git config core.filemode false
GregoryGost Dec 1, 2024
7c5e324
migrate to ESLint 9
GregoryGost Dec 2, 2024
828ae46
change index.js to index.cjs
GregoryGost Dec 2, 2024
fc8bcc5
touch typescript eslint (super-linter)
GregoryGost Dec 2, 2024
77117d4
VALIDATE_TYPESCRIPT_ES false
GregoryGost Dec 2, 2024
4811fd3
super-linter fix
GregoryGost Dec 2, 2024
15a2e65
VALIDATE_JSON false
GregoryGost Dec 2, 2024
4871e89
remove module type from package.json
GregoryGost Dec 2, 2024
e652d4a
comment add
GregoryGost Dec 2, 2024
44558c1
Merge pull request #85 from GregoryGost/eslint-nine
GregoryGost Dec 10, 2024
d66271a
Bump the development group across 1 directory with 4 updates
dependabot[bot] Dec 10, 2024
0160d50
Merge pull request #87 from GregoryGost/dependabot/npm_and_yarn/devel…
GregoryGost Dec 10, 2024
c0f49ba
Bump super-linter/super-linter in the actions-minor group
dependabot[bot] Dec 15, 2024
dbece89
Bump the development group with 4 updates
dependabot[bot] Dec 15, 2024
79e8043
Merge pull request #88 from GregoryGost/dependabot/github_actions/dev…
GregoryGost Dec 15, 2024
7484b34
Merge pull request #89 from GregoryGost/dependabot/npm_and_yarn/devel…
GregoryGost Dec 15, 2024
6fb1ae1
Bump the development group with 4 updates
dependabot[bot] Dec 22, 2024
4672905
Merge pull request #90 from GregoryGost/dependabot/npm_and_yarn/devel…
GregoryGost Dec 22, 2024
09ce94c
Bump the development group with 2 updates
dependabot[bot] Dec 29, 2024
246c6dc
Merge pull request #91 from GregoryGost/dependabot/npm_and_yarn/devel…
GregoryGost Dec 29, 2024
6006bd6
up lib 2025-05-01
GregoryGost Jan 5, 2025
b471d2a
up libs 2025-01-19
GregoryGost Jan 19, 2025
cf36ee4
up libs 2025-01-26
GregoryGost Jan 26, 2025
9b9c302
up libs 2025-02-02, fix eslint for tests
GregoryGost Feb 2, 2025
24c8983
pnpm up 9 to 10, libs up. ts fixed viersion 5.7.3
GregoryGost Mar 9, 2025
63957f0
Merge pull request #103 from GregoryGost/up-libs-20250309
GregoryGost Mar 9, 2025
5f15678
Bump super-linter/super-linter in the actions-minor group
dependabot[bot] May 18, 2025
ee3dd86
lib up
GregoryGost Jun 18, 2025
128b573
Merge pull request #116 from GregoryGost/lib-up-20250618
GregoryGost Jun 18, 2025
28f140d
Merge pull request #112 from GregoryGost/dependabot/github_actions/de…
GregoryGost Jun 18, 2025
3afd5eb
add pnpm workspace
GregoryGost Jun 18, 2025
a4ee98c
Bump the development group with 2 updates
dependabot[bot] Jun 22, 2025
f017b7d
Merge pull request #117 from GregoryGost/dependabot/npm_and_yarn/deve…
GregoryGost Jun 22, 2025
cff8ace
Bump actions/checkout from 4 to 5
dependabot[bot] Aug 17, 2025
b90b2a2
Merge pull request #120 from GregoryGost/dependabot/github_actions/de…
GregoryGost Aug 17, 2025
9bf5dde
up lib, checkout up 5 to 6
GregoryGost Dec 29, 2025
7711a8a
upload-artifact up 4 to 5
GregoryGost Dec 29, 2025
2385bb8
setup-node up 4 to 6, super-linter up 7.4.0 to 8
GregoryGost Dec 29, 2025
c40ee66
setup-node up 4 to 6
GregoryGost Dec 29, 2025
aa313da
codeql-action up 3 to 4
GregoryGost Dec 29, 2025
9f97b76
build dist with new libs
GregoryGost Dec 29, 2025
7372c6a
Merge pull request #136 from GregoryGost/up-lib-20251229
GregoryGost Dec 29, 2025
b9d7a2c
upload-artifact up 5 to 6
GregoryGost Dec 29, 2025
c278a97
Bump the development group with 2 updates
dependabot[bot] Jan 4, 2026
c1f7488
Bump globals from 16.5.0 to 17.0.0
dependabot[bot] Jan 4, 2026
a2b0cde
Merge pull request #137 from GregoryGost/dependabot/npm_and_yarn/deve…
GregoryGost Jan 6, 2026
818b46f
Merge pull request #138 from GregoryGost/dependabot/npm_and_yarn/deve…
GregoryGost Jan 6, 2026
99a33c7
lib up 11.01.2026
GregoryGost Jan 11, 2026
edd2371
Merge pull request #141 from GregoryGost/lib-up-20260111
GregoryGost Jan 11, 2026
d367654
Bump the development group with 5 updates
dependabot[bot] Jan 18, 2026
bbe62c7
Merge pull request #142 from GregoryGost/dependabot/npm_and_yarn/deve…
GregoryGost Jan 18, 2026
d188ade
Bump the development group with 4 updates
dependabot[bot] Jan 25, 2026
3e87e54
Merge pull request #143 from GregoryGost/dependabot/npm_and_yarn/deve…
GregoryGost Jan 25, 2026
0445c8b
Bump the development group with 4 updates
dependabot[bot] Feb 1, 2026
abb8d87
Merge pull request #144 from GregoryGost/dependabot/npm_and_yarn/deve…
GregoryGost Feb 1, 2026
1335195
Bump the development group with 7 updates
dependabot[bot] Feb 15, 2026
61419d4
Merge pull request #148 from GregoryGost/dependabot/npm_and_yarn/deve…
GregoryGost Feb 15, 2026
0bd944b
Bump @eslint/js from 9.39.2 to 9.39.3
dependabot[bot] Feb 22, 2026
74bb196
Bump actions/upload-artifact from 6 to 7
dependabot[bot] Mar 1, 2026
13f1d2f
Merge pull request #150 from GregoryGost/dependabot/npm_and_yarn/deve…
GregoryGost Apr 12, 2026
80faf70
Merge pull request #152 from GregoryGost/dependabot/github_actions/de…
GregoryGost Apr 12, 2026
e7e1441
Bump the development group with 9 updates
dependabot[bot] Apr 19, 2026
d19c33d
Merge pull request #160 from GregoryGost/dependabot/npm_and_yarn/deve…
GregoryGost Apr 19, 2026
b8d226f
Bump typescript-eslint from 8.58.2 to 8.59.0 in the development group
dependabot[bot] Apr 26, 2026
dd1586f
Merge pull request #164 from GregoryGost/dependabot/npm_and_yarn/deve…
GregoryGost Apr 26, 2026
b967a86
Обновлены зависимости и тесты для актуальных Actions SDK
GregoryGost May 2, 2026
98183c4
update readme
GregoryGost May 2, 2026
e186572
Merge pull request #168 from GregoryGost/up-lib-20260501
GregoryGost May 2, 2026
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
7 changes: 7 additions & 0 deletions .checkov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# See: https://www.checkov.io/1.Welcome/Quick%20Start.html

compact: true
quiet: true
skip-path:
- coverage
- node_modules
32 changes: 32 additions & 0 deletions .codex/AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Project rule

You're an experienced engineer who doesn't ask unnecessary questions and tries to figure everything out on your own, delving into the project in detail and independently studying anything that's unclear.

Always output the answer in Russian language. Proper names, code blocks, and other variable names should remain in English.

Use 2 for indent using spaces in all project
Take into account the versions of the modules used, they can be found in the file package.json this project

The main IDE for development is VSCode. Follow the appropriate formatting for comments and other features for this IDE.

Use `pnpm` package manager for run package script commands.

Don't overload the readme file with unnecessary information. Move any instructions to a separate file. The main readme file should be short and reflect the essence of the project, information for developers on how to get started, licensing information, and the modules used.

After creating or making changes to any file, be sure to double-check it several times.

## Project history. Agent context

Always use the `.agent/agent_context` folder to retrieve information about your most recent actions in a project. If this folder not exists, create this.
Always use the `.agent/agent_context` to save your most recent work. Save them as separate files - max 2000 rows. Save in these files anything that will help you later recall the work you did. The completeness of your records should be based on your ability to remember what was done in the project.
To store the history of actions (in folder `.agent/agent_context`), use Markdown files. Include the current date down to the second in file names. Mandatory date and time and name format for these files `YearMonthDayHourMinuteSecond-your_action.md`, example: `20260214212215-fix_modal.md`. These files must be written in English.
Be sure to record the user's query that he asked before starting work.

To understand what you last did on this project, use the files in this folder and review them from the earliest to the latest to understand what was changed and why.

Please be sure to read all of the following rules:

- [Project Overview](./rules/project.md)
- [TypeScript Guidelines](./rules/typescript.md)
- [Markdown files](./rules/mark.md)
- [Git work rules](./rules/git.md)
12 changes: 12 additions & 0 deletions .codex/rules/git.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Git work rules

When requested to provide a Git commit, it must be:

* the commit must be in markdown format
* the title must not be in Markdown style
* must be output as a code block
* include changes since the last Git commit
* display in Russian in the chat
* do not use the infinitive
* there should be NO extra git add, git rm or git commit -m commands, only the text of the commit itself
* a commit must have a title and then a list of changes
4 changes: 4 additions & 0 deletions .codex/rules/mark.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Markdown files

- Before creating any markdown documentation, ask user whether it needs to be created.
- Do not create a docs folder or documentation files in it under any circumstances.
9 changes: 9 additions & 0 deletions .codex/rules/project.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Project Overview

- Backend project using TypeScript only, no web elements.
- Do not import new libraries without permission.
- Use ES imports, not require().

## Project Description

Read [README.md](../../README.md)
301 changes: 301 additions & 0 deletions .codex/rules/typescript.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,301 @@
# TypeScript Guidelines

TypeScript code style, type co-location, constant naming conventions, and arktype patterns. Use when writing TypeScript code, defining types, creating constants, or working with arktype schemas.

## Core Rules

- Always use `type` instead of `interface` in TypeScript.
- TypeScript 5.5+ automatically infers type predicates in `.filter()` callbacks. Don't add manual type assertions:

```typescript
// Good - TypeScript infers the narrowed type automatically
const filtered = items.filter((x) => x !== undefined);

// Bad - unnecessary type predicate
const filtered = items.filter((x): x is NonNullable<typeof x> => x !== undefined);
```

- When moving components to new locations, always update relative imports to absolute imports (e.g., change `import Component from '../Component.ts'` to `import Component from '$lib/components/Component.ts'`)
- When functions are only used in the return statement of a factory/creator function, use object method shorthand syntax instead of defining them separately. For example, instead of:

```typescript
function myFunction() {
const helper = () => {
/* ... */
};
return { helper };
}
```

Use:

```typescript
function myFunction() {
return {
helper() {
/* ... */
},
};
}
```

# Type Co-location Principles

## Never Use Generic Type Buckets

Don't create generic type files like `$lib/types/models.ts`. This creates unclear dependencies and makes code harder to maintain.

### Bad Pattern

```typescript
// $lib/types/models.ts - Generic bucket for unrelated types
export type LocalModelConfig = { ... };
export type UserModel = { ... };
export type SessionModel = { ... };
```

### Good Pattern

```typescript
// $lib/services/transcription/local/types.ts - Co-located with service
export type LocalModelConfig = { ... };

// $lib/services/user/types.ts - Co-located with user service
export type UserModel = { ... };
```

## Co-location Rules

1. **Service-specific types**: Place in `[service-folder]/types.ts`
2. **Component-specific types**: Define directly in the component file
3. **Shared domain types**: Place in the domain folder's `types.ts`
4. **Cross-domain types**: Only if truly shared across multiple domains, place in `$lib/types/[specific-name].ts`

## Benefits

- Clear ownership and dependencies
- Easier refactoring and deletion
- Better code organization
- Reduces coupling between unrelated features

# Constant Array Naming Conventions

## Pattern Summary

| Pattern | Suffix | Description | Example |
|---------|--------|-------------|---------|
| Simple values (source of truth) | Plural noun with unit | Raw values array | `BITRATES_KBPS`, `SAMPLE_RATES` |
| Rich array (source of truth) | Plural noun | Contains all metadata | `PROVIDERS`, `RECORDING_MODE_OPTIONS` |
| IDs only (for validation) | `_IDS` | Derived from rich array | `PROVIDER_IDS` |
| UI options `{value, label}` | `_OPTIONS` | For dropdowns/selects | `BITRATE_OPTIONS`, `SAMPLE_RATE_OPTIONS` |
| Label map | `_TO_LABEL` (singular) | `Record<Id, string>` | `LANGUAGES_TO_LABEL` |

## When to Use Each Pattern

### Pattern 1: Simple Values -> Derived Options

Use when the label can be computed from the value:

```typescript
// constants/audio/bitrate.ts
export const BITRATES_KBPS = ['16', '32', '64', '128'] as const;

export const BITRATE_OPTIONS = BITRATES_KBPS.map((bitrate) => ({
value: bitrate,
label: `${bitrate} kbps`,
}));
```

### Pattern 2: Simple Values + Metadata Object

Use when labels need richer information than the value alone:

```typescript
// constants/audio/sample-rate.ts
export const SAMPLE_RATES = ['16000', '44100', '48000'] as const;

const SAMPLE_RATE_METADATA: Record<SampleRate, { shortLabel: string; description: string }> = {
'16000': { shortLabel: '16 kHz', description: 'Optimized for speech' },
'44100': { shortLabel: '44.1 kHz', description: 'CD quality' },
'48000': { shortLabel: '48 kHz', description: 'Studio quality' },
};

export const SAMPLE_RATE_OPTIONS = SAMPLE_RATES.map((rate) => ({
value: rate,
label: `${SAMPLE_RATE_METADATA[rate].shortLabel} - ${SAMPLE_RATE_METADATA[rate].description}`,
}));
```

### Pattern 3: Rich Array as Source of Truth

Use when options have extra fields beyond `value`/`label` (e.g., `icon`, `desktopOnly`):

```typescript
// constants/audio/recording-modes.ts
export const RECORDING_MODES = ['manual', 'vad', 'upload'] as const;
export type RecordingMode = (typeof RECORDING_MODES)[number];

export const RECORDING_MODE_OPTIONS = [
{ label: 'Manual', value: 'manual', icon: 'mic', desktopOnly: false },
{ label: 'Voice Activated', value: 'vad', icon: 'mic-voice', desktopOnly: false },
{ label: 'Upload File', value: 'upload', icon: 'upload', desktopOnly: false },
] as const satisfies { label: string; value: RecordingMode; icon: string; desktopOnly: boolean }[];

// Derive IDs for validation if needed
export const RECORDING_MODE_IDS = RECORDING_MODE_OPTIONS.map(o => o.value);
```

## Choosing a Pattern

| Scenario | Pattern |
|----------|---------|
| Label = formatted value (e.g., "128 kbps") | Simple Values -> Derived |
| Label needs separate data (e.g., "16 kHz - Optimized for speech") | Values + Metadata |
| Options have extra UI fields (icon, description, disabled) | Rich Array |
| Platform-specific or runtime-conditional content | Keep inline in component |

## Naming Rules

### Source Arrays

- Use **plural noun**: `PROVIDERS`, `MODES`, `LANGUAGES`
- Add unit suffix when relevant: `BITRATES_KBPS`, `SAMPLE_RATES`
- Avoid redundant `_VALUES` suffix

### Derived/Options Arrays

- Use **plural noun** + `_OPTIONS` suffix: `BITRATE_OPTIONS`, `SAMPLE_RATE_OPTIONS`
- For IDs: **plural noun** + `_IDS` suffix: `PROVIDER_IDS`

### Label Maps

- Use **singular** `_TO_LABEL` suffix: `LANGUAGES_TO_LABEL`
- Describes the operation (id -> label), not the container
- Reads naturally: `LANGUAGES_TO_LABEL[lang]` = "get the label for this language"

### Constant Casing

- Always use `SCREAMING_SNAKE_CASE` for exported constants
- Never use `camelCase` for constant objects/arrays

## Co-location

Options arrays should be co-located with their source array in the same file. Avoid creating options inline in `ts` components; import pre-defined options instead.

Exception: Keep options inline when they have platform-specific or runtime-conditional content that would require importing platform constants into the data module.

# Parameter Destructuring for Factory Functions

## Prefer Parameter Destructuring Over Body Destructuring

When writing factory functions that take options objects, destructure directly in the function signature instead of in the function body. This is the established pattern in the codebase.

### Bad Pattern (Body Destructuring)

```typescript
// DON'T: Extra line of ceremony
function createSomething(opts: { foo: string; bar?: number }) {
const { foo, bar = 10 } = opts; // Unnecessary extra line
return { foo, bar };
}
```

### Good Pattern (Parameter Destructuring)

```typescript
// DO: Destructure directly in parameters
function createSomething({ foo, bar = 10 }: { foo: string; bar?: number }) {
return { foo, bar };
}
```

### Why This Matters

1. **Fewer lines**: Removes the extra destructuring statement
2. **Defaults at API boundary**: Users see defaults in the signature, not hidden in the body
3. **Works with `const` generics**: TypeScript literal inference works correctly:

```typescript
function select<const TOptions extends readonly string[]>({
options,
nullable = false,
}: {
options: TOptions;
nullable?: boolean;
}) { ... }
```

4. **Closures work identically**: Inner functions capture the same variables either way

### When Body Destructuring is Valid

- Need to distinguish "property missing" vs "property is `undefined`" (`'key' in opts`)
- Complex normalization/validation of the options object
- Need to pass the entire `opts` object to other functions

### Codebase Examples

```typescript
// From packages/epicenter/src/core/schema/columns.ts
export function select<const TOptions extends readonly [string, ...string[]]>({
options,
nullable = false,
default: defaultValue,
}: {
options: TOptions;
nullable?: boolean;
default?: TOptions[number];
}): SelectColumnSchema<TOptions, boolean> {
return { type: 'select', nullable, options, default: defaultValue };
}

// From apps/whispering/.../create-key-recorder.ts
export function createKeyRecorder({
pressedKeys,
onRegister,
onClear,
}: {
pressedKeys: PressedKeys;
onRegister: (keyCombination: KeyboardEventSupportedKey[]) => void;
onClear: () => void;
}) { ... }
```

# Arktype Optional Properties

## Never Use `| undefined` for Optional Properties

When defining optional properties in arktype schemas, always use the `'key?'` syntax instead of `| undefined` unions. This is critical for JSON Schema conversion (used by OpenAPI/MCP).

### Bad Pattern

```typescript
// DON'T: Explicit undefined union - breaks JSON Schema conversion
const schema = type({
window_id: 'string | undefined',
url: 'string | undefined',
});
```

This produces invalid JSON Schema with `anyOf: [{type: "string"}, {}]` because `undefined` has no JSON Schema equivalent.

### Good Pattern

```typescript
// DO: Optional property syntax - converts cleanly to JSON Schema
const schema = type({
'window_id?': 'string',
'url?': 'string',
});
```

This correctly omits properties from the `required` array in JSON Schema.

### Why This Matters

| Syntax | TypeScript Behavior | JSON Schema |
|--------|---------------------|-------------|
| `key: 'string \| undefined'` | Required prop, accepts string or undefined | Broken (triggers fallback) |
| `'key?': 'string'` | Optional prop, accepts string | Clean (omitted from `required`) |

Both behave similarly in TypeScript, but only the `?` syntax converts correctly to JSON Schema for OpenAPI documentation and MCP tool schemas.
4 changes: 0 additions & 4 deletions .eslintignore

This file was deleted.

Loading
Loading