@knowsuchagency/fulcrum 3.7.0 → 3.7.1

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/bin/fulcrum.js CHANGED
@@ -46445,7 +46445,7 @@ async function runMcpServer(urlOverride, portOverride) {
46445
46445
  const client = new FulcrumClient(urlOverride, portOverride);
46446
46446
  const server = new McpServer({
46447
46447
  name: "fulcrum",
46448
- version: "3.7.0"
46448
+ version: "3.7.1"
46449
46449
  });
46450
46450
  registerTools(server, client);
46451
46451
  const transport = new StdioServerTransport;
@@ -48794,7 +48794,7 @@ var marketplace_default = `{
48794
48794
  "name": "fulcrum",
48795
48795
  "source": "./",
48796
48796
  "description": "Task orchestration for Claude Code",
48797
- "version": "3.7.0",
48797
+ "version": "3.7.1",
48798
48798
  "skills": [
48799
48799
  "./skills/fulcrum"
48800
48800
  ],
@@ -49998,7 +49998,7 @@ function compareVersions(v1, v2) {
49998
49998
  var package_default = {
49999
49999
  name: "@knowsuchagency/fulcrum",
50000
50000
  private: true,
50001
- version: "3.7.0",
50001
+ version: "3.7.1",
50002
50002
  description: "Harness Attention. Orchestrate Agents. Ship.",
50003
50003
  license: "PolyForm-Perimeter-1.0.0",
50004
50004
  type: "module",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@knowsuchagency/fulcrum",
3
- "version": "3.7.0",
3
+ "version": "3.7.1",
4
4
  "description": "Harness Attention. Orchestrate Agents. Ship.",
5
5
  "license": "PolyForm-Perimeter-1.0.0",
6
6
  "repository": {
package/server/index.js CHANGED
@@ -1135687,6 +1135687,22 @@ function getChannelMessages(options = {}) {
1135687
1135687
  function getChannelMessageById(id) {
1135688
1135688
  return db2.select().from(channelMessages).where(eq(channelMessages.id, id)).get();
1135689
1135689
  }
1135690
+ function getRecentChannelMessages(connectionId, options = {}) {
1135691
+ const { before, limit = 5 } = options;
1135692
+ const conditions2 = [
1135693
+ eq(channelMessages.connectionId, connectionId)
1135694
+ ];
1135695
+ if (before) {
1135696
+ conditions2.push(lt(channelMessages.messageTimestamp, before));
1135697
+ }
1135698
+ const results = db2.select({
1135699
+ direction: channelMessages.direction,
1135700
+ senderName: channelMessages.senderName,
1135701
+ content: channelMessages.content,
1135702
+ messageTimestamp: channelMessages.messageTimestamp
1135703
+ }).from(channelMessages).where(and(...conditions2)).orderBy(desc(channelMessages.messageTimestamp)).limit(limit).all();
1135704
+ return results.reverse();
1135705
+ }
1135690
1135706
  function getRecentOutgoingMessages(connectionId, options = {}) {
1135691
1135707
  const { since, limit = 20 } = options;
1135692
1135708
  const conditions2 = [
@@ -1150364,7 +1150380,25 @@ async function* streamOpencodeObserverMessage(sessionId, userMessage, options) {
1150364
1150380
  const client3 = await getClient();
1150365
1150381
  const settings = getSettings();
1150366
1150382
  const model = options.model || settings.assistant.observerOpencodeModel || settings.agent.opencodeModel;
1150367
- const contextualMessage = `[${options.channelType.toUpperCase()} message from ${options.senderName || options.senderId}]
1150383
+ let contextualMessage = "";
1150384
+ if (options.channelHistory && options.channelHistory.length > 0) {
1150385
+ const historyLines = options.channelHistory.map((msg) => {
1150386
+ const time2 = new Date(msg.messageTimestamp).toLocaleTimeString("en-US", {
1150387
+ hour: "2-digit",
1150388
+ minute: "2-digit",
1150389
+ hour12: false
1150390
+ });
1150391
+ const label = msg.direction === "outgoing" ? "You" : msg.senderName || "Unknown";
1150392
+ const truncated = msg.content.length > 500 ? msg.content.slice(0, 500) + "..." : msg.content;
1150393
+ return `[${time2}] ${label}: ${truncated}`;
1150394
+ });
1150395
+ contextualMessage += `[Recent messages on this channel:
1150396
+ ${historyLines.join(`
1150397
+ `)}]
1150398
+
1150399
+ `;
1150400
+ }
1150401
+ contextualMessage += `[${options.channelType.toUpperCase()} message from ${options.senderName || options.senderId}]
1150368
1150402
 
1150369
1150403
  ${userMessage}`;
1150370
1150404
  const fullPrompt = `${getObserverSystemPrompt()}
@@ -1150884,6 +1150918,10 @@ async function processObserveOnlyMessage(msg) {
1150884
1150918
  });
1150885
1150919
  return;
1150886
1150920
  }
1150921
+ const channelHistory = msg.channelType !== "email" ? getRecentChannelMessages(msg.connectionId, {
1150922
+ before: (msg.timestamp ?? new Date).toISOString(),
1150923
+ limit: 5
1150924
+ }) : [];
1150887
1150925
  const observeSessionKey = `observe-${msg.connectionId}`;
1150888
1150926
  const { session: session3 } = getOrCreateSession(msg.connectionId, observeSessionKey, "Observer", undefined, msg.channelType);
1150889
1150927
  const settings = getSettings();
@@ -1150894,7 +1150932,8 @@ async function processObserveOnlyMessage(msg) {
1150894
1150932
  const stream2 = _deps.streamOpencodeObserverMessage(session3.id, msg.content, {
1150895
1150933
  channelType: msg.channelType,
1150896
1150934
  senderId: msg.senderId,
1150897
- senderName: msg.senderName
1150935
+ senderName: msg.senderName,
1150936
+ channelHistory
1150898
1150937
  });
1150899
1150938
  for await (const event of stream2) {
1150900
1150939
  if (event.type === "error") {
@@ -1150934,7 +1150973,8 @@ async function processObserveOnlyMessage(msg) {
1150934
1150973
  systemPromptAdditions: systemPrompt,
1150935
1150974
  modelId: observerModelId,
1150936
1150975
  securityTier: "observer",
1150937
- ephemeral: true
1150976
+ ephemeral: true,
1150977
+ ...channelHistory.length > 0 && { channelHistory }
1150938
1150978
  });
1150939
1150979
  for await (const event of stream2) {
1150940
1150980
  if (event.type === "error") {
@@ -1255394,7 +1255434,7 @@ mcpRoutes.all("/", async (c) => {
1255394
1255434
  });
1255395
1255435
  const server2 = new McpServer({
1255396
1255436
  name: "fulcrum",
1255397
- version: "3.7.0"
1255437
+ version: "3.7.1"
1255398
1255438
  });
1255399
1255439
  const client3 = new FulcrumClient(`http://localhost:${port}`);
1255400
1255440
  registerTools(server2, client3);