@codemem/server 0.22.4 → 0.24.0

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.
package/static/app.js CHANGED
@@ -1323,6 +1323,10 @@
1323
1323
  if (metadata?.is_summary === true) return true;
1324
1324
  return String(metadata?.source || "").trim().toLowerCase() === "observer_summary";
1325
1325
  }
1326
+ function canonicalKind(item, metadata) {
1327
+ const kindValue = String(item?.kind || "").trim().toLowerCase();
1328
+ return isSummaryLikeItem(item, metadata) ? "session_summary" : kindValue || "change";
1329
+ }
1326
1330
  function observationViewData(item) {
1327
1331
  const metadata = mergeMetadata(item?.metadata_json);
1328
1332
  const summary = String(item?.subtitle || item?.body_text || "").trim();
@@ -1504,10 +1508,9 @@
1504
1508
  }, display);
1505
1509
  }
1506
1510
  function FeedItemCard({ item }) {
1507
- const kindValue = String(item.kind || "session_summary").toLowerCase();
1508
1511
  const metadata = mergeMetadata(item?.metadata_json);
1509
1512
  const isSessionSummary = isSummaryLikeItem(item, metadata);
1510
- const displayKindValue = isSessionSummary ? "session_summary" : kindValue;
1513
+ const displayKindValue = canonicalKind(item, metadata);
1511
1514
  const rowKey = itemKey(item);
1512
1515
  const defaultTitle = item.title || "(untitled)";
1513
1516
  const displayTitle = isSessionSummary && metadata?.request ? metadata.request : defaultTitle;
@@ -10360,23 +10363,27 @@ For more information, see https://radix-ui.com/primitives/docs/components/${titl
10360
10363
  displayName: String(request.display_name || request.device_id || "Pending device"),
10361
10364
  requestId: String(request.request_id || "")
10362
10365
  }));
10363
- const visibleDiscoveredRows = discoveredRows.filter((row) => row.mode !== "paired" && row.mode !== "none");
10364
- const discoveredActionableCount = visibleDiscoveredRows.filter((row) => row.mode === "accept" || row.mode === "scope-pending").length;
10366
+ const visibleDiscoveredRows = discoveredRows.filter((row) => row.mode !== "paired" && row.mode !== "none" && row.mode !== "scope-pending");
10367
+ const discoveredActionableCount = discoveredRows.filter((row) => row.mode === "accept" || row.mode === "scope-pending").length;
10365
10368
  const actionableCount = attentionItems.length + pendingJoinRequests.length + discoveredActionableCount;
10366
10369
  const attentionParts = [];
10367
10370
  if (attentionItems.length > 0) {
10368
- const deviceItems = attentionItems.filter((item) => item.kind !== "possible-duplicate-person");
10371
+ const repairItems = attentionItems.filter((item) => item.kind === "device-needs-repair");
10372
+ const nameItems = attentionItems.filter((item) => item.kind === "name-device");
10373
+ const reviewItems = attentionItems.filter((item) => item.kind === "review-team-device");
10369
10374
  const duplicateItems = attentionItems.filter((item) => item.kind === "possible-duplicate-person");
10370
- if (deviceItems.length > 0) attentionParts.push(`${deviceItems.length} device${deviceItems.length === 1 ? "" : "s"}`);
10371
- if (duplicateItems.length > 0) attentionParts.push(`${duplicateItems.length} duplicate${duplicateItems.length === 1 ? "" : "s"}`);
10375
+ if (repairItems.length > 0) attentionParts.push(`${repairItems.length} device${repairItems.length === 1 ? "" : "s"} to repair`);
10376
+ if (nameItems.length > 0) attentionParts.push(`${nameItems.length} device${nameItems.length === 1 ? "" : "s"} to name`);
10377
+ if (reviewItems.length > 0) attentionParts.push(`${reviewItems.length} device${reviewItems.length === 1 ? "" : "s"} to review`);
10378
+ if (duplicateItems.length > 0) attentionParts.push(`${duplicateItems.length} possible duplicate${duplicateItems.length === 1 ? "" : "s"}`);
10372
10379
  }
10373
- if (pendingJoinRequests.length > 0) attentionParts.push(`${pendingJoinRequests.length} join request${pendingJoinRequests.length === 1 ? "" : "s"}`);
10374
- if (discoveredActionableCount > 0) attentionParts.push(`${discoveredActionableCount} discovered`);
10380
+ if (pendingJoinRequests.length > 0) attentionParts.push(`${pendingJoinRequests.length} join request${pendingJoinRequests.length === 1 ? "" : "s"} to review`);
10381
+ if (discoveredActionableCount > 0) attentionParts.push(`${discoveredActionableCount} discovered device${discoveredActionableCount === 1 ? "" : "s"}`);
10375
10382
  const attentionDetail = attentionParts.join(", ");
