signetai 0.186.0 → 0.187.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/dist/mcp-stdio.js CHANGED
@@ -47826,6 +47826,27 @@ function up119(db) {
47826
47826
  db.exec("ALTER TABLE telemetry_install ADD COLUMN last_seen_version TEXT");
47827
47827
  }
47828
47828
  }
47829
+ function up120(db) {
47830
+ db.exec(`
47831
+ CREATE TABLE IF NOT EXISTS source_lifecycle_state (
47832
+ agent_id TEXT NOT NULL,
47833
+ source_key TEXT NOT NULL,
47834
+ source_class TEXT NOT NULL,
47835
+ mode TEXT NOT NULL,
47836
+ connected_at TEXT,
47837
+ first_indexed_at TEXT,
47838
+ first_searchable_at TEXT,
47839
+ first_recall_at TEXT,
47840
+ last_success_at TEXT,
47841
+ last_freshness_state TEXT,
47842
+ last_freshness_event_at TEXT,
47843
+ PRIMARY KEY (agent_id, source_key)
47844
+ );
47845
+
47846
+ CREATE INDEX IF NOT EXISTS idx_source_lifecycle_state_ready
47847
+ ON source_lifecycle_state(agent_id, source_class, first_searchable_at, first_recall_at);
47848
+ `);
47849
+ }
47829
47850
  var MIGRATIONS = [
47830
47851
  {
47831
47852
  version: 1,
@@ -48787,6 +48808,12 @@ var MIGRATIONS = [
48787
48808
  name: "telemetry-version-observation",
48788
48809
  up: up119,
48789
48810
  artifacts: { columns: [{ table: "telemetry_install", column: "last_seen_version" }] }
48811
+ },
48812
+ {
48813
+ version: 120,
48814
+ name: "source-lifecycle-telemetry",
48815
+ up: up120,
48816
+ artifacts: { tables: ["source_lifecycle_state"] }
48790
48817
  }
48791
48818
  ];
48792
48819
  var LATEST_SCHEMA_VERSION = MIGRATIONS[MIGRATIONS.length - 1]?.version ?? 0;
@@ -49836,9 +49863,59 @@ function toolName(value) {
49836
49863
  function toolMarker(value) {
49837
49864
  return `[tool call: ${toolName(value)}]`;
49838
49865
  }
49866
+ var REASONING_TYPES = ["analysis", "thought", "thinking", "reasoning", "redacted_thinking"];
49867
+ var TOOL_CALL_TYPES = ["tool_use", "tool_call", "function_call", "function_calling"];
49868
+ var TOOL_RESULT_TYPES = [
49869
+ "tool_result",
49870
+ "tool_response",
49871
+ "function_call_output",
49872
+ "function_result",
49873
+ "tool_output",
49874
+ "tool_return"
49875
+ ];
49876
+ function recordType2(value) {
49877
+ return (stringValue(value.type) ?? "").toLowerCase();
49878
+ }
49879
+ function isReasoningRecord(value) {
49880
+ const type = recordType2(value);
49881
+ const role = (stringValue(value.role) ?? "").toLowerCase();
49882
+ const content = value.content;
49883
+ const hasNoContent = content == null || typeof content === "string" && content.trim().length === 0;
49884
+ return REASONING_TYPES.some((candidate) => type === candidate || type.includes(candidate)) || role === "reasoning" || role === "thinking" || role === "assistant" && hasNoContent && (value.reasoning !== undefined || value.reasoning_content !== undefined || value.thinking !== undefined) || value.thought === true;
49885
+ }
49886
+ function isToolCallRecord(value) {
49887
+ return TOOL_CALL_TYPES.some((candidate) => recordType2(value).includes(candidate));
49888
+ }
49889
+ function isToolResultRecord(value) {
49890
+ const type = recordType2(value);
49891
+ const role = (stringValue(value.role) ?? "").toLowerCase();
49892
+ if (TOOL_RESULT_TYPES.some((candidate) => type.includes(candidate)) || role === "tool" || role === "function")
49893
+ return true;
49894
+ const payload = value.payload;
49895
+ if (typeof payload === "object" && payload !== null && !Array.isArray(payload)) {
49896
+ return isToolResultRecord(payload);
49897
+ }
49898
+ return false;
49899
+ }
49900
+ function toolCallMarkers(value) {
49901
+ const calls = value.tool_calls ?? value.toolCalls ?? value.calls;
49902
+ const records = Array.isArray(calls) ? calls : calls === undefined ? [] : [calls];
49903
+ const markers = records.flatMap((call2) => {
49904
+ if (typeof call2 !== "object" || call2 === null || Array.isArray(call2))
49905
+ return [];
49906
+ return [toolMarker(call2)];
49907
+ });
49908
+ const functionCall = value.function_call;
49909
+ if (typeof functionCall === "object" && functionCall !== null && !Array.isArray(functionCall)) {
49910
+ markers.push(toolMarker(functionCall));
49911
+ }
49912
+ return markers;
49913
+ }
49839
49914
  function contentText(value) {
49840
49915
  if (typeof value === "string")
49841
49916
  return value.trim().length > 0 ? [value.trim()] : [];
49917
+ if (typeof value === "object" && value !== null && !Array.isArray(value))
49918
+ return contentText([value]);
49842
49919
  if (!Array.isArray(value))
49843
49920
  return [];
49844
49921
  const text = [];
@@ -49851,14 +49928,13 @@ function contentText(value) {
49851
49928
  if (typeof item !== "object" || item === null || Array.isArray(item))
49852
49929
  continue;
49853
49930
  const block = item;
49854
- const type = stringValue(block.type)?.toLowerCase() ?? "";
49855
- if (["tool_result", "tool_response", "function_call_output", "function_result"].includes(type))
49931
+ if (isReasoningRecord(block) || isToolResultRecord(block))
49856
49932
  continue;
49857
- if (["tool_use", "tool_call", "function_call"].includes(type)) {
49933
+ if (isToolCallRecord(block)) {
49858
49934
  text.push(toolMarker(block));
49859
49935
  continue;
49860
49936
  }
49861
- const blockText = stringValue(block.text) ?? stringValue(block.content);
49937
+ const blockText = stringValue(block.text) ?? stringValue(block.input_text) ?? stringValue(block.content);
49862
49938
  if (blockText)
49863
49939
  text.push(blockText);
49864
49940
  }
@@ -49868,49 +49944,49 @@ function jsonTranscriptLine(value) {
49868
49944
  if (typeof value !== "object" || value === null || Array.isArray(value))
49869
49945
  return [];
49870
49946
  const record5 = value;
49871
- const nestedItem = record5.item;
49947
+ const nestedItem = record5.item ?? record5.message ?? record5.payload;
49872
49948
  const item = typeof nestedItem === "object" && nestedItem !== null && !Array.isArray(nestedItem) ? nestedItem : record5;
49873
- const type = (stringValue(item.type) ?? stringValue(record5.type) ?? "").toLowerCase();
49874
- if (["tool_result", "tool_response", "function_call_output", "function_result", "tool_output", "tool_return"].some((candidate) => type.includes(candidate))) {
49949
+ if (isReasoningRecord(item) || isReasoningRecord(record5) || isToolResultRecord(item) || isToolResultRecord(record5))
49875
49950
  return [];
49876
- }
49877
- if (["tool_use", "tool_call", "function_call", "function_calling"].some((candidate) => type.includes(candidate))) {
49951
+ if (isToolCallRecord(item) || isToolCallRecord(record5)) {
49878
49952
  return [toolMarker(item)];
49879
49953
  }
49880
49954
  const role = (stringValue(item.role) ?? stringValue(record5.role) ?? "").toLowerCase();
49881
- if (role === "tool" || role === "function")
49882
- return [];
49883
- const payload = record5.payload;
49884
- if (typeof payload === "object" && payload !== null && !Array.isArray(payload)) {
49885
- const payloadRecord = payload;
49886
- const payloadType = (stringValue(payloadRecord.type) ?? "").toLowerCase();
49887
- if (payloadType.includes("tool") || payloadType.includes("function_call")) {
49888
- if (payloadType.includes("result") || payloadType.includes("output"))
49889
- return [];
49890
- return [toolMarker(payloadRecord)];
49891
- }
49892
- const payloadRole = stringValue(payloadRecord.role)?.toLowerCase();
49893
- const payloadText = contentText(payloadRecord.content ?? payloadRecord.text);
49894
- if (payloadRole && payloadText.length > 0)
49895
- return [`${payloadRole === "user" ? "User" : "Assistant"}: ${payloadText.join(`
49896
- `)}`];
49897
- }
49898
49955
  const text = contentText(item.content ?? item.text ?? item.message);
49899
- if (text.length === 0)
49956
+ const markers = toolCallMarkers(item);
49957
+ if (text.length === 0 && markers.length === 0)
49900
49958
  return [];
49901
49959
  const label = role === "user" ? "User" : role === "assistant" ? "Assistant" : role === "reasoning" ? "Assistant reasoning" : null;
49902
- return label ? text.map((part) => `${label}: ${part}`) : text;
49960
+ return [...label ? text.map((part) => `${label}: ${part}`) : text, ...markers];
49903
49961
  }
49904
49962
  function sanitizePlainTranscript(content) {
49905
- const withoutToolBlocks = content.replace(/<(?:tool_result|tool_output|function_result|function_output|tool_response)>[\s\S]*?<\/(?:tool_result|tool_output|function_result|function_output|tool_response)>/gi, "").replace(/<(?:tool_call|tool_use|function_call)(?:\s+([^>]*))?>[\s\S]*?<\/(?:tool_call|tool_use|function_call)>/gi, (_match, attributes) => {
49963
+ const withoutToolBlocks = content.replace(/<(?:antml:)?(?:think|thinking|reasoning|analysis|redacted_thinking)\b[^>]*>[\s\S]*?<\/(?:antml:)?(?:think|thinking|reasoning|analysis|redacted_thinking)>/gi, "").replace(/<(?:antml:)?(?:tool_result|tool_output|function_result|function_output|tool_response)>[\s\S]*?<\/(?:antml:)?(?:tool_result|tool_output|function_result|function_output|tool_response)>/gi, "").replace(/<(?:antml:invoke|(?:antml:)?(?:tool_call|tool_use|function_call))(?:\s+([^>]*))?>[\s\S]*?<\/(?:antml:invoke|(?:antml:)?(?:tool_call|tool_use|function_call))>/gi, (_match, attributes) => {
49906
49964
  const name = /(?:name|tool)=["']([^"']+)["']/i.exec(attributes ?? "")?.[1] ?? "tool";
49907
49965
  return `[tool call: ${name}]`;
49908
49966
  });
49909
49967
  const lines = withoutToolBlocks.split(/\r?\n/);
49910
49968
  const kept = [];
49969
+ let omittingReasoning = false;
49970
+ let omittingToolOutput = false;
49911
49971
  for (const line of lines) {
49912
49972
  const trimmed = line.trim();
49913
- if (/^(?:tool[_ -]?(?:output|result)|function[_ -]?(?:output|result)|<tool_result|<tool_response)\b/i.test(trimmed))
49973
+ if (/^(?:tool|function)\s*:/i.test(trimmed)) {
49974
+ omittingToolOutput = true;
49975
+ continue;
49976
+ }
49977
+ if (/^(?:user|human|assistant|system|developer)\s*:/i.test(trimmed)) {
49978
+ omittingReasoning = false;
49979
+ omittingToolOutput = false;
49980
+ }
49981
+ if (/^(?:assistant\s+)?(?:reasoning|thinking|thought|analysis)\s*:/i.test(trimmed)) {
49982
+ omittingReasoning = true;
49983
+ continue;
49984
+ }
49985
+ if (/^(?:tool[_ -]?(?:output|result)|function[_ -]?(?:output|result)|<tool_result|<tool_response)\b/i.test(trimmed)) {
49986
+ omittingToolOutput = true;
49987
+ continue;
49988
+ }
49989
+ if (omittingReasoning || omittingToolOutput)
49914
49990
  continue;
49915
49991
  if (/^(?:tool[_ -]?(?:call|use)|function[_ -]?call)\b/i.test(trimmed)) {
49916
49992
  const name = trimmed.split(/\s*[:=]\s*/, 2)[1]?.trim() || "tool";
@@ -49924,26 +50000,16 @@ function sanitizePlainTranscript(content) {
49924
50000
 
49925
50001
  `).trim();
49926
50002
  }
49927
- function isJsonTranscriptToolOutput(value) {
50003
+ function isJsonTranscriptExcluded(value) {
49928
50004
  if (typeof value !== "object" || value === null || Array.isArray(value))
49929
50005
  return false;
49930
50006
  const record5 = value;
49931
- const nestedItem = record5.item;
50007
+ const nestedItem = record5.item ?? record5.message ?? record5.payload;
49932
50008
  const item = typeof nestedItem === "object" && nestedItem !== null && !Array.isArray(nestedItem) ? nestedItem : record5;
49933
- const type = (stringValue(item.type) ?? stringValue(record5.type) ?? "").toLowerCase();
49934
- if (["tool_result", "tool_response", "function_call_output", "function_result", "tool_output", "tool_return"].some((candidate) => type.includes(candidate)))
50009
+ if (isReasoningRecord(record5) || isReasoningRecord(item) || isToolResultRecord(record5) || isToolResultRecord(item))
49935
50010
  return true;
49936
- const role = (stringValue(item.role) ?? stringValue(record5.role) ?? "").toLowerCase();
49937
- if (role === "tool" || role === "function")
49938
- return true;
49939
- const payload = record5.payload;
49940
- if (typeof payload === "object" && payload !== null && !Array.isArray(payload)) {
49941
- const payloadRecord = payload;
49942
- const payloadType = (stringValue(payloadRecord.type) ?? "").toLowerCase();
49943
- const payloadRole = (stringValue(payloadRecord.role) ?? "").toLowerCase();
49944
- return payloadType.includes("result") || payloadType.includes("output") || payloadRole === "tool" || payloadRole === "function";
49945
- }
49946
- return false;
50011
+ const content = item.content;
50012
+ return Array.isArray(content) && content.length > 0 && content.every((block) => typeof block === "object" && block !== null && !Array.isArray(block) && (isReasoningRecord(block) || isToolResultRecord(block)));
49947
50013
  }
49948
50014
  function sanitizeTranscriptForDreaming(content) {
49949
50015
  const lines = content.split(/\r?\n/);
@@ -49974,7 +50040,7 @@ function sanitizeTranscriptForDreaming(content) {
49974
50040
  const rendered = jsonTranscriptLine(parsed);
49975
50041
  if (rendered.length > 0)
49976
50042
  return rendered;
49977
- if (isJsonTranscriptToolOutput(parsed))
50043
+ if (isJsonTranscriptExcluded(parsed))
49978
50044
  return [];
49979
50045
  } catch {}
49980
50046
  return [line];
@@ -1,43 +1,43 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "version": "0.186.0",
3
+ "version": "0.187.1",
4
4
  "assets": [
5
5
  {
6
6
  "name": "signet-darwin-arm64",
7
7
  "platform": "darwin-arm64",
8
- "sha256": "ab7701832045a5bd9027a218ec5aa2763e894fccde85bb90d5b9ac86b2038007",
9
- "size": 117655840
8
+ "sha256": "66d5f01303df93cec5197d39e7d067b76b1183659cb432e16312ac3be4a89d75",
9
+ "size": 117705376
10
10
  },
11
11
  {
12
12
  "name": "signet-darwin-x64",
13
13
  "platform": "darwin-x64",
14
- "sha256": "5c913cd9f7d433ba8b6dde6a6daf2bc2b93a147e2057b07fa4497b4a60970496",
15
- "size": 122276416
14
+ "sha256": "7c7cf381a004a52c499510115592ff6c17f73465762290f42e3f5ee52c0184b0",
15
+ "size": 122325568
16
16
  },
17
17
  {
18
18
  "name": "signet-linux-arm64",
19
19
  "platform": "linux-arm64",
20
- "sha256": "4142ceb57fd31f7ea8b518d4cc19ec9a5fe0508d77984d0b00624de1b3d4860b",
21
- "size": 154898234
20
+ "sha256": "4192e7870eb925d1fafc0402ea2317a396b22a95111662fcc867a93bfcc26b80",
21
+ "size": 154944502
22
22
  },
23
23
  {
24
24
  "name": "signet-linux-x64",
25
25
  "platform": "linux-x64",
26
- "sha256": "d1430dd8767211add8da1405642c2b50d784952f61f12fe44a7a3d392662c3d6",
27
- "size": 155457219
26
+ "sha256": "fa2cf1ba8f98fdf58f504e538119a9d6f45288b7a0f747a8607802909241fcff",
27
+ "size": 155503487
28
28
  },
29
29
  {
30
30
  "name": "signet-win32-x64.exe",
31
31
  "platform": "win32-x64",
32
- "sha256": "af0d6d572b62d2856f8471c97e50f303be75a0bcc34b5c0c26c5d30a63c984ee",
33
- "size": 171589632
32
+ "sha256": "7eb540f9ca277c7738894b483f558620f56c1fec94d7e858e62604fa07ed2e57",
33
+ "size": 171636224
34
34
  }
35
35
  ],
36
36
  "components": {
37
37
  "connectors": {
38
- "url": "signet-connectors-0.186.0.tar.gz",
39
- "sha256": "7f355bb31a1070c7d0a0b4775dcd1daedd123b1a74f459e723953e6dd33372ab",
40
- "size": 16887
38
+ "url": "signet-connectors-0.187.1.tar.gz",
39
+ "sha256": "9a527913ae68d86289479b0b503dd55501ebc921926fd79be72a72fae9de36dc",
40
+ "size": 16883
41
41
  }
42
42
  }
43
43
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "signetai",
3
- "version": "0.186.0",
3
+ "version": "0.187.1",
4
4
  "description": "Signet native CLI installer wrapper",
5
5
  "type": "module",
6
6
  "bin": {
@@ -65,10 +65,10 @@
65
65
  "access": "public"
66
66
  },
67
67
  "optionalDependencies": {
68
- "signetai-darwin-arm64": "https://github.com/Signet-AI/signetai/releases/download/v0.186.0/signetai-darwin-arm64-0.186.0.tgz",
69
- "signetai-darwin-x64": "https://github.com/Signet-AI/signetai/releases/download/v0.186.0/signetai-darwin-x64-0.186.0.tgz",
70
- "signetai-linux-arm64": "https://github.com/Signet-AI/signetai/releases/download/v0.186.0/signetai-linux-arm64-0.186.0.tgz",
71
- "signetai-linux-x64": "https://github.com/Signet-AI/signetai/releases/download/v0.186.0/signetai-linux-x64-0.186.0.tgz",
72
- "signetai-win32-x64": "https://github.com/Signet-AI/signetai/releases/download/v0.186.0/signetai-win32-x64-0.186.0.tgz"
68
+ "signetai-darwin-arm64": "https://github.com/Signet-AI/signetai/releases/download/v0.187.1/signetai-darwin-arm64-0.187.1.tgz",
69
+ "signetai-darwin-x64": "https://github.com/Signet-AI/signetai/releases/download/v0.187.1/signetai-darwin-x64-0.187.1.tgz",
70
+ "signetai-linux-arm64": "https://github.com/Signet-AI/signetai/releases/download/v0.187.1/signetai-linux-arm64-0.187.1.tgz",
71
+ "signetai-linux-x64": "https://github.com/Signet-AI/signetai/releases/download/v0.187.1/signetai-linux-x64-0.187.1.tgz",
72
+ "signetai-win32-x64": "https://github.com/Signet-AI/signetai/releases/download/v0.187.1/signetai-win32-x64-0.187.1.tgz"
73
73
  }
74
74
  }