fraim-hub 2.0.241 → 2.0.242

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.
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CODEX_SKILL_FRONTMATTER = exports.FRAIM_INVOCATION_BODY = exports.FRAIM_DEFERRED_TOOL_PRELOAD = exports.CURSOR_MDC_FRONTMATTER = exports.FRAIM_LAUNCH_PHRASE = void 0;
3
+ exports.CODEX_SKILL_FRONTMATTER = exports.FRAIM_INVOCATION_BODY = exports.FRAIM_MCP_UNAVAILABLE_MANAGER_GUIDANCE = exports.FRAIM_DEFERRED_TOOL_PRELOAD = exports.CURSOR_MDC_FRONTMATTER = exports.FRAIM_LAUNCH_PHRASE = void 0;
4
4
  exports.buildFraimInvocationBody = buildFraimInvocationBody;
5
5
  exports.buildClaudeSkillContent = buildClaudeSkillContent;
6
6
  exports.buildClaudeCommandShimContent = buildClaudeCommandShimContent;
@@ -25,6 +25,12 @@ exports.FRAIM_DEFERRED_TOOL_PRELOAD = [
25
25
  'get_fraim_file',
26
26
  'seekMentoring'
27
27
  ];
28
+ exports.FRAIM_MCP_UNAVAILABLE_MANAGER_GUIDANCE = [
29
+ 'If required FRAIM MCP tools remain unavailable after the deferred-tool preload/retry step, stop the FRAIM job.',
30
+ 'Do not continue from memory, local stubs, cached instructions, or prior context.',
31
+ 'In the blocker sentence, state only the work-focused blocker and what outcome is blocked; do not narrate ToolSearch/tool_search, individual tool names, server internals, or retry mechanics.',
32
+ 'Always help troubleshoot the unavailable FRAIM MCP connection: tell the user to reconnect or enable the FRAIM MCP server in their IDE/agent, restart or refresh the agent session, retry the FRAIM job, and if it still fails run `fraim doctor --test-mcp` and share the failing check output.'
33
+ ].join(' ');
28
34
  function buildDeferredToolBootstrapSection(profile) {
29
35
  if (profile === 'none') {
30
36
  return '';
@@ -72,6 +78,7 @@ ${buildDeferredToolBootstrapSection(profile)}1. **Confirm FRAIM activation**:
72
78
  5. **Execute**:
73
79
  - For jobs, follow the phased instructions and use \`seekMentoring\` when the job requires phase transitions.
74
80
  - For skills, apply the skill steps directly to the user's current context.
81
+ - ${exports.FRAIM_MCP_UNAVAILABLE_MANAGER_GUIDANCE}
75
82
  `;
76
83
  }
77
84
  exports.FRAIM_INVOCATION_BODY = buildFraimInvocationBody();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fraim-hub",
3
- "version": "2.0.241",
3
+ "version": "2.0.242",
4
4
  "description": "FRAIM Hub local companion package.",
5
5
  "bin": {
6
6
  "fraim-hub": "bin/fraim-hub.js",
@@ -161,7 +161,7 @@
161
161
  "electron": "^41.2.2",
162
162
  "electron-updater": "^6.8.9",
163
163
  "express": "^5.2.1",
164
- "fraim": "2.0.241",
164
+ "fraim": "2.0.242",
165
165
  "mongodb": "^7.0.0",
166
166
  "node-cron": "4.2.1",
167
167
  "node-edge-tts": "^1.2.10",
@@ -4249,11 +4249,14 @@ function syncSendButton() {
4249
4249
  // coach mid-run (which is exactly what /api/ai-hub/runs/:id/messages
4250
4250
  // is for; the server only requires sessionId).
4251
4251
  const resumable = !!(conv && conv.sessionId);
4252
+ // A stopped/failed run with no session (agent crashed, Hub restarted) can
4253
+ // also accept coaching — the server will fire a fresh startRun from context.
4254
+ const canRestartWithCoaching = !!(conv && !conv.sessionId && conv.status !== 'running' && !isManagedDelegationChild(conv));
4252
4255
  // A pending coaching job (set by quick-coach buttons or template picker)
4253
4256
  // is enough to enable Send even with an empty textarea — the user just
4254
4257
  // wants to fire that coaching directive, optionally with added context.
4255
4258
  const hasPendingJob = !!state.pendingCoachingJobId;
4256
- els['send'].disabled = !((hasText || hasPendingJob) && resumable);
4259
+ els['send'].disabled = !((hasText || hasPendingJob) && (resumable || canRestartWithCoaching));
4257
4260
  }
4258
4261
 
4259
4262
  function defaultCoachNote(conv) {
@@ -4272,6 +4275,9 @@ function defaultCoachNote(conv) {
4272
4275
  if (conv && conv.status === 'running') {
4273
4276
  return 'The employee is still working. Add coaching here to tighten the next step without losing context.';
4274
4277
  }
4278
+ if (conv && !conv.sessionId && conv.status !== 'running') {
4279
+ return 'The session is gone (agent crashed or Hub restarted). Send coaching to restart a fresh session from the preserved conversation context.';
4280
+ }
4275
4281
  return 'The employee is waiting on you. Send the next instruction to continue this run.';
4276
4282
  }
4277
4283