10376
10383
  const teamLabel = (coordinator.groups || []).join(", ") || "none";
10377
10384
  const statusSummary = {
10378
10385
  badgeClassName: `pill ${presenceStatus === "posted" ? "pill-success" : presenceStatus === "not_enrolled" ? "pill-warning" : "pill-error"}`,
10379
- headline: presenceStatus === "posted" ? actionableCount > 0 ? `${attentionDetail} need${actionableCount === 1 ? "s" : ""} attention` : "Everything is healthy" : presenceStatus === "not_enrolled" ? "This device is not enrolled in the team yet" : "Sync needs attention",
10386
+ headline: presenceStatus === "posted" ? actionableCount > 0 ? attentionDetail : "Everything is healthy" : presenceStatus === "not_enrolled" ? "This device is not enrolled in the team yet" : "Sync needs attention",
10380
10387
  metricsText: metricParts.join(" · "),
10381
10388
  presenceLabel
10382
10389
  };
@@ -11733,6 +11740,15 @@ For more information, see https://radix-ui.com/primitives/docs/components/${titl
11733
11740
  claudeCommand: "claude_command",
11734
11741
  observerProvider: "observer_provider",
11735
11742
  observerModel: "observer_model",
11743
+ observerTierRoutingEnabled: "observer_tier_routing_enabled",
11744
+ observerSimpleModel: "observer_simple_model",
11745
+ observerSimpleTemperature: "observer_simple_temperature",
11746
+ observerRichModel: "observer_rich_model",
11747
+ observerRichTemperature: "observer_rich_temperature",
11748
+ observerRichOpenAIUseResponses: "observer_rich_openai_use_responses",
11749
+ observerRichReasoningEffort: "observer_rich_reasoning_effort",
11750
+ observerRichReasoningSummary: "observer_rich_reasoning_summary",
11751
+ observerRichMaxOutputTokens: "observer_rich_max_output_tokens",
11736
11752
  observerRuntime: "observer_runtime",
11737
11753
  observerAuthSource: "observer_auth_source",
11738
11754
  observerAuthFile: "observer_auth_file",
@@ -11774,6 +11790,15 @@ For more information, see https://radix-ui.com/primitives/docs/components/${titl
11774
11790
  claudeCommand: "",
11775
11791
  observerProvider: "",
11776
11792
  observerModel: "",
11793
+ observerTierRoutingEnabled: false,
11794
+ observerSimpleModel: "",
11795
+ observerSimpleTemperature: "",
11796
+ observerRichModel: "",
11797
+ observerRichTemperature: "",
11798
+ observerRichOpenAIUseResponses: false,
11799
+ observerRichReasoningEffort: "",
11800
+ observerRichReasoningSummary: "",
11801
+ observerRichMaxOutputTokens: "",
11777
11802
  observerRuntime: "api_http",
11778
11803
  observerAuthSource: "auto",
11779
11804
  observerAuthFile: "",
@@ -11819,6 +11844,27 @@ For more information, see https://radix-ui.com/primitives/docs/components/${titl
11819
11844
  if (value === void 0 || value === null) return "";
11820
11845
  return String(value);
11821
11846
  }
11847
+ function asBooleanValue(value) {
11848
+ if (typeof value === "boolean") return value;
11849
+ if (typeof value === "number") return value !== 0;
11850
+ if (typeof value === "string") {
11851
+ const normalized = value.trim().toLowerCase();
11852
+ if (!normalized) return false;
11853
+ if ([
11854
+ "0",
11855
+ "false",
11856
+ "no",
11857
+ "off"
11858
+ ].includes(normalized)) return false;
11859
+ if ([
11860
+ "1",
11861
+ "true",
11862
+ "yes",
11863
+ "on"
11864
+ ].includes(normalized)) return true;
11865
+ }
11866
+ return Boolean(value);
11867
+ }
11822
11868
  function toProviderList(value) {
11823
11869
  if (!Array.isArray(value)) return [];
11824
11870
  return value.filter((item) => typeof item === "string" && item.trim().length > 0);
@@ -11872,6 +11918,10 @@ For more information, see https://radix-ui.com/primitives/docs/components/${titl
11872
11918
  }
11873
11919
  case "observer_provider":
11874
11920
  case "observer_model":
11921
+ case "observer_simple_model":
11922
+ case "observer_rich_model":
11923
+ case "observer_rich_reasoning_effort":
11924
+ case "observer_rich_reasoning_summary":
11875
11925
  case "observer_auth_file":
11876
11926
  case "sync_host":
11877
11927
  case "sync_coordinator_url":
