@musnows/scriverse 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1440,6 +1440,7 @@ select:focus, input:focus, textarea:focus { border-color: #a77768; box-shadow: 0
1440
1440
  display: grid;
1441
1441
  grid-template-columns: auto minmax(0, 2em);
1442
1442
  align-items: start;
1443
+ justify-content: start;
1443
1444
  word-break: break-all;
1444
1445
  }
1445
1446
  .module-nav > button[data-module="outlines"] {
@@ -1778,6 +1779,21 @@ select:focus, input:focus, textarea:focus { border-color: #a77768; box-shadow: 0
1778
1779
  .config-section { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line); }
1779
1780
  .config-section:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
1780
1781
  .platform-system-prompt-section { margin-bottom: 36px; }
1782
+ .system-prompt-override-settings { margin-top: 12px; overflow: hidden; border: 1px solid var(--line); border-radius: 5px; background: var(--surface-soft); }
1783
+ .system-prompt-override-settings.is-enabled { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
1784
+ .system-prompt-override-settings summary { display: grid; min-height: 40px; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 9px 12px; cursor: pointer; color: var(--muted); font-size: 11px; list-style: none; }
1785
+ .system-prompt-override-settings summary::-webkit-details-marker { display: none; }
1786
+ .system-prompt-override-settings summary::before { content: "›"; color: var(--muted); font-size: 16px; line-height: 1; transform: rotate(0deg); transition: transform .16s ease; }
1787
+ .system-prompt-override-settings[open] summary::before { transform: rotate(90deg); }
1788
+ .system-prompt-override-settings summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
1789
+ .system-prompt-override-settings summary strong { color: var(--ink); font-size: 10px; font-weight: 600; }
1790
+ .system-prompt-override-settings.is-enabled summary strong { color: var(--accent-dark); }
1791
+ .system-prompt-override-body { display: grid; gap: 10px; padding: 12px; border-top: 1px solid var(--line); }
1792
+ .system-prompt-override-body > .config-checkbox-field { display: inline-flex; width: fit-content; align-items: center; gap: 8px; margin: 0; color: var(--ink); font-size: 11px; }
1793
+ .system-prompt-override-body > .config-checkbox-field input { width: 18px; min-width: 18px; height: 18px; }
1794
+ .system-prompt-override-warning { padding: 10px 12px; border: 1px solid color-mix(in srgb, var(--accent) 48%, var(--line)); border-radius: 5px; background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
1795
+ .system-prompt-override-warning strong { color: var(--ink); font-size: 11px; }
1796
+ .system-prompt-override-warning p { margin: 3px 0 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
1781
1797
  .platform-image-tool-section { margin-bottom: 0; }
1782
1798
  .platform-image-tool-panel { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 16px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-soft); }
1783
1799
  .platform-image-tool-field { display: grid; flex: 1 1 360px; gap: 7px; min-width: 0; color: var(--muted); font-size: 10px; }
@@ -3520,6 +3536,7 @@ select:focus, input:focus, textarea:focus { border-color: #a77768; box-shadow: 0
3520
3536
  .dialog-fields .form-field-note { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.65; }
3521
3537
  .dialog-fields label { display: grid; gap: 6px; color: var(--muted); font-size: 11px; }
3522
3538
  .dialog-fields input, .dialog-fields textarea, .dialog-fields select { width: 100%; padding: 9px 10px; font-size: 13px; }
3539
+ .dialog-fields input[type="checkbox"] { flex: 0 0 16px; width: 16px; min-width: 16px; height: 16px; min-height: 16px; margin: 0; padding: 0; }
3523
3540
  .dialog-fields select { padding-inline-end: 28px; }
3524
3541
  .dialog-fields .character-extraction-candidate-toggle { display: inline-flex; width: auto; align-items: center; gap: 7px; margin: 0; color: var(--ink); font-size: 9px; white-space: nowrap; }
3525
3542
  .dialog-fields .character-extraction-candidate-toggle input[type="checkbox"] { flex: 0 0 18px; width: 18px; min-width: 18px; height: 18px; padding: 0; }
@@ -3570,6 +3587,14 @@ select:focus, input:focus, textarea:focus { border-color: #a77768; box-shadow: 0
3570
3587
  .model-capability-option small, .model-multimodal-note { color: var(--muted); font-size: 9px; line-height: 1.5; }
3571
3588
  .model-capability-option:has(input:checked) { border-color: color-mix(in srgb, var(--accent) 62%, var(--line)); background: color-mix(in srgb, var(--accent) 7%, var(--surface)); }
3572
3589
  .model-multimodal-note { margin: 0 2px; }
3590
+ #form-dialog:has(.model-kind-fields) { width: min(720px, 92vw); }
3591
+ #dialog-fields:has(.model-kind-fields) { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
3592
+ #dialog-fields:has(.model-kind-fields) [data-chat-model-fields] { display: contents; }
3593
+ #dialog-fields:has(.model-kind-fields) > .model-kind-fields,
3594
+ #dialog-fields:has(.model-kind-fields) > .checkbox-field,
3595
+ #dialog-fields:has(.model-kind-fields) .chip-field,
3596
+ #dialog-fields:has(.model-kind-fields) .model-multimodal-fields,
3597
+ #dialog-fields:has(.model-kind-fields) .model-connection-test { grid-column: 1 / -1; }
3573
3598
  .analysis-type-description { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
3574
3599
  .task-chapter-field { transition: opacity .15s ease; }
3575
3600
  .task-chapter-field.is-disabled { opacity: .48; }
@@ -4467,6 +4492,7 @@ select:focus, input:focus, textarea:focus { border-color: #a77768; box-shadow: 0
4467
4492
  margin: auto;
4468
4493
  border-radius: 10px;
4469
4494
  }
4495
+ #form-dialog:has(.model-kind-fields) { width: calc(100vw - 20px); max-width: calc(100vw - 20px); }
4470
4496
  .dialog-header { padding: 14px 16px 12px; }
4471
4497
  .dialog-header h2 { font-size: 20px; }
4472
4498
  .dialog-title-input { width: min(100%, calc(100vw - 100px)); font-size: 20px; }
@@ -4573,6 +4599,10 @@ select:focus, input:focus, textarea:focus { border-color: #a77768; box-shadow: 0
4573
4599
  .onboarding-popover { width: calc(100vw - 20px); }
4574
4600
  }
4575
4601
 
4602
+ @media (max-width: 480px) {
4603
+ #dialog-fields:has(.model-kind-fields) { grid-template-columns: minmax(0, 1fr); }
4604
+ }
4605
+
4576
4606
  @media (max-width: 850px) {
4577
4607
  #onboarding-menu-button { display: none; }
4578
4608
  }
package/dist/store.js CHANGED
@@ -994,6 +994,7 @@ export class Store {
994
994
  const streamIdleTimeoutValue = Number(row?.stream_idle_timeout_seconds);
995
995
  return {
996
996
  systemPrompt: String(row?.system_prompt ?? ""),
997
+ systemPromptOverride: Number(row?.system_prompt_override_enabled ?? 0) === 1,
997
998
  imageToolModelId: row?.image_tool_model_id === null || row?.image_tool_model_id === undefined
998
999
  ? null
999
1000
  : String(row.image_tool_model_id),
@@ -1008,11 +1009,13 @@ export class Store {
1008
1009
  const current = this.getPlatformAiSettings();
1009
1010
  const currentStreamIdleTimeoutSeconds = Number(current.streamIdleTimeoutSeconds);
1010
1011
  const streamIdleTimeoutSeconds = normalizeAiStreamIdleTimeoutSeconds(input.streamIdleTimeoutSeconds ?? currentStreamIdleTimeoutSeconds);
1011
- this.db.run(`INSERT INTO platform_ai_settings (id, system_prompt, image_tool_model_id, stream_idle_timeout_seconds, updated_at) VALUES (1, ?, ?, ?, ?)
1012
+ const nextOverride = input.systemPromptOverride ?? Boolean(current.systemPromptOverride);
1013
+ this.db.run(`INSERT INTO platform_ai_settings (id, system_prompt, system_prompt_override_enabled, image_tool_model_id, stream_idle_timeout_seconds, updated_at) VALUES (1, ?, ?, ?, ?, ?)
1012
1014
  ON CONFLICT(id) DO UPDATE SET system_prompt = excluded.system_prompt,
1015
+ system_prompt_override_enabled = excluded.system_prompt_override_enabled,
1013
1016
  image_tool_model_id = excluded.image_tool_model_id,
1014
1017
  stream_idle_timeout_seconds = excluded.stream_idle_timeout_seconds,
1015
- updated_at = excluded.updated_at`, input.systemPrompt ?? String(current.systemPrompt), input.imageToolModelId === undefined
1018
+ updated_at = excluded.updated_at`, input.systemPrompt ?? String(current.systemPrompt), nextOverride ? 1 : 0, input.imageToolModelId === undefined
1016
1019
  ? (current.imageToolModelId === null ? null : String(current.imageToolModelId))
1017
1020
  : input.imageToolModelId, streamIdleTimeoutSeconds, timestamp);
1018
1021
  return this.getPlatformAiSettings();
@@ -1081,6 +1084,7 @@ export class Store {
1081
1084
  return {
1082
1085
  workId,
1083
1086
  systemPrompt: String(row?.system_prompt ?? ""),
1087
+ systemPromptOverride: Number(row?.system_prompt_override_enabled ?? 0) === 1,
1084
1088
  dailyTokenQuota: row?.daily_token_quota === null || row?.daily_token_quota === undefined
1085
1089
  ? null
1086
1090
  : Math.max(1, Number(row.daily_token_quota)),
@@ -1131,6 +1135,7 @@ export class Store {
1131
1135
  const maximumAgentToolCallLimit = resolveMaxAgentToolCallLimit();
1132
1136
  const timestamp = now();
1133
1137
  const nextPrompt = input.systemPrompt ?? String(current.systemPrompt);
1138
+ const nextSystemPromptOverride = input.systemPromptOverride ?? Boolean(current.systemPromptOverride);
1134
1139
  const nextDailyTokenQuota = input.dailyTokenQuota === undefined
1135
1140
  ? (current.dailyTokenQuota === null ? null : Number(current.dailyTokenQuota))
1136
1141
  : input.dailyTokenQuota;
@@ -1156,14 +1161,15 @@ export class Store {
1156
1161
  ? (current.titleGenerationModelId ? String(current.titleGenerationModelId) : null)
1157
1162
  : input.titleGenerationModelId?.trim() || null;
1158
1163
  this.db.run(`INSERT INTO work_ai_settings (
1159
- work_id, system_prompt, daily_token_quota, monthly_token_quota, auto_run_enabled, auto_run_concurrency, auto_run_batch_limit,
1164
+ work_id, system_prompt, system_prompt_override_enabled, daily_token_quota, monthly_token_quota, auto_run_enabled, auto_run_concurrency, auto_run_batch_limit,
1160
1165
  auto_run_daily_task_limit, auto_run_failure_threshold, auto_run_stability_delay_minutes, auto_run_paused, auto_run_pause_reason,
1161
1166
  auto_run_resume_at, auto_run_consecutive_failures, book_summary_context_percent,
1162
1167
  context_compact_threshold, agent_tool_call_limit, agent_tool_call_global_multiplier,
1163
1168
  agent_tools_json, title_generation_model_id, image_tool_model_id, always_include_setting_info, updated_at
1164
- ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
1169
+ ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
1165
1170
  ON CONFLICT(work_id) DO UPDATE SET
1166
1171
  system_prompt = excluded.system_prompt,
1172
+ system_prompt_override_enabled = excluded.system_prompt_override_enabled,
1167
1173
  daily_token_quota = excluded.daily_token_quota,
1168
1174
  monthly_token_quota = excluded.monthly_token_quota,
1169
1175
  auto_run_enabled = excluded.auto_run_enabled,
@@ -1184,9 +1190,10 @@ export class Store {
1184
1190
  title_generation_model_id = excluded.title_generation_model_id,
1185
1191
  image_tool_model_id = excluded.image_tool_model_id,
1186
1192
  always_include_setting_info = excluded.always_include_setting_info,
1187
- updated_at = excluded.updated_at`, workId, nextPrompt, nextDailyTokenQuota, nextMonthlyTokenQuota, nextEnabled ? 1 : 0, Math.min(8, Math.max(1, nextConcurrency)), Math.min(200, Math.max(1, nextBatchLimit)), Math.min(10_000, Math.max(0, nextDailyTaskLimit)), Math.min(10, Math.max(1, nextFailureThreshold)), Math.min(120, Math.max(1, nextStabilityDelayMinutes)), current.autoRunPaused ? 1 : 0, String(current.autoRunPauseReason ?? ""), current.autoRunResumeAt === null ? null : String(current.autoRunResumeAt), Math.max(0, Number(current.autoRunConsecutiveFailures) || 0), Math.min(90, Math.max(1, nextBookSummaryContextPercent)), Math.min(90, Math.max(50, nextContextCompactThreshold)), Math.min(maximumAgentToolCallLimit, Math.max(5, nextAgentToolCallLimit)), Math.min(6, Math.max(1, nextAgentToolCallGlobalMultiplier)), JSON.stringify(nextAgentTools), nextTitleGenerationModelId, nextImageToolModelId, nextAlwaysIncludeSettingInfo ? 1 : 0, timestamp);
1193
+ updated_at = excluded.updated_at`, workId, nextPrompt, nextSystemPromptOverride ? 1 : 0, nextDailyTokenQuota, nextMonthlyTokenQuota, nextEnabled ? 1 : 0, Math.min(8, Math.max(1, nextConcurrency)), Math.min(200, Math.max(1, nextBatchLimit)), Math.min(10_000, Math.max(0, nextDailyTaskLimit)), Math.min(10, Math.max(1, nextFailureThreshold)), Math.min(120, Math.max(1, nextStabilityDelayMinutes)), current.autoRunPaused ? 1 : 0, String(current.autoRunPauseReason ?? ""), current.autoRunResumeAt === null ? null : String(current.autoRunResumeAt), Math.max(0, Number(current.autoRunConsecutiveFailures) || 0), Math.min(90, Math.max(1, nextBookSummaryContextPercent)), Math.min(90, Math.max(50, nextContextCompactThreshold)), Math.min(maximumAgentToolCallLimit, Math.max(5, nextAgentToolCallLimit)), Math.min(6, Math.max(1, nextAgentToolCallGlobalMultiplier)), JSON.stringify(nextAgentTools), nextTitleGenerationModelId, nextImageToolModelId, nextAlwaysIncludeSettingInfo ? 1 : 0, timestamp);
1188
1194
  this.audit(workId, "work.ai-settings.updated", "work-ai-settings", workId, {
1189
1195
  systemPromptChanged: input.systemPrompt !== undefined,
1196
+ systemPromptOverride: nextSystemPromptOverride,
1190
1197
  dailyTokenQuota: nextDailyTokenQuota,
1191
1198
  monthlyTokenQuota: nextMonthlyTokenQuota,
1192
1199
  autoRunEnabled: nextEnabled,