@crewhaus/runtime-core 0.1.7 → 0.1.8

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.
Files changed (2) hide show
  1. package/dist/index.js +9 -4
  2. package/package.json +39 -39
package/dist/index.js CHANGED
@@ -1418,7 +1418,7 @@ export async function runChatLoop(opts) {
1418
1418
  const warning = maybeBuildLoopWarning();
1419
1419
  if (warning !== null) {
1420
1420
  messages.push(warning);
1421
- await logEvent("user_message", { content: warning.content });
1421
+ await logEvent("user_message", { content: warning.content, synthetic: true });
1422
1422
  }
1423
1423
  // Synthesize the two transitions the state machine expects:
1424
1424
  // tools have already executed during the stream so we
@@ -1562,7 +1562,7 @@ export async function runChatLoop(opts) {
1562
1562
  const warning = maybeBuildLoopWarning();
1563
1563
  if (warning !== null) {
1564
1564
  messages.push(warning);
1565
- await logEvent("user_message", { content: warning.content });
1565
+ await logEvent("user_message", { content: warning.content, synthetic: true });
1566
1566
  }
1567
1567
  state = transition(state, { kind: "ToolsExecuted" });
1568
1568
  break;
@@ -1635,9 +1635,14 @@ export async function runChatLoop(opts) {
1635
1635
  state = transition(state, { kind: "RecoveryDone" });
1636
1636
  break;
1637
1637
  case "continue": {
1638
+ // Runtime-injected user_message events (this nudge, the tombstone
1639
+ // retry, and loop warnings) are marked `synthetic: true` in the
1640
+ // event log. They are NOT human turns, so they do not increment
1641
+ // runContext.turnNumber — and `crewhaus distill`'s deriveTurns
1642
+ // skips them so its turn ordinal matches the runtime + web UI.
1638
1643
  const continueMsg = "Please continue from where you left off.";
1639
1644
  messages.push({ role: "user", content: continueMsg });
1640
- await logEvent("user_message", { content: continueMsg });
1645
+ await logEvent("user_message", { content: continueMsg, synthetic: true });
1641
1646
  state = transition(state, { kind: "RecoveryDone" });
1642
1647
  break;
1643
1648
  }
@@ -1666,7 +1671,7 @@ export async function runChatLoop(opts) {
1666
1671
  }
1667
1672
  const tombstoneMsg = "[previous assistant turn was rejected as invalid; please retry]";
1668
1673
  messages.push({ role: "user", content: tombstoneMsg });
1669
- await logEvent("user_message", { content: tombstoneMsg });
1674
+ await logEvent("user_message", { content: tombstoneMsg, synthetic: true });
1670
1675
  state = transition(state, { kind: "RecoveryDone" });
1671
1676
  break;
1672
1677
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crewhaus/runtime-core",
3
- "version": "0.1.7",
3
+ "version": "0.1.8",
4
4
  "type": "module",
5
5
  "description": "Minimal runtime imported by generated harness bundles",
6
6
  "main": "dist/index.js",
@@ -16,47 +16,47 @@
16
16
  },
17
17
  "dependencies": {
18
18
  "@anthropic-ai/sdk": "^0.96.0",
19
- "@crewhaus/abort-controller": "0.1.7",
20
- "@crewhaus/adapter-anthropic": "0.1.7",
21
- "@crewhaus/agent-context-isolation": "0.1.7",
22
- "@crewhaus/boundary-classifier": "0.1.7",
23
- "@crewhaus/circuit-breaker": "0.1.7",
24
- "@crewhaus/compaction-autocompact": "0.1.7",
25
- "@crewhaus/compaction-snip": "0.1.7",
26
- "@crewhaus/cost-tracker": "0.1.7",
27
- "@crewhaus/egress-classifier": "0.1.7",
28
- "@crewhaus/errors": "0.1.7",
29
- "@crewhaus/event-log": "0.1.7",
30
- "@crewhaus/hooks-engine": "0.1.7",
31
- "@crewhaus/model-router": "0.1.7",
32
- "@crewhaus/permission-engine": "0.1.7",
33
- "@crewhaus/prompt-cache-manager": "0.1.7",
34
- "@crewhaus/prompt-injection-detector": "0.1.7",
35
- "@crewhaus/rate-limiter": "0.1.7",
36
- "@crewhaus/recovery-engine": "0.1.7",
37
- "@crewhaus/run-context": "0.1.7",
38
- "@crewhaus/session-store": "0.1.7",
39
- "@crewhaus/skills-registry": "0.1.7",
40
- "@crewhaus/slash-commands": "0.1.7",
41
- "@crewhaus/state-store": "0.1.7",
42
- "@crewhaus/tenancy": "0.1.7",
43
- "@crewhaus/token-budget": "0.1.7",
44
- "@crewhaus/tool-catalog": "0.1.7",
45
- "@crewhaus/tool-executor": "0.1.7",
46
- "@crewhaus/tool-loop-detection": "0.1.7",
47
- "@crewhaus/tool-orchestrator": "0.1.7",
48
- "@crewhaus/tool-result-store": "0.1.7",
49
- "@crewhaus/streaming-tool-executor": "0.1.7",
50
- "@crewhaus/turn-state-machine": "0.1.7",
51
- "@crewhaus/trace-event-bus": "0.1.7",
52
- "@crewhaus/structured-event-printer": "0.1.7",
53
- "@crewhaus/metrics-collector": "0.1.7",
54
- "@crewhaus/otel-exporter": "0.1.7",
19
+ "@crewhaus/abort-controller": "0.1.8",
20
+ "@crewhaus/adapter-anthropic": "0.1.8",
21
+ "@crewhaus/agent-context-isolation": "0.1.8",
22
+ "@crewhaus/boundary-classifier": "0.1.8",
23
+ "@crewhaus/circuit-breaker": "0.1.8",
24
+ "@crewhaus/compaction-autocompact": "0.1.8",
25
+ "@crewhaus/compaction-snip": "0.1.8",
26
+ "@crewhaus/cost-tracker": "0.1.8",
27
+ "@crewhaus/egress-classifier": "0.1.8",
28
+ "@crewhaus/errors": "0.1.8",
29
+ "@crewhaus/event-log": "0.1.8",
30
+ "@crewhaus/hooks-engine": "0.1.8",
31
+ "@crewhaus/model-router": "0.1.8",
32
+ "@crewhaus/permission-engine": "0.1.8",
33
+ "@crewhaus/prompt-cache-manager": "0.1.8",
34
+ "@crewhaus/prompt-injection-detector": "0.1.8",
35
+ "@crewhaus/rate-limiter": "0.1.8",
36
+ "@crewhaus/recovery-engine": "0.1.8",
37
+ "@crewhaus/run-context": "0.1.8",
38
+ "@crewhaus/session-store": "0.1.8",
39
+ "@crewhaus/skills-registry": "0.1.8",
40
+ "@crewhaus/slash-commands": "0.1.8",
41
+ "@crewhaus/state-store": "0.1.8",
42
+ "@crewhaus/tenancy": "0.1.8",
43
+ "@crewhaus/token-budget": "0.1.8",
44
+ "@crewhaus/tool-catalog": "0.1.8",
45
+ "@crewhaus/tool-executor": "0.1.8",
46
+ "@crewhaus/tool-loop-detection": "0.1.8",
47
+ "@crewhaus/tool-orchestrator": "0.1.8",
48
+ "@crewhaus/tool-result-store": "0.1.8",
49
+ "@crewhaus/streaming-tool-executor": "0.1.8",
50
+ "@crewhaus/turn-state-machine": "0.1.8",
51
+ "@crewhaus/trace-event-bus": "0.1.8",
52
+ "@crewhaus/structured-event-printer": "0.1.8",
53
+ "@crewhaus/metrics-collector": "0.1.8",
54
+ "@crewhaus/otel-exporter": "0.1.8",
55
55
  "zod-to-json-schema": "^3.23.5"
56
56
  },
57
57
  "devDependencies": {
58
- "@crewhaus/logging": "0.1.7",
59
- "@crewhaus/tool-builder": "0.1.7",
58
+ "@crewhaus/logging": "0.1.8",
59
+ "@crewhaus/tool-builder": "0.1.8",
60
60
  "zod": "^3.23.8"
61
61
  },
62
62
  "license": "Apache-2.0",