@@ -11894,6 +11944,9 @@ For more information, see https://radix-ui.com/primitives/docs/components/${titl
11894
11944
  }
11895
11945
  case "observer_auth_timeout_ms":
11896
11946
  case "observer_max_chars":
11947
+ case "observer_simple_temperature":
11948
+ case "observer_rich_temperature":
11949
+ case "observer_rich_max_output_tokens":
11897
11950
  case "pack_observation_limit":
11898
11951
  case "pack_session_limit":
11899
11952
  case "raw_events_sweeper_interval_s":
@@ -11915,7 +11968,9 @@ For more information, see https://radix-ui.com/primitives/docs/components/${titl
11915
11968
  return Number.isFinite(parsed) ? parsed : "";
11916
11969
  }
11917
11970
  case "sync_enabled":
11918
- case "sync_mdns": return Boolean(config?.[key]);
11971
+ case "sync_mdns":
11972
+ case "observer_tier_routing_enabled":
11973
+ case "observer_rich_openai_use_responses": return asBooleanValue(config?.[key]);
11919
11974
  default: return hasOwn(config, key) ? config[key] : "";
11920
11975
  }
11921
11976
  }
@@ -11928,6 +11983,7 @@ For more information, see https://radix-ui.com/primitives/docs/components/${titl
11928
11983
  }
11929
11984
  function getObserverModelHint() {
11930
11985
  const values = settingsRenderState.values;
11986
+ if (values.observerTierRoutingEnabled) return "Tiered routing is enabled: simple/rich model selection now lives in Processing.";
11931
11987
  const inferred = inferObserverModel(values.observerRuntime.trim() || "api_http", values.observerProvider.trim(), normalizeTextValue(values.observerModel));
11932
11988
  return `${[
11933
11989
  "observer_model",
@@ -11935,6 +11991,19 @@ For more information, see https://radix-ui.com/primitives/docs/components/${titl
11935
11991
  "observer_runtime"
11936
11992
  ].some((key) => hasOwn(settingsEnvOverrides, key)) ? "Env override" : inferred.source}: ${inferred.model}`;
11937
11993
  }
11994
+ function getTieredRoutingHelperText() {
11995
+ if (!settingsRenderState.values.observerTierRoutingEnabled) return "Off: codemem uses the base observer settings from the Connection tab for all batches.";
11996
+ return "On: codemem can route simpler batches to a lighter model and richer batches to a higher-quality configuration.";
11997
+ }
11998
+ function getObserverModelLabel() {
11999
+ return settingsRenderState.values.observerTierRoutingEnabled ? "Base model fallback" : "Model";
12000
+ }
12001
+ function getObserverModelTooltip() {
12002
+ return settingsRenderState.values.observerTierRoutingEnabled ? "Tiered routing is enabled, so Processing controls the simple/rich models. This base model is only a fallback." : "Leave blank to use a recommended model for your selected mode/provider.";
12003
+ }
12004
+ function getObserverModelDescription() {
12005
+ return settingsRenderState.values.observerTierRoutingEnabled ? "Tiered routing is active. Use this only as a fallback while the Processing tab owns simple/rich model selection." : "Default: `gpt-5.1-codex-mini` for Direct API; `claude-4.5-haiku` for Local Claude session.";
12006
+ }
11938
12007
  function positionHelpTooltipElement(el, anchor) {
11939
12008
  const rect = anchor.getBoundingClientRect();
11940
12009
  const margin = 8;
@@ -12266,6 +12335,15 @@ For more information, see https://radix-ui.com/primitives/docs/components/${titl
12266
12335
  claudeCommand: claudeCommand.length ? JSON.stringify(claudeCommand, null, 2) : "",
12267
12336
  observerProvider: asInputString(effectiveOrConfigured(config, effective, "observer_provider")),
12268
12337
  observerModel: asInputString(effectiveOrConfigured(config, effective, "observer_model")),
12338
+ observerTierRoutingEnabled: asBooleanValue(effectiveOrConfigured(config, effective, "observer_tier_routing_enabled")),
12339
+ observerSimpleModel: asInputString(effectiveOrConfigured(config, effective, "observer_simple_model")),
12340
+ observerSimpleTemperature: asInputString(effectiveOrConfigured(config, effective, "observer_simple_temperature")),
12341
+ observerRichModel: asInputString(effectiveOrConfigured(config, effective, "observer_rich_model")),
12342
+ observerRichTemperature: asInputString(effectiveOrConfigured(config, effective, "observer_rich_temperature")),
12343
+ observerRichOpenAIUseResponses: asBooleanValue(effectiveOrConfigured(config, effective, "observer_rich_openai_use_responses")),
12344
+ observerRichReasoningEffort: asInputString(effectiveOrConfigured(config, effective, "observer_rich_reasoning_effort")),
12345
+ observerRichReasoningSummary: asInputString(effectiveOrConfigured(config, effective, "observer_rich_reasoning_summary")),
12346
+ observerRichMaxOutputTokens: asInputString(effectiveOrConfigured(config, effective, "observer_rich_max_output_tokens")),
12269
12347
  observerRuntime: asInputString(effectiveOrConfigured(config, effective, "observer_runtime")) || "api_http",
12270
12348
  observerAuthSource: asInputString(effectiveOrConfigured(config, effective, "observer_auth_source")) || "auto",
12271
12349
  observerAuthFile: asInputString(effectiveOrConfigured(config, effective, "observer_auth_file")),
@@ -12277,11 +12355,11 @@ For more information, see https://radix-ui.com/primitives/docs/components/${titl
12277
12355
  packObservationLimit: asInputString(effectiveOrConfigured(config, effective, "pack_observation_limit")),
12278
12356
  packSessionLimit: asInputString(effectiveOrConfigured(config, effective, "pack_session_limit")),
12279
12357
  rawEventsSweeperIntervalS: asInputString(effectiveOrConfigured(config, effective, "raw_events_sweeper_interval_s")),
12280
- syncEnabled: Boolean(effectiveOrConfigured(config, effective, "sync_enabled")),
12358
+ syncEnabled: asBooleanValue(effectiveOrConfigured(config, effective, "sync_enabled")),
12281
12359
  syncHost: asInputString(effectiveOrConfigured(config, effective, "sync_host")),
12282
12360
  syncPort: asInputString(effectiveOrConfigured(config, effective, "sync_port")),
12283
12361
  syncInterval: asInputString(effectiveOrConfigured(config, effective, "sync_interval_s")),
12284
- syncMdns: Boolean(effectiveOrConfigured(config, effective, "sync_mdns")),
12362
+ syncMdns: asBooleanValue(effectiveOrConfigured(config, effective, "sync_mdns")),
12285
12363
  syncCoordinatorUrl: asInputString(effectiveOrConfigured(config, effective, "sync_coordinator_url")),
12286
12364
  syncCoordinatorGroup: asInputString(effectiveOrConfigured(config, effective, "sync_coordinator_group")),
12287
12365
  syncCoordinatorTimeout: asInputString(effectiveOrConfigured(config, effective, "sync_coordinator_timeout_s")),
@@ -12371,16 +12449,34 @@ For more information, see https://radix-ui.com/primitives/docs/components/${titl
12371
12449
  });
