@firfi/huly-mcp 0.52.0 → 0.52.2

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.cjs +45 -12
  2. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -117849,7 +117849,7 @@ var require_lib7 = __commonJS({
117849
117849
  });
117850
117850
 
117851
117851
  // src/huly/huly-plugins.ts
117852
- var import_node_module, import_setting, load, activity, attachment, board, calendar, cardPlugin, chunter, contact, core, documentPlugin, gmailModule, gmail, hrModule, hr, inventory, love, mail, notification, preference, request3, setting, support, tags, task, templates, telegram, time3, tracker, view, workbench;
117852
+ var import_node_module, import_setting, load, activity, attachment, board, calendar, cardPlugin, chunter, contact, core, documentPlugin, gmailModule, gmail, hrModule, hr, inventory, love, mail, notification, preference, request3, isSettingPlugin, resolveSettingPlugin, setting, support, tags, task, templates, telegram, time3, tracker, view, workbench;
117853
117853
  var init_huly_plugins = __esm({
117854
117854
  "src/huly/huly-plugins.ts"() {
117855
117855
  "use strict";
@@ -117875,7 +117875,16 @@ var init_huly_plugins = __esm({
117875
117875
  notification = load("@hcengineering/notification").default;
117876
117876
  preference = load("@hcengineering/preference").default;
117877
117877
  request3 = load("@hcengineering/request").default;
117878
- setting = import_setting.default;
117878
+ isSettingPlugin = (value3) => typeof value3 === "object" && value3 !== null && "class" in value3 && typeof value3.class === "object" && value3.class !== null && "OfficeSettings" in value3.class && value3.class.OfficeSettings === "setting:class:OfficeSettings";
117879
+ resolveSettingPlugin = (candidate = import_setting.default) => {
117880
+ const direct = candidate;
117881
+ if (isSettingPlugin(direct)) return direct;
117882
+ if (typeof direct === "object" && direct !== null && "default" in direct && isSettingPlugin(direct.default)) {
117883
+ return direct.default;
117884
+ }
117885
+ throw new Error("@hcengineering/setting did not expose its declared default plugin");
117886
+ };
117887
+ setting = resolveSettingPlugin();
117879
117888
  support = load("@hcengineering/support").default;
117880
117889
  tags = load("@hcengineering/tags").default;
117881
117890
  task = load("@hcengineering/task").default;
@@ -132446,7 +132455,7 @@ var VERSION;
132446
132455
  var init_version = __esm({
132447
132456
  "src/version.ts"() {
132448
132457
  "use strict";
132449
- VERSION = true ? "0.52.0" : "0.0.0-dev";
132458
+ VERSION = true ? "0.52.2" : "0.0.0-dev";
132450
132459
  }
132451
132460
  });
132452
132461
 
@@ -233801,7 +233810,7 @@ var init_tool_call_notices = __esm({
233801
233810
  });
233802
233811
 
233803
233812
  // src/mcp/protocol-handlers.ts
233804
- var NPM_FETCH_TIMEOUT_MS, NPM_PACKAGE_NAME2, computeOutputBytes, deriveEditMode, validateHulyContextResult, validateVersionToolResult, liveNowClock, fetchLatestNpmVersion, invokeToolEditMode, resolveClientBundle, proxyClients, proxyEditMode, resolveProxyClients, responseStatus, selectNativeCallRegistry, nativeArgumentError, createMcpProtocolHandlers;
233813
+ var NPM_FETCH_TIMEOUT_MS, NPM_PACKAGE_NAME2, computeOutputBytes, deriveEditMode, validateHulyContextResult, validateVersionToolResult, liveNowClock, fetchLatestNpmVersion, proxyCallTelemetry, resolveClientBundle, proxyClients, resolveProxyClients, responseStatus, selectNativeCallRegistry, nativeArgumentError, createMcpProtocolHandlers;
233805
233814
  var init_protocol_handlers = __esm({
233806
233815
  "src/mcp/protocol-handlers.ts"() {
233807
233816
  "use strict";
@@ -233846,9 +233855,14 @@ var init_protocol_handlers = __esm({
233846
233855
  return "unknown";
233847
233856
  }
233848
233857
  };
233849
- invokeToolEditMode = (args2) => {
233858
+ proxyCallTelemetry = (toolName, args2, registry2) => {
233859
+ if (toolName !== INVOKE_TOOL_TOOL_NAME) return {};
233850
233860
  const decoded = Schema_exports.decodeUnknownResult(InvokeToolParamsSchema)(args2);
233851
- return Result_exports.isSuccess(decoded) ? deriveEditMode(decoded.success.toolName, decoded.success.arguments) : void 0;
233861
+ if (Result_exports.isFailure(decoded)) return {};
233862
+ return {
233863
+ editMode: deriveEditMode(decoded.success.toolName, decoded.success.arguments),
233864
+ ...registry2.tools.has(decoded.success.toolName) ? { operationName: decoded.success.toolName } : {}
233865
+ };
233852
233866
  };
233853
233867
  resolveClientBundle = async (resolveClients) => {
233854
233868
  try {
@@ -233863,7 +233877,6 @@ var init_protocol_handlers = __esm({
233863
233877
  storageClient: clients.storageClient,
233864
233878
  ...clients.workspaceClient === void 0 ? {} : { workspaceClient: clients.workspaceClient }
233865
233879
  });
233866
- proxyEditMode = (toolName, args2) => toolName === INVOKE_TOOL_TOOL_NAME ? invokeToolEditMode(args2) : void 0;
233867
233880
  resolveProxyClients = (toolName, resolveClients) => toolName === INVOKE_TOOL_TOOL_NAME ? resolveClientBundle(resolveClients) : Promise.resolve(void 0);
233868
233881
  responseStatus = (response) => response.isError === true ? "error" : "success";
233869
233882
  selectNativeCallRegistry = (exposure, toolName) => exposure.visibleNativeRegistry.tools.has(toolName) ? exposure.visibleNativeRegistry : exposure.context.resolvedMode === "proxy" ? exposure.proxyCandidateRegistry : exposure.visibleNativeRegistry;
@@ -233918,11 +233931,12 @@ var init_protocol_handlers = __esm({
233918
233931
  noticeClaim.delivered();
233919
233932
  return responseWithNotice;
233920
233933
  };
233921
- const returnError = (errorResponse, editMode) => {
233934
+ const returnError = (errorResponse, editMode, operationName) => {
233922
233935
  const responseWithNotice = withClaimedNotice(errorResponse);
233923
233936
  const durationMs = clock.currentTimeMillis() - start;
233924
233937
  telemetry.toolCalled({
233925
233938
  toolName: name,
233939
+ ...operationName === void 0 ? {} : { operationName },
233926
233940
  status: "error",
233927
233941
  clientKind: exposure.context.clientKind,
233928
233942
  resolvedMode: exposure.context.resolvedMode,
@@ -233981,10 +233995,10 @@ var init_protocol_handlers = __esm({
233981
233995
  };
233982
233996
  const callProxyTool = async (toolName) => {
233983
233997
  if (exposure.context.resolvedMode !== "proxy") return returnError(createUnknownToolError(toolName));
233984
- const editMode = proxyEditMode(toolName, args2);
233998
+ const { editMode, operationName } = proxyCallTelemetry(toolName, args2, exposure.proxyCandidateRegistry);
233985
233999
  const clientResolution = await resolveProxyClients(toolName, resolveClients);
233986
234000
  if (clientResolution?._tag === "Failure") {
233987
- return returnError(clientResolution.response, editMode);
234001
+ return returnError(clientResolution.response, editMode, operationName);
233988
234002
  }
233989
234003
  const response = await handleProxyToolCall({
233990
234004
  toolName,
@@ -233996,6 +234010,7 @@ var init_protocol_handlers = __esm({
233996
234010
  const durationMs = clock.currentTimeMillis() - start;
233997
234011
  telemetry.toolCalled({
233998
234012
  toolName,
234013
+ ...operationName === void 0 ? {} : { operationName },
233999
234014
  status: responseStatus(responseWithNotice),
234000
234015
  clientKind: exposure.context.clientKind,
234001
234016
  resolvedMode: exposure.context.resolvedMode,
@@ -238480,16 +238495,33 @@ var init_stderr = __esm({
238480
238495
  });
238481
238496
 
238482
238497
  // src/telemetry/posthog.ts
238483
- var POSTHOG_API_KEY, SHUTDOWN_TIMEOUT_MS, defaultDependencies, createPostHogTelemetry, createPostHogTelemetryWithContext;
238498
+ var POSTHOG_API_KEY, SHUTDOWN_TIMEOUT_MS, ToolCalledPropertiesSchema, operationProperties, defaultDependencies, createPostHogTelemetry, createPostHogTelemetryWithContext;
238484
238499
  var init_posthog = __esm({
238485
238500
  "src/telemetry/posthog.ts"() {
238486
238501
  "use strict";
238487
238502
  init_index_node();
238503
+ init_dist();
238488
238504
  init_stderr();
238489
238505
  init_version();
238490
238506
  init_context();
238491
238507
  POSTHOG_API_KEY = "phc_TGfFqCGdnF0p68wuFzd5WSw1IsBvOJW0YgoMJDyZPjm";
238492
238508
  SHUTDOWN_TIMEOUT_MS = 2e3;
238509
+ ToolCalledPropertiesSchema = Schema_exports.Struct({
238510
+ tool_name: Schema_exports.String,
238511
+ operation_name: Schema_exports.optionalKey(Schema_exports.String),
238512
+ status: Schema_exports.Literals(["success", "error"]),
238513
+ duration_ms: Schema_exports.Number,
238514
+ client_kind: Schema_exports.optionalKey(Schema_exports.String),
238515
+ resolved_mode: Schema_exports.optionalKey(Schema_exports.String),
238516
+ error_tag: Schema_exports.optionalKey(Schema_exports.String),
238517
+ input_bytes: Schema_exports.optionalKey(Schema_exports.Number),
238518
+ output_bytes: Schema_exports.optionalKey(Schema_exports.Number),
238519
+ edit_mode: Schema_exports.optionalKey(Schema_exports.String)
238520
+ });
238521
+ operationProperties = (toolName, targetName) => {
238522
+ const operationName = targetName ?? (toolName === "invoke_tool" ? void 0 : toolName);
238523
+ return operationName === void 0 ? {} : { operation_name: operationName };
238524
+ };
238493
238525
  defaultDependencies = {
238494
238526
  createClient: () => new PostHog(POSTHOG_API_KEY, { host: "https://us.i.posthog.com", flushAt: 10, flushInterval: 6e4 }),
238495
238527
  createSessionId: () => crypto.randomUUID(),
@@ -238554,6 +238586,7 @@ var init_posthog = __esm({
238554
238586
  event: "tool_called",
238555
238587
  properties: {
238556
238588
  tool_name: props.toolName,
238589
+ ...operationProperties(props.toolName, props.operationName),
238557
238590
  status: props.status,
238558
238591
  duration_ms: props.durationMs,
238559
238592
  ...props.clientKind !== void 0 && { client_kind: props.clientKind },
@@ -239402,7 +239435,7 @@ if (unsupportedRuntime) {
239402
239435
  detectedNodeVersion: process.versions.node,
239403
239436
  executable: process.execPath,
239404
239437
  requiredNodeVersion: nodeEngineRequirement,
239405
- serverVersion: "0.52.0"
239438
+ serverVersion: "0.52.2"
239406
239439
  });
239407
239440
  startUnsupportedNodeMcp(config2);
239408
239441
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@firfi/huly-mcp",
3
- "version": "0.52.0",
3
+ "version": "0.52.2",
4
4
  "description": "Huly MCP: feature-complete MCP server for Huly integration",
5
5
  "mcpName": "io.github.dearlordylord/huly-mcp",
6
6
  "type": "module",