modelstat 0.0.36 → 0.0.38
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/dist/cli.mjs +34 -13
- package/dist/cli.mjs.map +1 -1
- package/package.json +3 -3
package/dist/cli.mjs
CHANGED
|
@@ -44362,7 +44362,7 @@ var COGNITION_SYSTEM_PROMPT, MAX_COGNITION_TAGS_PER_FIELD, MAX_COGNITION_TAG_CHA
|
|
|
44362
44362
|
var init_cognition = __esm({
|
|
44363
44363
|
"../../packages/companion-core/src/pipeline/cognition.ts"() {
|
|
44364
44364
|
"use strict";
|
|
44365
|
-
COGNITION_SYSTEM_PROMPT = 'You read a one-sentence summary of an AI-coding work session and identify the user\'s emotional state and meta-cognitive state. Output JSON only \u2014 first character of reply is `{`. Schema: {"emotions":[],"meta":[]}. emotions: \u2264 3 short lowercase
|
|
44365
|
+
COGNITION_SYSTEM_PROMPT = 'You read a one-sentence summary of an AI-coding work session and identify the user\'s emotional state and meta-cognitive state. Output JSON only \u2014 first character of reply is `{`. Schema: {"emotions":[],"meta":[]}. emotions: \u2264 3 short lowercase MOOD tags \u2014 how the user FEELS \u2014 such as frustrated, curious, excited, calm, confused, anxious, satisfied, proud, bored, energised, overwhelmed, confident. meta: \u2264 3 short lowercase MENTAL-MODE tags \u2014 HOW the user is THINKING, never what they are doing. Valid examples: focused, scattered, in-flow, deliberate, hurried, stuck, open, exploratory, methodical, distracted. DO NOT emit ACTIVITY verbs (debugging, refactoring, designing, reviewing, deploying, planning, documenting, implementing) under meta \u2014 those describe the WORK, not the MIND. If the only candidate tag would be an activity verb, return [] for meta instead. Each tag \u2264 24 chars, single word or hyphenated, no punctuation. Only emit a tag if the summary gives clear evidence \u2014 return [] for either field when unsure. Do not invent emotions or mental modes the user did not display. No prose, no markdown.';
|
|
44366
44366
|
MAX_COGNITION_TAGS_PER_FIELD = 3;
|
|
44367
44367
|
MAX_COGNITION_TAG_CHARS = 24;
|
|
44368
44368
|
COGNITION_MAX_TOKENS = 80;
|
|
@@ -44839,6 +44839,14 @@ function ollamaSummarize(cfg = defaultOllamaConfig()) {
|
|
|
44839
44839
|
body: JSON.stringify({
|
|
44840
44840
|
model: cfg.chatModel,
|
|
44841
44841
|
stream: false,
|
|
44842
|
+
// Disable reasoning. qwen3 (the default summariser family) is a
|
|
44843
|
+
// thinking model: with `think` on it spends the entire
|
|
44844
|
+
// `num_predict` budget on a <think> block and returns EMPTY
|
|
44845
|
+
// content, so the summariser saw "" and the whole pipeline
|
|
44846
|
+
// crash-looped at preflight. We only want the final terse
|
|
44847
|
+
// abstract, never the chain-of-thought. Ollama ignores this
|
|
44848
|
+
// field for non-thinking models, so it's safe across families.
|
|
44849
|
+
think: false,
|
|
44842
44850
|
options: {
|
|
44843
44851
|
temperature: SUMMARISER_TEMPERATURE,
|
|
44844
44852
|
num_predict: Math.min(maxTokens, SUMMARISER_MAX_TOKENS)
|
|
@@ -44868,6 +44876,10 @@ function ollamaCognize(cfg = defaultOllamaConfig()) {
|
|
|
44868
44876
|
model: cfg.chatModel,
|
|
44869
44877
|
stream: false,
|
|
44870
44878
|
format: "json",
|
|
44879
|
+
// Same reason as the summariser: no thinking budget, just the
|
|
44880
|
+
// JSON cognition tags. Thinking models otherwise emit a long
|
|
44881
|
+
// <think> block and return empty content.
|
|
44882
|
+
think: false,
|
|
44871
44883
|
options: {
|
|
44872
44884
|
temperature: COGNITION_TEMPERATURE,
|
|
44873
44885
|
num_predict: COGNITION_MAX_TOKENS
|
|
@@ -45331,12 +45343,12 @@ async function getAdapters() {
|
|
|
45331
45343
|
`[modelstat] ollama up at ${ollamaCfg.baseUrl} \u2014 using ${ollamaCfg.chatModel} for summarisation`
|
|
45332
45344
|
);
|
|
45333
45345
|
adapters = {
|
|
45334
|
-
// BGE-small via transformers.js — same model the server uses
|
|
45335
|
-
//
|
|
45336
|
-
//
|
|
45337
|
-
//
|
|
45338
|
-
//
|
|
45339
|
-
//
|
|
45346
|
+
// BGE-small via transformers.js — same model the server uses,
|
|
45347
|
+
// so segment vectors land in the same 384-dim space as
|
|
45348
|
+
// leaf-description vectors and cosine similarity is directly
|
|
45349
|
+
// meaningful. We do NOT use ollamaEmbed here because Ollama's
|
|
45350
|
+
// library doesn't host bge-small (404 on pull) and shipping
|
|
45351
|
+
// MiniLM via Ollama vs BGE-small server-side would break
|
|
45340
45352
|
// cross-source similarity.
|
|
45341
45353
|
embed: createTransformersJsEmbedder(),
|
|
45342
45354
|
summarize: ollamaSummarize(ollamaCfg),
|
|
@@ -45506,7 +45518,7 @@ var init_scan = __esm({
|
|
|
45506
45518
|
init_pipeline2();
|
|
45507
45519
|
init_config2();
|
|
45508
45520
|
init_api();
|
|
45509
|
-
AGENT_VERSION = "agent-0.0.
|
|
45521
|
+
AGENT_VERSION = "agent-0.0.38";
|
|
45510
45522
|
BATCH_MAX_EVENTS = 2e3;
|
|
45511
45523
|
}
|
|
45512
45524
|
});
|
|
@@ -47598,7 +47610,7 @@ var init_daemon = __esm({
|
|
|
47598
47610
|
init_config2();
|
|
47599
47611
|
init_lock();
|
|
47600
47612
|
init_scan();
|
|
47601
|
-
AGENT_VERSION2 = "agent-0.0.
|
|
47613
|
+
AGENT_VERSION2 = "agent-0.0.38";
|
|
47602
47614
|
HEARTBEAT_INTERVAL_MS = 1e4;
|
|
47603
47615
|
SCAN_INTERVAL_MS = 5 * 60 * 1e3;
|
|
47604
47616
|
status = {
|
|
@@ -47806,6 +47818,11 @@ ${programArgs}
|
|
|
47806
47818
|
<key>EnvironmentVariables</key>
|
|
47807
47819
|
<dict>
|
|
47808
47820
|
<key>PATH</key><string>/usr/local/bin:/opt/homebrew/bin:/usr/bin:/bin</string>
|
|
47821
|
+
<!-- Heap headroom for the startup scan of a large transcript backlog.
|
|
47822
|
+
Node's default old-space ceiling (~4 GB) OOM-crashed the daemon on
|
|
47823
|
+
big histories; raise it well below typical RAM. Inherited by the
|
|
47824
|
+
tray-spawned 'modelstat start' child too (NODE_OPTIONS propagates). -->
|
|
47825
|
+
<key>NODE_OPTIONS</key><string>--max-old-space-size=8192</string>
|
|
47809
47826
|
</dict>
|
|
47810
47827
|
<key>WorkingDirectory</key><string>${home()}</string>
|
|
47811
47828
|
</dict>
|
|
@@ -47869,6 +47886,10 @@ Wants=network-online.target
|
|
|
47869
47886
|
|
|
47870
47887
|
[Service]
|
|
47871
47888
|
Type=simple
|
|
47889
|
+
# Heap headroom for the startup scan of a large transcript backlog \u2014
|
|
47890
|
+
# Node's default ~4 GB old-space ceiling OOM-crashed the daemon on big
|
|
47891
|
+
# histories.
|
|
47892
|
+
Environment=NODE_OPTIONS=--max-old-space-size=8192
|
|
47872
47893
|
ExecStart=${nodeBinary()} ${cliPath} start
|
|
47873
47894
|
Restart=always
|
|
47874
47895
|
RestartSec=10
|
|
@@ -48023,7 +48044,7 @@ function tryOpenBrowser(url) {
|
|
|
48023
48044
|
return false;
|
|
48024
48045
|
}
|
|
48025
48046
|
}
|
|
48026
|
-
var AGENT_VERSION3 = "agent-0.0.
|
|
48047
|
+
var AGENT_VERSION3 = "agent-0.0.38";
|
|
48027
48048
|
function osFamily() {
|
|
48028
48049
|
const p = platform4();
|
|
48029
48050
|
if (p === "darwin") return "macos";
|
|
@@ -48340,7 +48361,7 @@ async function cmdWatch() {
|
|
|
48340
48361
|
}
|
|
48341
48362
|
async function cmdStart(rest) {
|
|
48342
48363
|
if (!state.bearer || !state.deviceId) {
|
|
48343
|
-
console.error("not paired yet. Run `modelstat
|
|
48364
|
+
console.error("not paired yet. Run `modelstat` first.");
|
|
48344
48365
|
process.exit(1);
|
|
48345
48366
|
}
|
|
48346
48367
|
const force = rest.includes("--force") || rest.includes("-f");
|
|
@@ -48352,7 +48373,7 @@ async function cmdStop() {
|
|
|
48352
48373
|
uninstallService();
|
|
48353
48374
|
console.log("\u2713 service stopped and uninstalled");
|
|
48354
48375
|
console.log(` Your device pairing is still in ${state.storePath}`);
|
|
48355
|
-
console.log(" Run `modelstat
|
|
48376
|
+
console.log(" Run `modelstat` again to re-enable.");
|
|
48356
48377
|
} catch (err) {
|
|
48357
48378
|
console.error(`\u2717 ${err.message}`);
|
|
48358
48379
|
process.exit(1);
|
|
@@ -48466,7 +48487,7 @@ async function cmdJobs(args) {
|
|
|
48466
48487
|
process.stdout.write(`${JSON.stringify({ paired: false, reason: "no_claim_code" })}
|
|
48467
48488
|
`);
|
|
48468
48489
|
} else {
|
|
48469
|
-
console.log("no claim code on record \u2014 run `modelstat
|
|
48490
|
+
console.log("no claim code on record \u2014 run `modelstat` first");
|
|
48470
48491
|
}
|
|
48471
48492
|
return;
|
|
48472
48493
|
}
|