12372
12450
  }
12373
12451
  const authCacheTtlInput = values.observerAuthCacheTtlS.trim();
12452
+ const simpleTemperatureInput = values.observerSimpleTemperature.trim();
12453
+ const richTemperatureInput = values.observerRichTemperature.trim();
12454
+ const richMaxOutputTokensInput = values.observerRichMaxOutputTokens.trim();
12374
12455
  const sweeperIntervalInput = values.rawEventsSweeperIntervalS.trim();
12375
12456
  const authCacheTtl = authCacheTtlInput === "" ? "" : Number(authCacheTtlInput);
12457
+ const simpleTemperature = simpleTemperatureInput === "" ? "" : Number(simpleTemperatureInput);
12458
+ const richTemperature = richTemperatureInput === "" ? "" : Number(richTemperatureInput);
12459
+ const richMaxOutputTokens = richMaxOutputTokensInput === "" ? "" : Number(richMaxOutputTokensInput);
12376
12460
  const sweeperIntervalNum = Number(sweeperIntervalInput);
12377
12461
  const sweeperInterval = sweeperIntervalInput === "" ? "" : sweeperIntervalNum;
12378
12462
  if (authCacheTtlInput !== "" && !Number.isFinite(authCacheTtl)) throw new Error("observer auth cache ttl must be a number");
12463
+ if (simpleTemperatureInput !== "" && (typeof simpleTemperature !== "number" || !Number.isFinite(simpleTemperature) || simpleTemperature < 0)) throw new Error("simple tier temperature must be a non-negative number");
12464
+ if (richTemperatureInput !== "" && (typeof richTemperature !== "number" || !Number.isFinite(richTemperature) || richTemperature < 0)) throw new Error("rich tier temperature must be a non-negative number");
12465
+ if (richMaxOutputTokensInput !== "" && (typeof richMaxOutputTokens !== "number" || !Number.isFinite(richMaxOutputTokens) || richMaxOutputTokens <= 0 || !Number.isInteger(richMaxOutputTokens))) throw new Error("rich tier max output tokens must be a positive integer");
12379
12466
  if (sweeperIntervalInput !== "" && (!Number.isFinite(sweeperIntervalNum) || sweeperIntervalNum <= 0)) throw new Error("raw-event sweeper interval must be a positive number");
