haansi 0.1.23 → 0.1.24

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/haansi.js +25 -31
  2. package/package.json +1 -1
package/dist/haansi.js CHANGED
@@ -39,7 +39,7 @@ var require_package = __commonJS({
39
39
  "package.json"(exports2, module2) {
40
40
  module2.exports = {
41
41
  name: "haansi",
42
- version: "0.1.23",
42
+ version: "0.1.24",
43
43
  description: "Haansi CLI - Session collector and MCP server for Claude Code",
44
44
  bin: {
45
45
  haansi: "./dist/haansi.js"
@@ -1998,23 +1998,18 @@ var init_collector_daemon = __esm({
1998
1998
  }
1999
1999
  });
2000
2000
 
2001
- // ../../packages/@company/types/src/knowledge.ts
2002
- var init_knowledge = __esm({
2003
- "../../packages/@company/types/src/knowledge.ts"() {
2004
- "use strict";
2005
- }
2006
- });
2007
-
2008
- // ../../packages/@company/types/src/user.ts
2009
- var init_user = __esm({
2010
- "../../packages/@company/types/src/user.ts"() {
2011
- "use strict";
2001
+ // ../service-capture/claude-sessions/http-timeout.ts
2002
+ async function fetchWithTimeout(url2, init2 = {}, timeoutMs = 15e3) {
2003
+ const controller = new AbortController();
2004
+ const timer = setTimeout(() => controller.abort(), timeoutMs);
2005
+ try {
2006
+ return await fetch(url2, { ...init2, signal: controller.signal });
2007
+ } finally {
2008
+ clearTimeout(timer);
2012
2009
  }
2013
- });
2014
-
2015
- // ../../packages/@company/types/src/integration.ts
2016
- var init_integration = __esm({
2017
- "../../packages/@company/types/src/integration.ts"() {
2010
+ }
2011
+ var init_http_timeout = __esm({
2012
+ "../service-capture/claude-sessions/http-timeout.ts"() {
2018
2013
  "use strict";
2019
2014
  }
2020
2015
  });
@@ -2227,9 +2222,6 @@ var init_embedding = __esm({
2227
2222
  // ../../packages/@company/types/src/index.ts
2228
2223
  var init_src = __esm({
2229
2224
  "../../packages/@company/types/src/index.ts"() {
2230
- init_knowledge();
2231
- init_user();
2232
- init_integration();
2233
2225
  init_timeline();
2234
2226
  init_artifact();
2235
2227
  init_taxonomy();
@@ -56963,7 +56955,9 @@ async function apiGet2(path, options) {
56963
56955
  Authorization: `Bearer ${TOKEN}`,
56964
56956
  ...options?.extraHeaders
56965
56957
  };
56966
- const response = await fetch(`${API_URL}/api/v1${path}`, { headers });
56958
+ const response = await fetchWithTimeout(`${API_URL}/api/v1${path}`, {
56959
+ headers
56960
+ });
56967
56961
  if (!response.ok) {
56968
56962
  const body = await response.text().catch(() => "");
56969
56963
  throw new Error(`API error ${response.status}: ${body.slice(0, 200)}`);
@@ -56976,7 +56970,7 @@ async function apiPost(path, body, options) {
56976
56970
  "Content-Type": "application/json",
56977
56971
  ...options?.extraHeaders
56978
56972
  };
56979
- const response = await fetch(`${API_URL}/api/v1${path}`, {
56973
+ const response = await fetchWithTimeout(`${API_URL}/api/v1${path}`, {
56980
56974
  method: "POST",
56981
56975
  headers,
56982
56976
  body: JSON.stringify(body)
@@ -56987,16 +56981,14 @@ async function apiPost(path, body, options) {
56987
56981
  }
56988
56982
  return response.json();
56989
56983
  }
56990
- async function main3() {
56991
- try {
56992
- await apiGet2("/memory/solutions/recent?limit=1");
56993
- } catch {
56994
- }
56995
- try {
56996
- await apiGet2("/workspace/users/me/preferences");
56997
- } catch {
56998
- }
56984
+ function warmupInBackground() {
56985
+ void apiGet2("/memory/solutions/recent?limit=1").catch(() => {
56986
+ });
56987
+ void apiGet2("/workspace/users/me/preferences").catch(() => {
56988
+ });
56999
56989
  triggerCollectInBackground();
56990
+ }
56991
+ async function main3() {
57000
56992
  const transportMode = process.env.MCP_TRANSPORT || "stdio";
57001
56993
  if (transportMode === "http") {
57002
56994
  const express = await Promise.resolve().then(() => __toESM(require_express2()));
@@ -57019,6 +57011,7 @@ async function main3() {
57019
57011
  const transport = new StdioServerTransport();
57020
57012
  await mcpServer.connect(transport);
57021
57013
  }
57014
+ warmupInBackground();
57022
57015
  }
57023
57016
  var import_dotenv3, import_path3, import_fs3, import_os2, DEFAULT_API_URL4, CREDENTIALS_FILE4, API_URL, TOKEN, contextSchema, isCollecting, lastCollectTime, COLLECT_COOLDOWN_MS, mcpServer, server;
57024
57017
  var init_mcp_server2 = __esm({
@@ -57029,6 +57022,7 @@ var init_mcp_server2 = __esm({
57029
57022
  import_fs3 = require("fs");
57030
57023
  import_os2 = require("os");
57031
57024
  init_collector();
57025
+ init_http_timeout();
57032
57026
  init_src();
57033
57027
  init_mcp();
57034
57028
  init_stdio2();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "haansi",
3
- "version": "0.1.23",
3
+ "version": "0.1.24",
4
4
  "description": "Haansi CLI - Session collector and MCP server for Claude Code",
5
5
  "bin": {
6
6
  "haansi": "./dist/haansi.js"