- Default routing rule (user decision, 15 Oct 2026): repeating/scheduled work goes to the AITURK IDE bot as a cron job; coding stays in Codex (itself or its subagents); 'Codex' or 'sen yap' keeps everything in Codex. - Settings > Codex Bağlama: choice (recommended / send large work / never / custom text) with a text box and restore-default; written to bridge.json aiturk_hat. - Bridge re-reads aiturk_hat when bridge.json changes: no restart. IDE apply keeps aiturk_hat instead of wiping it. - Bridge version 20, IDE 1.0.0-beta.40. Jev untouched.
25 lines
1.2 KiB
TypeScript
25 lines
1.2 KiB
TypeScript
import { describe, expect, it } from 'vitest'
|
||
|
||
import { readIsHatti, writeIsHatti } from './is-hatti-settings'
|
||
|
||
describe('AITURK iş hattı settings', () => {
|
||
it('defaults to the recommended rule and reads older files the way the bridge does', () => {
|
||
expect(readIsHatti(null)).toEqual({ secim: 'onerilen', talimat: '' })
|
||
expect(readIsHatti('{"aiturk_hat":{"enabled":false}}').secim).toBe('kapali')
|
||
expect(readIsHatti('{"aiturk_hat":{"talimat":"x"}}')).toEqual({ secim: 'ozel', talimat: 'x' })
|
||
expect(readIsHatti('bozuk').secim).toBe('onerilen')
|
||
})
|
||
|
||
it('writes only aiturk_hat and keeps everything else', () => {
|
||
const raw = '{"port":8795,"aiturk_hat":{"enabled":false,"komut":"k"}}'
|
||
const out = JSON.parse(writeIsHatti(raw, { secim: 'buyuk', talimat: '' }))
|
||
expect(out).toEqual({ port: 8795, aiturk_hat: { komut: 'k', secim: 'buyuk', talimat: '' } })
|
||
})
|
||
|
||
it('rejects an empty custom text and unknown choices', () => {
|
||
expect(() => writeIsHatti(null, { secim: 'ozel', talimat: ' ' })).toThrow()
|
||
expect(() => writeIsHatti(null, { secim: 'x', talimat: '' })).toThrow()
|
||
expect(() => writeIsHatti('{bozuk', { secim: 'onerilen', talimat: '' })).toThrow()
|
||
})
|
||
})
|