@tipolink/mcp 1.0.0 → 1.0.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.
@@ -7,6 +7,31 @@ var LEGACY_START_MARKER = "<!-- interlink:start -->";
7
7
  var LEGACY_END_MARKER = "<!-- interlink:end -->";
8
8
  var GUARD_COMMAND = "npx @tipolink/mcp guard --staged --hook-json";
9
9
  var DEFAULT_CLOUD_API_URL = "https://tipolink.co";
10
+ var GITIGNORE_TIPOLINK_RE = /^\s*\/?\.tipolink\/?\s*$/;
11
+ function ensureGitignoreIgnoresTipolink(rootDir, result) {
12
+ const gitignorePath = path.join(rootDir, ".gitignore");
13
+ if (!existsSync(gitignorePath)) {
14
+ return;
15
+ }
16
+ const existing = readFileSync(gitignorePath, "utf8");
17
+ result.files.push(".gitignore");
18
+ const lines = existing.split(/\r?\n/);
19
+ if (lines.some((line) => GITIGNORE_TIPOLINK_RE.test(line))) {
20
+ result.unchanged.push(".gitignore");
21
+ return;
22
+ }
23
+ const eol = existing.includes("\r\n") ? "\r\n" : "\n";
24
+ let nextContent;
25
+ if (existing.length === 0) {
26
+ nextContent = `.tipolink/${eol}`;
27
+ } else if (existing.endsWith("\n")) {
28
+ nextContent = `${existing}.tipolink/${eol}`;
29
+ } else {
30
+ nextContent = `${existing}${eol}.tipolink/${eol}`;
31
+ }
32
+ writeFileSync(gitignorePath, nextContent, "utf8");
33
+ result.updated.push(".gitignore");
34
+ }
10
35
  function normalizeRemoteMcpUrl(apiUrl) {
11
36
  const raw = apiUrl?.trim();
12
37
  if (!raw) {
@@ -291,6 +316,7 @@ function initWorkspaceConfigs(rootDir, options = {}) {
291
316
  ),
292
317
  result
293
318
  );
319
+ ensureGitignoreIgnoresTipolink(resolvedRoot, result);
294
320
  return result;
295
321
  }
296
322
  export {
@@ -1,6 +1,7 @@
1
1
  import { type SymbolSearchMatch } from '@tipolink/engine';
2
2
  export declare const DEFAULT_CLOUD_API_URL = "https://tipolink.co";
3
3
  export declare const DEFAULT_PORTAL_URL = "https://tipolink.co";
4
+ export declare const TIPOLINK_MCP_VERSION = "1.0.2";
4
5
  export type JsonRpcFrameMode = 'ndjson' | 'content-length';
5
6
  export interface JsonRpcRequest {
6
7
  jsonrpc?: string;