12380
12467
  return {
12381
12468
  claude_command: claudeCommand,
12382
12469
  observer_provider: normalizeTextValue(values.observerProvider),
12383
12470
  observer_model: normalizeTextValue(values.observerModel),
12471
+ observer_tier_routing_enabled: values.observerTierRoutingEnabled,
12472
+ observer_simple_model: normalizeTextValue(values.observerSimpleModel),
12473
+ observer_simple_temperature: simpleTemperature,
12474
+ observer_rich_model: normalizeTextValue(values.observerRichModel),
12475
+ observer_rich_temperature: richTemperature,
12476
+ observer_rich_openai_use_responses: values.observerRichOpenAIUseResponses,
12477
+ observer_rich_reasoning_effort: normalizeTextValue(values.observerRichReasoningEffort),
12478
+ observer_rich_reasoning_summary: normalizeTextValue(values.observerRichReasoningSummary),
12479
+ observer_rich_max_output_tokens: richMaxOutputTokens,
12384
12480
  observer_runtime: normalizeTextValue(values.observerRuntime || "api_http") || "api_http",
12385
12481
  observer_auth_source: normalizeTextValue(values.observerAuthSource || "auto") || "auto",
12386
12482
  observer_auth_file: normalizeTextValue(values.observerAuthFile),
@@ -12650,6 +12746,7 @@ For more information, see https://radix-ui.com/primitives/docs/components/${titl
12650
12746
  const observerMaxCharsDefault = state.configDefaults?.observer_max_chars || "";
12651
12747
  const showAuthFile = values.observerAuthSource === "file";
12652
12748
  const showAuthCommand = values.observerAuthSource === "command";
12749
+ const showTieredRouting = values.observerTierRoutingEnabled;
12653
12750
  return /* @__PURE__ */ u("div", {
12654
12751
  className: "modal-card",
12655
12752
  children: [
@@ -12787,11 +12884,11 @@ For more information, see https://radix-ui.com/primitives/docs/components/${titl
12787
12884
  className: "field-label",
12788
12885
  children: [/* @__PURE__ */ u("label", {
12789
12886
  htmlFor: "observerModel",
12790
- children: "Model"
12887
+ children: getObserverModelLabel()
12791
12888
  }), /* @__PURE__ */ u("button", {
12792
12889
  "aria-label": "About model defaults",
12793
12890
  className: "help-icon",
12794
- "data-tooltip": "Leave blank to use a recommended model for your selected mode/provider.",
12891
+ "data-tooltip": getObserverModelTooltip(),
12795
12892
  type: "button",
12796
12893
  children: "?"
12797
12894
  })]
@@ -12804,7 +12901,7 @@ For more information, see https://radix-ui.com/primitives/docs/components/${titl
12804
12901
  }),
12805
12902
  /* @__PURE__ */ u("div", {
12806
12903
  className: "small",
12807
- children: "Default: `gpt-5.1-codex-mini` for Direct API; `claude-4.5-haiku` for Local Claude session."
12904
+ children: getObserverModelDescription()
12808
12905
  }),
12809
12906
  /* @__PURE__ */ u("div", {
12810
12907
  className: "small",
@@ -13064,89 +13161,259 @@ For more information, see https://radix-ui.com/primitives/docs/components/${titl
13064
13161
  "data-settings-panel": "queue",
13065
13162
  hidden: settingsActiveTab !== "queue",
13066
13163
  id: "settingsPanelQueue",
13067
- children: [/* @__PURE__ */ u("div", {
13068
- className: "settings-group",
13069
- children: [/* @__PURE__ */ u("h3", {
13070
- className: "settings-group-title",
13071
- children: "Processing"
13072
- }), /* @__PURE__ */ u(Field, { children: [
13073
- /* @__PURE__ */ u("div", {
13074
- className: "field-label",
13075
- children: [/* @__PURE__ */ u("label", {
13076
- htmlFor: "rawEventsSweeperIntervalS",
13077
- children: "Background processing interval (seconds)"
13078
- }), /* @__PURE__ */ u("button", {
13079
- "aria-label": "About background processing interval",
13080
- className: "help-icon",
13081
- "data-tooltip": "How often codemem checks for queued events to process in the background.",
13082
- type: "button",
13083
- children: "?"
13084
- })]
13085
- }),
13086
- /* @__PURE__ */ u("input", {
13087
- id: "rawEventsSweeperIntervalS",
13088
- min: "1",
13089
- onInput: onTextInput("rawEventsSweeperIntervalS"),
13090
- type: "number",
13091
- value: values.rawEventsSweeperIntervalS
13092
- }),
13093
- /* @__PURE__ */ u("div", {
13094
- className: "small",
13095
- children: "How often background flush checks pending raw events."
13096
- })
13097
- ] })]
13098
- }), /* @__PURE__ */ u("div", {
13099
- className: "settings-group settings-advanced",
13100
- hidden: hiddenUnlessAdvanced(),
13101
- children: [
13102
- /* @__PURE__ */ u("h3", {
13164
+ children: [
13165
+ /* @__PURE__ */ u("div", {
13166
+ className: "settings-group",
13167
+ children: [/* @__PURE__ */ u("h3", {
13103
13168
  className: "settings-group-title",
13104
- children: "Context Pack Limits"
13105
- }),
13106
- /* @__PURE__ */ u(Field, {
13107
- className: "field settings-advanced",
13108
- hidden: hiddenUnlessAdvanced(),
13109
- children: [
13110
- /* @__PURE__ */ u("label", {
13111
- htmlFor: "packObservationLimit",
13112
- children: "Observation limit"
13113
- }),
13114
- /* @__PURE__ */ u("input", {
13115
- id: "packObservationLimit",
13116
- min: "1",
13117
- onInput: onTextInput("packObservationLimit"),
13169
+ children: "Processing"
13170
+ }), /* @__PURE__ */ u(Field, { children: [
13171
+ /* @__PURE__ */ u("div", {
13172
+ className: "field-label",
13173
+ children: [/* @__PURE__ */ u("label", {
13174
+ htmlFor: "rawEventsSweeperIntervalS",
13175
+ children: "Background processing interval (seconds)"
13176
+ }), /* @__PURE__ */ u("button", {
13177
+ "aria-label": "About background processing interval",
13178
+ className: "help-icon",
13179
+ "data-tooltip": "How often codemem checks for queued events to process in the background.",
13180
+ type: "button",
13181
+ children: "?"
13182
+ })]
13183
+ }),
13184
+ /* @__PURE__ */ u("input", {
13185
+ id: "rawEventsSweeperIntervalS",
13186
+ min: "1",
13187
+ onInput: onTextInput("rawEventsSweeperIntervalS"),
13188
+ type: "number",
13189
+ value: values.rawEventsSweeperIntervalS
13190
+ }),
13191
+ /* @__PURE__ */ u("div", {
13192
+ className: "small",
13193
+ children: "How often background flush checks pending raw events."
13194
+ })
13195
+ ] })]
13196
+ }),
13197
+ /* @__PURE__ */ u("div", {
13198
+ className: "settings-group",
13199
+ children: [
13200
+ /* @__PURE__ */ u("h3", {
13201
+ className: "settings-group-title",
13202
+ children: "Tiered observer routing"
13203
+ }),
13204
+ /* @__PURE__ */ u("div", {
13205
+ className: "field field-checkbox",
13206
+ children: [/* @__PURE__ */ u("input", {
13207
+ checked: values.observerTierRoutingEnabled,
13208
+ className: "cm-checkbox",
13209
+ id: "observerTierRoutingEnabled",
13210
+ onChange: onCheckboxInput("observerTierRoutingEnabled"),
13211
+ type: "checkbox"
13212
+ }), /* @__PURE__ */ u("label", {
13213
+ htmlFor: "observerTierRoutingEnabled",
13214
+ children: "Enable tiered routing"
13215
+ })]
13216
+ }),
13217
+ /* @__PURE__ */ u("div", {
13218
+ className: "small",
13219
+ children: getTieredRoutingHelperText()
13220
+ }),
13221
+ /* @__PURE__ */ u(Field, {
13222
+ hidden: !showTieredRouting,
13223
+ children: [
13224
+ /* @__PURE__ */ u("div", {
13225
+ className: "field-label",
13226
+ children: [/* @__PURE__ */ u("label", {
13227
+ htmlFor: "observerSimpleModel",
13228
+ children: "Simple tier model"
13229
+ }), /* @__PURE__ */ u("button", {
13230
+ "aria-label": "About simple tier model",
13231
+ className: "help-icon",
13232
+ "data-tooltip": "Used for lighter replay batches. Leave blank to keep codemem's routing defaults or base observer fallback.",
13233
+ type: "button",
13234
+ children: "?"
13235
+ })]
13236
+ }),
13237
+ /* @__PURE__ */ u("input", {
13238
+ id: "observerSimpleModel",
13239
+ onInput: onTextInput("observerSimpleModel"),
13240
+ placeholder: "leave empty for default",
13241
+ value: values.observerSimpleModel
13242
+ }),
13243
+ /* @__PURE__ */ u("div", {
13244
+ className: "small",
13245
+ children: "Used when a batch falls below rich-routing thresholds."
13246
+ })
13247
+ ]
13248
+ }),
13249
+ /* @__PURE__ */ u(Field, {
13250
+ hidden: !showTieredRouting,
13251
+ children: [
13252
+ /* @__PURE__ */ u("div", {
13253
+ className: "field-label",
13254
+ children: [/* @__PURE__ */ u("label", {
13255
+ htmlFor: "observerRichModel",
13256
+ children: "Rich tier model"
13257
+ }), /* @__PURE__ */ u("button", {
13258
+ "aria-label": "About rich tier model",
13259
+ className: "help-icon",
13260
+ "data-tooltip": "Used for larger or more complex replay batches. Leave blank to keep codemem's rich-tier defaults.",
13261
+ type: "button",
13262
+ children: "?"
13263
+ })]
13264
+ }),
13265
+ /* @__PURE__ */ u("input", {
13266
+ id: "observerRichModel",
13267
+ onInput: onTextInput("observerRichModel"),
13268
+ placeholder: "leave empty for default",
13269
+ value: values.observerRichModel
13270
+ }),
13271
+ /* @__PURE__ */ u("div", {
13272
+ className: "small",
13273
+ children: "Used when routing detects a richer replay batch."
13274
+ })
13275
+ ]
13276
+ }),
13277
+ /* @__PURE__ */ u(Field, {
13278
+ className: "field field-checkbox",
13279
+ hidden: !showTieredRouting,
13280
+ children: [/* @__PURE__ */ u("input", {
13281
+ checked: values.observerRichOpenAIUseResponses,
13282
+ className: "cm-checkbox",
13283
+ id: "observerRichOpenAIUseResponses",
13284
+ onChange: onCheckboxInput("observerRichOpenAIUseResponses"),
13285
+ type: "checkbox"
13286
+ }), /* @__PURE__ */ u("label", {
13287
+ htmlFor: "observerRichOpenAIUseResponses",
13288
+ children: "Use OpenAI Responses API for rich tier"
13289
+ })]
13290
+ }),
13291
+ /* @__PURE__ */ u(Field, {
13292
+ className: "field settings-advanced",
13293
+ hidden: !showTieredRouting || hiddenUnlessAdvanced(),
13294
+ children: [/* @__PURE__ */ u("label", {
13295
+ htmlFor: "observerSimpleTemperature",
13296
+ children: "Simple tier temperature"
13297
+ }), /* @__PURE__ */ u("input", {
13298
+ id: "observerSimpleTemperature",
13299
+ min: "0",
13300
+ onInput: onTextInput("observerSimpleTemperature"),
13301
+ step: "0.1",
13118
13302
  type: "number",
13119
- value: values.packObservationLimit
13120
- }),
13121
- /* @__PURE__ */ u("div", {
13122
- className: "small",
13123
- children: "Default number of observations to include in a pack."
13124
- })
13125
- ]
13126
- }),
13127
- /* @__PURE__ */ u(Field, {
13128
- className: "field settings-advanced",
13129
- hidden: hiddenUnlessAdvanced(),
13130
- children: [
13131
- /* @__PURE__ */ u("label", {
13132
- htmlFor: "packSessionLimit",
13133
- children: "Session summary limit"
13134
- }),
13135
- /* @__PURE__ */ u("input", {
13136
- id: "packSessionLimit",
13303
+ value: values.observerSimpleTemperature
13304
+ })]
13305
+ }),
13306
+ /* @__PURE__ */ u(Field, {
13307
+ className: "field settings-advanced",
13308
+ hidden: !showTieredRouting || hiddenUnlessAdvanced(),
13309
+ children: [/* @__PURE__ */ u("label", {
13310
+ htmlFor: "observerRichTemperature",
13311
+ children: "Rich tier temperature"
13312
+ }), /* @__PURE__ */ u("input", {
13313
+ id: "observerRichTemperature",
13314
+ min: "0",
13315
+ onInput: onTextInput("observerRichTemperature"),
13316
+ step: "0.1",
13317
+ type: "number",
13318
+ value: values.observerRichTemperature
13319
+ })]
13320
+ }),
13321
+ /* @__PURE__ */ u(Field, {
13322
+ className: "field settings-advanced",
13323
+ hidden: !showTieredRouting || hiddenUnlessAdvanced(),
13324
+ children: [/* @__PURE__ */ u("label", {
13325
+ htmlFor: "observerRichReasoningEffort",
13326
+ children: "Rich tier reasoning effort"
13327
+ }), /* @__PURE__ */ u("input", {
13328
+ id: "observerRichReasoningEffort",
13329
+ onInput: onTextInput("observerRichReasoningEffort"),
13330
+ placeholder: "leave empty for default",
13331
+ value: values.observerRichReasoningEffort
13332
+ })]
13333
+ }),
13334
+ /* @__PURE__ */ u(Field, {
13335
+ className: "field settings-advanced",
13336
+ hidden: !showTieredRouting || hiddenUnlessAdvanced(),
13337
+ children: [/* @__PURE__ */ u("label", {
13338
+ htmlFor: "observerRichReasoningSummary",
13339
+ children: "Rich tier reasoning summary"
13340
+ }), /* @__PURE__ */ u("input", {
13341
+ id: "observerRichReasoningSummary",
13342
+ onInput: onTextInput("observerRichReasoningSummary"),
13343
+ placeholder: "leave empty for default",
13344
+ value: values.observerRichReasoningSummary
13345
+ })]
13346
+ }),
13347
+ /* @__PURE__ */ u(Field, {
13348
+ className: "field settings-advanced",
13349
+ hidden: !showTieredRouting || hiddenUnlessAdvanced(),
13350
+ children: [/* @__PURE__ */ u("label", {
13351
+ htmlFor: "observerRichMaxOutputTokens",
13352
+ children: "Rich tier max output tokens"
13353
+ }), /* @__PURE__ */ u("input", {
13354
+ id: "observerRichMaxOutputTokens",
13137
13355
  min: "1",
13138
- onInput: onTextInput("packSessionLimit"),
13356
+ onInput: onTextInput("observerRichMaxOutputTokens"),
13357
+ step: "1",
13139
13358
  type: "number",
13140
- value: values.packSessionLimit
13141
- }),
13142
- /* @__PURE__ */ u("div", {
13143
- className: "small",
13144
- children: "Default number of session summaries to include in a pack."
13145
- })
13146
- ]
13147
- })
13148
- ]
13149
- })]
13359
+ value: values.observerRichMaxOutputTokens
13360
+ })]
13361
+ })
13362
+ ]
13363
+ }),
13364
+ /* @__PURE__ */ u("div", {
13365
+ className: "settings-group settings-advanced",
13366
+ hidden: hiddenUnlessAdvanced(),
13367
+ children: [
13368
+ /* @__PURE__ */ u("h3", {
13369
+ className: "settings-group-title",
13370
+ children: "Context Pack Limits"
13371
+ }),
13372
+ /* @__PURE__ */ u(Field, {
13373
+ className: "field settings-advanced",
13374
+ hidden: hiddenUnlessAdvanced(),
13375
+ children: [
13376
+ /* @__PURE__ */ u("label", {
13377
+ htmlFor: "packObservationLimit",
13378
+ children: "Observation limit"
13379
+ }),
13380
+ /* @__PURE__ */ u("input", {
13381
+ id: "packObservationLimit",
13382
+ min: "1",
13383
+ onInput: onTextInput("packObservationLimit"),
13384
+ type: "number",
13385
+ value: values.packObservationLimit
13386
+ }),
13387
+ /* @__PURE__ */ u("div", {
13388
+ className: "small",
13389
+ children: "Default number of observations to include in a pack."
13390
+ })
13391
+ ]
13392
+ }),
13393
+ /* @__PURE__ */ u(Field, {
13394
+ className: "field settings-advanced",
13395
+ hidden: hiddenUnlessAdvanced(),
13396
+ children: [
13397
+ /* @__PURE__ */ u("label", {
13398
+ htmlFor: "packSessionLimit",
13399
+ children: "Session summary limit"
13400
+ }),
13401
+ /* @__PURE__ */ u("input", {
13402
+ id: "packSessionLimit",
13403
+ min: "1",
13404
+ onInput: onTextInput("packSessionLimit"),
13405
+ type: "number",
13406
+ value: values.packSessionLimit
13407
+ }),
13408
+ /* @__PURE__ */ u("div", {
13409
+ className: "small",
13410
+ children: "Default number of session summaries to include in a pack."
13411
+ })
13412
+ ]
13413
+ })
13414
+ ]
13415
+ })
13416
+ ]
13150
13417
  }),
13151
13418
  /* @__PURE__ */ u("div", {
13152
13419
  className: panelClass("sync"),
@@ -13353,7 +13620,7 @@ For more information, see https://radix-ui.com/primitives/docs/components/${titl
13353
13620
  try {
13354
13621
  const runtime = await loadRuntimeInfo();
13355
13622
  if (!runtime?.version) return;
13356
- setRuntimeLabel(runtime.version, "23ef706");
13623
+ setRuntimeLabel(runtime.version, "dfc218f");
13357
13624
  } catch {}
13358
13625
  }
13359
13626
  var lastAnnouncedRefreshState = null;