sync: update from private repo (e62f5c7)
CI / build-and-test (push) Has been cancelled

This commit is contained in:
oss-sync
2026-06-11 01:52:48 +00:00
parent 000a2474aa
commit d061ad08d8
237 changed files with 8441 additions and 5549 deletions
+21 -46
View File
@@ -1,3 +1,4 @@
import { useTranslation } from 'react-i18next';
import { HelpText } from './HelpText';
import { FieldLabel, FieldInput } from './formUtils';
import type { SectionFormProps } from './types';
@@ -14,6 +15,7 @@ import type { SectionFormProps } from './types';
* jobs are silently skipped.
*/
export function ReflectionForm({ config, onChange }: SectionFormProps) {
const { t } = useTranslation('settings');
const reflection = config.reflection ?? {};
// Step 7 (design 2026-05-21): read v2 `llm.workers`. The v2 API contract
// already strips the legacy `provider` block from GET /api/config, so
@@ -30,10 +32,7 @@ export function ReflectionForm({ config, onChange }: SectionFormProps) {
<h2 className="text-base font-semibold text-slate-800">Reflection (Hermes mode)</h2>
<p className="text-xs text-slate-600 leading-relaxed">
LLM memory
(<code className="font-mono text-2xs">data/users/{'{userId}'}/memory/</code>)
custom piece snapshot
Memory &amp; Learning revert
{t('reflection.intro')}
</p>
<div>
@@ -44,29 +43,16 @@ export function ReflectionForm({ config, onChange }: SectionFormProps) {
onChange={e => onChange('reflection.enabled', e.target.checked)}
className="rounded"
/>
<span className="font-semibold">Reflection </span>
<span className="font-semibold">{t('reflection.enableLabel')}</span>
</label>
<HelpText>
ON reflection memory
デフォルト: 無効
</HelpText>
<HelpText>{t('reflection.enableHelp')}</HelpText>
</div>
{enabled && !hasReflectionWorker && (
<div className="rounded-md border border-amber-300 dark:border-amber-500/30 bg-amber-50 dark:bg-amber-500/15 px-3 py-2 text-xs text-amber-900 dark:text-amber-300">
<div className="font-semibold mb-1"> Reflection worker </div>
<div>
Reflection <code className="font-mono">roles</code>
<code className="font-mono">reflection</code> worker
enqueue <strong>LLM Workers</strong> worker
:
</div>
<pre className="mt-2 text-2xs font-mono bg-canvas border border-amber-200 rounded p-2 overflow-auto">{`id: reflection-1
connection_type: direct
endpoint: http://localhost:11434/v1
model: qwen2.5:3b # cheap モデル推奨
roles: [reflection]
max_concurrency: 1`}</pre>
<div className="font-semibold mb-1">{t('reflection.workerWarn.title')}</div>
<div>{t('reflection.workerWarn.body')}</div>
<pre className="mt-2 text-2xs font-mono bg-canvas border border-amber-200 rounded p-2 overflow-auto">{t('reflection.workerWarn.snippet')}</pre>
</div>
)}
@@ -78,13 +64,9 @@ max_concurrency: 1`}</pre>
onChange={e => onChange('reflection.workerRequired', e.target.checked)}
className="rounded"
/>
reflection worker
{t('reflection.workerRequiredLabel')}
</label>
<HelpText>
ON: <code className="font-mono">roles: [reflection]</code> worker
reflection enqueue ()OFF enabled
worker
</HelpText>
<HelpText>{t('reflection.workerRequiredHelp')}</HelpText>
</div>
<h3 className="text-sm font-medium text-slate-600 mt-4 pt-3 border-t border-slate-200">Caps</h3>
@@ -96,7 +78,7 @@ max_concurrency: 1`}</pre>
value={reflection.maxMemoryChangesPerJob ?? 3}
onChange={v => onChange('reflection.maxMemoryChangesPerJob', Number(v))}
/>
<HelpText>1 reflection memory entry デフォルト: 3</HelpText>
<HelpText>{t('reflection.maxMemHelp')}</HelpText>
</div>
<div>
@@ -106,7 +88,7 @@ max_concurrency: 1`}</pre>
value={reflection.maxEntryBodyBytes ?? 8192}
onChange={v => onChange('reflection.maxEntryBodyBytes', Number(v))}
/>
<HelpText>memory entry body semantic validator rejectデフォルト: 8192</HelpText>
<HelpText>{t('reflection.maxBodyHelp')}</HelpText>
</div>
<div>
@@ -116,7 +98,7 @@ max_concurrency: 1`}</pre>
value={reflection.pieceEditCooldownHours ?? 24}
onChange={v => onChange('reflection.pieceEditCooldownHours', Number(v))}
/>
<HelpText> piece cooldownデフォルト: 24 (24h 2 3 )</HelpText>
<HelpText>{t('reflection.cooldownHelp')}</HelpText>
</div>
<div>
@@ -126,7 +108,7 @@ max_concurrency: 1`}</pre>
value={reflection.activityLogMaxBytes ?? 4096}
onChange={v => onChange('reflection.activityLogMaxBytes', Number(v))}
/>
<HelpText>reflection LLM activity log デフォルト: 4096</HelpText>
<HelpText>{t('reflection.activityLogHelp')}</HelpText>
</div>
<h3 className="text-sm font-medium text-slate-600 mt-4 pt-3 border-t border-slate-200">Budget</h3>
@@ -138,7 +120,7 @@ max_concurrency: 1`}</pre>
value={reflection.perUserDailyBudgetTokens ?? 200000}
onChange={v => onChange('reflection.perUserDailyBudgetTokens', Number(v))}
/>
<HelpText>1 1 reflection token reflection enqueue デフォルト: 200000</HelpText>
<HelpText>{t('reflection.dailyBudgetHelp')}</HelpText>
</div>
<h3 className="text-sm font-medium text-slate-600 mt-4 pt-3 border-t border-slate-200">Snapshot &amp; Retention</h3>
@@ -150,7 +132,7 @@ max_concurrency: 1`}</pre>
value={reflection.snapshotRetentionDays ?? 90}
onChange={v => onChange('reflection.snapshotRetentionDays', Number(v))}
/>
<HelpText>reflection-history snapshot デフォルト: 90</HelpText>
<HelpText>{t('reflection.snapRetentionHelp')}</HelpText>
</div>
<div>
@@ -160,7 +142,7 @@ max_concurrency: 1`}</pre>
value={reflection.snapshotMaxBytesPerUser ?? 100 * 1024 * 1024}
onChange={v => onChange('reflection.snapshotMaxBytesPerUser', Number(v))}
/>
<HelpText>1 snapshot (bytes)デフォルト: 100 MiB</HelpText>
<HelpText>{t('reflection.snapMaxUserHelp')}</HelpText>
</div>
<div>
@@ -170,7 +152,7 @@ max_concurrency: 1`}</pre>
value={reflection.snapshotMaxBytesPerEntry ?? 1 * 1024 * 1024}
onChange={v => onChange('reflection.snapshotMaxBytesPerEntry', Number(v))}
/>
<HelpText>1 snapshot (bytes)デフォルト: 1 MiB</HelpText>
<HelpText>{t('reflection.snapMaxEntryHelp')}</HelpText>
</div>
<div>
@@ -181,12 +163,9 @@ max_concurrency: 1`}</pre>
onChange={e => onChange('reflection.storeLlmRaw', e.target.checked)}
className="rounded"
/>
LLM
{t('reflection.storeLlmRawLabel')}
</label>
<HelpText>
ON <code className="font-mono">llm-raw.json</code> snapshot
OFF ()
</HelpText>
<HelpText>{t('reflection.storeLlmRawHelp')}</HelpText>
</div>
<h3 className="text-sm font-medium text-slate-600 mt-4 pt-3 border-t border-slate-200">Monitoring</h3>
@@ -198,11 +177,7 @@ max_concurrency: 1`}</pre>
value={reflection.abstainRateFloor ?? 0.3}
onChange={v => onChange('reflection.abstainRateFloor', v ? Number(v) : undefined)}
/>
<HelpText>
abstain () ()
デフォルト: 0.3 warn
max_memory_changes_per_job
</HelpText>
<HelpText>{t('reflection.abstainFloorHelp')}</HelpText>
</div>
</div>
);