@graphty/remote-logger 1.1.1 → 1.2.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.
Files changed (110) hide show
  1. package/README.md +318 -10
  2. package/dist/client/RemoteLogClient.d.ts +2 -0
  3. package/dist/client/RemoteLogClient.d.ts.map +1 -1
  4. package/dist/client/RemoteLogClient.js +35 -4
  5. package/dist/client/RemoteLogClient.js.map +1 -1
  6. package/dist/client/types.d.ts +13 -0
  7. package/dist/client/types.d.ts.map +1 -1
  8. package/dist/mcp/index.d.ts +9 -0
  9. package/dist/mcp/index.d.ts.map +1 -0
  10. package/dist/mcp/index.js +9 -0
  11. package/dist/mcp/index.js.map +1 -0
  12. package/dist/mcp/mcp-server.d.ts +32 -0
  13. package/dist/mcp/mcp-server.d.ts.map +1 -0
  14. package/dist/mcp/mcp-server.js +270 -0
  15. package/dist/mcp/mcp-server.js.map +1 -0
  16. package/dist/mcp/tools/index.d.ts +14 -0
  17. package/dist/mcp/tools/index.d.ts.map +1 -0
  18. package/dist/mcp/tools/index.js +14 -0
  19. package/dist/mcp/tools/index.js.map +1 -0
  20. package/dist/mcp/tools/logs-clear.d.ts +76 -0
  21. package/dist/mcp/tools/logs-clear.d.ts.map +1 -0
  22. package/dist/mcp/tools/logs-clear.js +58 -0
  23. package/dist/mcp/tools/logs-clear.js.map +1 -0
  24. package/dist/mcp/tools/logs-get-all.d.ts +60 -0
  25. package/dist/mcp/tools/logs-get-all.d.ts.map +1 -0
  26. package/dist/mcp/tools/logs-get-all.js +50 -0
  27. package/dist/mcp/tools/logs-get-all.js.map +1 -0
  28. package/dist/mcp/tools/logs-get-errors.d.ts +65 -0
  29. package/dist/mcp/tools/logs-get-errors.d.ts.map +1 -0
  30. package/dist/mcp/tools/logs-get-errors.js +46 -0
  31. package/dist/mcp/tools/logs-get-errors.js.map +1 -0
  32. package/dist/mcp/tools/logs-get-file-path.d.ts +75 -0
  33. package/dist/mcp/tools/logs-get-file-path.d.ts.map +1 -0
  34. package/dist/mcp/tools/logs-get-file-path.js +90 -0
  35. package/dist/mcp/tools/logs-get-file-path.js.map +1 -0
  36. package/dist/mcp/tools/logs-get-recent.d.ts +89 -0
  37. package/dist/mcp/tools/logs-get-recent.d.ts.map +1 -0
  38. package/dist/mcp/tools/logs-get-recent.js +74 -0
  39. package/dist/mcp/tools/logs-get-recent.js.map +1 -0
  40. package/dist/mcp/tools/logs-list-sessions.d.ts +64 -0
  41. package/dist/mcp/tools/logs-list-sessions.d.ts.map +1 -0
  42. package/dist/mcp/tools/logs-list-sessions.js +48 -0
  43. package/dist/mcp/tools/logs-list-sessions.js.map +1 -0
  44. package/dist/mcp/tools/logs-receive.d.ts +150 -0
  45. package/dist/mcp/tools/logs-receive.d.ts.map +1 -0
  46. package/dist/mcp/tools/logs-receive.js +68 -0
  47. package/dist/mcp/tools/logs-receive.js.map +1 -0
  48. package/dist/mcp/tools/logs-search.d.ts +91 -0
  49. package/dist/mcp/tools/logs-search.d.ts.map +1 -0
  50. package/dist/mcp/tools/logs-search.js +68 -0
  51. package/dist/mcp/tools/logs-search.js.map +1 -0
  52. package/dist/mcp/tools/logs-status.d.ts +45 -0
  53. package/dist/mcp/tools/logs-status.d.ts.map +1 -0
  54. package/dist/mcp/tools/logs-status.js +45 -0
  55. package/dist/mcp/tools/logs-status.js.map +1 -0
  56. package/dist/server/dual-server.d.ts +76 -0
  57. package/dist/server/dual-server.d.ts.map +1 -0
  58. package/dist/server/dual-server.js +214 -0
  59. package/dist/server/dual-server.js.map +1 -0
  60. package/dist/server/index.d.ts +5 -1
  61. package/dist/server/index.d.ts.map +1 -1
  62. package/dist/server/index.js +5 -1
  63. package/dist/server/index.js.map +1 -1
  64. package/dist/server/jsonl-writer.d.ts +93 -0
  65. package/dist/server/jsonl-writer.d.ts.map +1 -0
  66. package/dist/server/jsonl-writer.js +205 -0
  67. package/dist/server/jsonl-writer.js.map +1 -0
  68. package/dist/server/log-server.d.ts +62 -11
  69. package/dist/server/log-server.d.ts.map +1 -1
  70. package/dist/server/log-server.js +237 -101
  71. package/dist/server/log-server.js.map +1 -1
  72. package/dist/server/log-storage.d.ts +301 -0
  73. package/dist/server/log-storage.d.ts.map +1 -0
  74. package/dist/server/log-storage.js +408 -0
  75. package/dist/server/log-storage.js.map +1 -0
  76. package/dist/server/marker-utils.d.ts +69 -0
  77. package/dist/server/marker-utils.d.ts.map +1 -0
  78. package/dist/server/marker-utils.js +118 -0
  79. package/dist/server/marker-utils.js.map +1 -0
  80. package/dist/vite/index.d.ts +8 -0
  81. package/dist/vite/index.d.ts.map +1 -0
  82. package/dist/vite/index.js +8 -0
  83. package/dist/vite/index.js.map +1 -0
  84. package/dist/vite/plugin.d.ts +42 -0
  85. package/dist/vite/plugin.d.ts.map +1 -0
  86. package/dist/vite/plugin.js +46 -0
  87. package/dist/vite/plugin.js.map +1 -0
  88. package/package.json +12 -2
  89. package/src/client/RemoteLogClient.ts +52 -4
  90. package/src/client/types.ts +13 -0
  91. package/src/mcp/index.ts +25 -0
  92. package/src/mcp/mcp-server.ts +364 -0
  93. package/src/mcp/tools/index.ts +69 -0
  94. package/src/mcp/tools/logs-clear.ts +86 -0
  95. package/src/mcp/tools/logs-get-all.ts +78 -0
  96. package/src/mcp/tools/logs-get-errors.ts +71 -0
  97. package/src/mcp/tools/logs-get-file-path.ts +121 -0
  98. package/src/mcp/tools/logs-get-recent.ts +104 -0
  99. package/src/mcp/tools/logs-list-sessions.ts +71 -0
  100. package/src/mcp/tools/logs-receive.ts +96 -0
  101. package/src/mcp/tools/logs-search.ts +95 -0
  102. package/src/mcp/tools/logs-status.ts +69 -0
  103. package/src/server/dual-server.ts +308 -0
  104. package/src/server/index.ts +37 -0
  105. package/src/server/jsonl-writer.ts +277 -0
  106. package/src/server/log-server.ts +311 -119
  107. package/src/server/log-storage.ts +651 -0
  108. package/src/server/marker-utils.ts +144 -0
  109. package/src/vite/index.ts +8 -0
  110. package/src/vite/plugin.ts +59 -0
@@ -0,0 +1,46 @@
1
+ /**
2
+ * logs_get_errors MCP tool implementation.
3
+ *
4
+ * Returns only ERROR level logs.
5
+ * @module mcp/tools/logs-get-errors
6
+ */
7
+ import * as z from "zod/v3";
8
+ /**
9
+ * Input schema for the logs_get_errors tool.
10
+ */
11
+ export const logsGetErrorsInputSchema = z.object({
12
+ /** Filter errors to a specific project identifier. Returns all projects if omitted. */
13
+ projectMarker: z.string().optional(),
14
+ /** Return only errors after this timestamp. Format: ISO 8601 (e.g., "2025-01-08T12:00:00Z"). */
15
+ since: z.string().optional(),
16
+ });
17
+ /**
18
+ * Handler for the logs_get_errors tool.
19
+ *
20
+ * Returns only ERROR level logs, sorted chronologically.
21
+ * @param storage - The log storage instance
22
+ * @param input - Input parameters
23
+ * @returns Error logs and count
24
+ */
25
+ export function logsGetErrorsHandler(storage, input) {
26
+ const errors = storage.getErrors({
27
+ projectMarker: input.projectMarker,
28
+ since: input.since,
29
+ });
30
+ return Promise.resolve({
31
+ errors,
32
+ count: errors.length,
33
+ });
34
+ }
35
+ /**
36
+ * Tool definition for MCP registration.
37
+ */
38
+ export const logsGetErrorsTool = {
39
+ name: "logs_get_errors",
40
+ description: "Get only ERROR level logs. " +
41
+ "Use this to quickly find error messages across all sessions. " +
42
+ "This is faster and more focused than logs_get_recent when you only need errors. " +
43
+ "Results are sorted chronologically.",
44
+ inputSchema: logsGetErrorsInputSchema,
45
+ };
46
+ //# sourceMappingURL=logs-get-errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logs-get-errors.js","sourceRoot":"","sources":["../../../src/mcp/tools/logs-get-errors.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAI5B;;GAEG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC7C,uFAAuF;IACvF,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACpC,gGAAgG;IAChG,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC/B,CAAC,CAAC;AAiBH;;;;;;;GAOG;AACH,MAAM,UAAU,oBAAoB,CAChC,OAAmB,EACnB,KAAkC;IAElC,MAAM,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC;QAC7B,aAAa,EAAE,KAAK,CAAC,aAAa;QAClC,KAAK,EAAE,KAAK,CAAC,KAAK;KACrB,CAAC,CAAC;IAEH,OAAO,OAAO,CAAC,OAAO,CAAC;QACnB,MAAM;QACN,KAAK,EAAE,MAAM,CAAC,MAAM;KACvB,CAAC,CAAC;AACP,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC7B,IAAI,EAAE,iBAAiB;IACvB,WAAW,EACP,6BAA6B;QAC7B,+DAA+D;QAC/D,kFAAkF;QAClF,qCAAqC;IACzC,WAAW,EAAE,wBAAwB;CACxC,CAAC"}
@@ -0,0 +1,75 @@
1
+ /**
2
+ * logs_get_file_path MCP tool implementation.
3
+ *
4
+ * Returns the path to the JSONL log file for a project.
5
+ * @module mcp/tools/logs-get-file-path
6
+ */
7
+ import * as z from "zod/v3";
8
+ import type { LogStorage } from "../../server/log-storage.js";
9
+ /**
10
+ * Input schema for the logs_get_file_path tool.
11
+ */
12
+ export declare const logsGetFilePathInputSchema: z.ZodObject<{
13
+ /** Project identifier to get the log file for. Derived from workingDirectory if not provided. */
14
+ projectMarker: z.ZodOptional<z.ZodString>;
15
+ /** Directory path to derive project marker from. Ignored if projectMarker is set. */
16
+ workingDirectory: z.ZodOptional<z.ZodString>;
17
+ }, "strip", z.ZodTypeAny, {
18
+ projectMarker?: string | undefined;
19
+ workingDirectory?: string | undefined;
20
+ }, {
21
+ projectMarker?: string | undefined;
22
+ workingDirectory?: string | undefined;
23
+ }>;
24
+ /**
25
+ * Input type for the logs_get_file_path handler.
26
+ */
27
+ export type LogsGetFilePathInput = z.infer<typeof logsGetFilePathInputSchema>;
28
+ /**
29
+ * Output type for the logs_get_file_path handler.
30
+ */
31
+ export interface LogsGetFilePathOutput {
32
+ /** Full path to the JSONL log file */
33
+ path: string;
34
+ /** Whether the file exists */
35
+ exists: boolean;
36
+ /** File size in bytes (0 if file doesn't exist) */
37
+ size: number;
38
+ }
39
+ /**
40
+ * Get the default JSONL file path for a project marker.
41
+ * This is used when no JsonlWriter is configured.
42
+ * @param projectMarker - The project marker
43
+ * @returns Full path to the JSONL file
44
+ */
45
+ export declare function getLogFilePath(projectMarker: string): string;
46
+ /**
47
+ * Handler for the logs_get_file_path tool.
48
+ *
49
+ * Returns the path to the JSONL log file for the specified project.
50
+ * The file may not exist if no logs have been written yet.
51
+ * @param storage - The log storage instance
52
+ * @param input - Input parameters
53
+ * @returns File path, existence status, and size
54
+ */
55
+ export declare function logsGetFilePathHandler(storage: LogStorage, input: Partial<LogsGetFilePathInput>): Promise<LogsGetFilePathOutput>;
56
+ /**
57
+ * Tool definition for MCP registration.
58
+ */
59
+ export declare const logsGetFilePathTool: {
60
+ name: string;
61
+ description: string;
62
+ inputSchema: z.ZodObject<{
63
+ /** Project identifier to get the log file for. Derived from workingDirectory if not provided. */
64
+ projectMarker: z.ZodOptional<z.ZodString>;
65
+ /** Directory path to derive project marker from. Ignored if projectMarker is set. */
66
+ workingDirectory: z.ZodOptional<z.ZodString>;
67
+ }, "strip", z.ZodTypeAny, {
68
+ projectMarker?: string | undefined;
69
+ workingDirectory?: string | undefined;
70
+ }, {
71
+ projectMarker?: string | undefined;
72
+ workingDirectory?: string | undefined;
73
+ }>;
74
+ };
75
+ //# sourceMappingURL=logs-get-file-path.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logs-get-file-path.d.ts","sourceRoot":"","sources":["../../../src/mcp/tools/logs-get-file-path.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAE5B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAG9D;;GAEG;AACH,eAAO,MAAM,0BAA0B;IACnC,iGAAiG;;IAEjG,qFAAqF;;;;;;;;EAEvF,CAAC;AAEH;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE9E;;GAEG;AACH,MAAM,WAAW,qBAAqB;IAClC,sCAAsC;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,8BAA8B;IAC9B,MAAM,EAAE,OAAO,CAAC;IAChB,mDAAmD;IACnD,IAAI,EAAE,MAAM,CAAC;CAChB;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,CAE5D;AAED;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CAClC,OAAO,EAAE,UAAU,EACnB,KAAK,EAAE,OAAO,CAAC,oBAAoB,CAAC,GACrC,OAAO,CAAC,qBAAqB,CAAC,CA2ChC;AAED;;GAEG;AACH,eAAO,MAAM,mBAAmB;;;;QA7F5B,iGAAiG;;QAEjG,qFAAqF;;;;;;;;;CAmGxF,CAAC"}
@@ -0,0 +1,90 @@
1
+ /**
2
+ * logs_get_file_path MCP tool implementation.
3
+ *
4
+ * Returns the path to the JSONL log file for a project.
5
+ * @module mcp/tools/logs-get-file-path
6
+ */
7
+ import * as fs from "fs";
8
+ import * as os from "os";
9
+ import * as path from "path";
10
+ import * as z from "zod/v3";
11
+ import { resolveProjectMarker } from "../../server/marker-utils.js";
12
+ /**
13
+ * Input schema for the logs_get_file_path tool.
14
+ */
15
+ export const logsGetFilePathInputSchema = z.object({
16
+ /** Project identifier to get the log file for. Derived from workingDirectory if not provided. */
17
+ projectMarker: z.string().optional(),
18
+ /** Directory path to derive project marker from. Ignored if projectMarker is set. */
19
+ workingDirectory: z.string().optional(),
20
+ });
21
+ /**
22
+ * Get the default JSONL file path for a project marker.
23
+ * This is used when no JsonlWriter is configured.
24
+ * @param projectMarker - The project marker
25
+ * @returns Full path to the JSONL file
26
+ */
27
+ export function getLogFilePath(projectMarker) {
28
+ return path.join(os.tmpdir(), "remote-logger", projectMarker, "logs.jsonl");
29
+ }
30
+ /**
31
+ * Handler for the logs_get_file_path tool.
32
+ *
33
+ * Returns the path to the JSONL log file for the specified project.
34
+ * The file may not exist if no logs have been written yet.
35
+ * @param storage - The log storage instance
36
+ * @param input - Input parameters
37
+ * @returns File path, existence status, and size
38
+ */
39
+ export function logsGetFilePathHandler(storage, input) {
40
+ // Resolve project marker
41
+ const projectMarker = resolveProjectMarker({
42
+ projectMarker: input.projectMarker,
43
+ workingDirectory: input.workingDirectory,
44
+ });
45
+ // Get file path from JsonlWriter if available, otherwise use default
46
+ const jsonlWriter = storage.getJsonlWriter();
47
+ const filePath = jsonlWriter
48
+ ? jsonlWriter.getFilePath(projectMarker)
49
+ : getLogFilePath(projectMarker);
50
+ // Check if file exists and get stats
51
+ // Prefer JsonlWriter stats if available for consistency
52
+ if (jsonlWriter) {
53
+ const stats = jsonlWriter.getFileStats(projectMarker);
54
+ if (stats) {
55
+ return Promise.resolve({
56
+ path: filePath,
57
+ exists: stats.exists,
58
+ size: stats.size,
59
+ });
60
+ }
61
+ }
62
+ // Fall back to direct file system check
63
+ let exists = false;
64
+ let size = 0;
65
+ try {
66
+ const stats = fs.statSync(filePath);
67
+ exists = true;
68
+ ({ size } = stats);
69
+ }
70
+ catch {
71
+ // File doesn't exist, use defaults
72
+ }
73
+ return Promise.resolve({
74
+ path: filePath,
75
+ exists,
76
+ size,
77
+ });
78
+ }
79
+ /**
80
+ * Tool definition for MCP registration.
81
+ */
82
+ export const logsGetFilePathTool = {
83
+ name: "logs_get_file_path",
84
+ description: "Get the file path to the JSONL log file for a project. " +
85
+ "Use this to access logs via file-based tools like Grep or Read. " +
86
+ "Each project has its own log file. " +
87
+ "The file may not exist if no logs have been written yet for that project.",
88
+ inputSchema: logsGetFilePathInputSchema,
89
+ };
90
+ //# sourceMappingURL=logs-get-file-path.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logs-get-file-path.js","sourceRoot":"","sources":["../../../src/mcp/tools/logs-get-file-path.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAG5B,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAEpE;;GAEG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC,MAAM,CAAC;IAC/C,iGAAiG;IACjG,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACpC,qFAAqF;IACrF,gBAAgB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC1C,CAAC,CAAC;AAmBH;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAAC,aAAqB;IAChD,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,MAAM,EAAE,EAAE,eAAe,EAAE,aAAa,EAAE,YAAY,CAAC,CAAC;AAChF,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,sBAAsB,CAClC,OAAmB,EACnB,KAAoC;IAEpC,yBAAyB;IACzB,MAAM,aAAa,GAAG,oBAAoB,CAAC;QACvC,aAAa,EAAE,KAAK,CAAC,aAAa;QAClC,gBAAgB,EAAE,KAAK,CAAC,gBAAgB;KAC3C,CAAC,CAAC;IAEH,qEAAqE;IACrE,MAAM,WAAW,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC;IAC7C,MAAM,QAAQ,GAAG,WAAW;QACxB,CAAC,CAAC,WAAW,CAAC,WAAW,CAAC,aAAa,CAAC;QACxC,CAAC,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC;IAEpC,qCAAqC;IACrC,wDAAwD;IACxD,IAAI,WAAW,EAAE,CAAC;QACd,MAAM,KAAK,GAAG,WAAW,CAAC,YAAY,CAAC,aAAa,CAAC,CAAC;QACtD,IAAI,KAAK,EAAE,CAAC;YACR,OAAO,OAAO,CAAC,OAAO,CAAC;gBACnB,IAAI,EAAE,QAAQ;gBACd,MAAM,EAAE,KAAK,CAAC,MAAM;gBACpB,IAAI,EAAE,KAAK,CAAC,IAAI;aACnB,CAAC,CAAC;QACP,CAAC;IACL,CAAC;IAED,wCAAwC;IACxC,IAAI,MAAM,GAAG,KAAK,CAAC;IACnB,IAAI,IAAI,GAAG,CAAC,CAAC;IAEb,IAAI,CAAC;QACD,MAAM,KAAK,GAAG,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;QACpC,MAAM,GAAG,IAAI,CAAC;QACd,CAAC,EAAE,IAAI,EAAE,GAAG,KAAK,CAAC,CAAC;IACvB,CAAC;IAAC,MAAM,CAAC;QACL,mCAAmC;IACvC,CAAC;IAED,OAAO,OAAO,CAAC,OAAO,CAAC;QACnB,IAAI,EAAE,QAAQ;QACd,MAAM;QACN,IAAI;KACP,CAAC,CAAC;AACP,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG;IAC/B,IAAI,EAAE,oBAAoB;IAC1B,WAAW,EACP,yDAAyD;QACzD,kEAAkE;QAClE,qCAAqC;QACrC,2EAA2E;IAC/E,WAAW,EAAE,0BAA0B;CAC1C,CAAC"}
@@ -0,0 +1,89 @@
1
+ /**
2
+ * logs_get_recent MCP tool implementation.
3
+ *
4
+ * Returns recent logs sorted by time with optional filtering.
5
+ * @module mcp/tools/logs-get-recent
6
+ */
7
+ import * as z from "zod/v3";
8
+ import type { LogEntryWithSession, LogStorage } from "../../server/log-storage.js";
9
+ /**
10
+ * Input schema for the logs_get_recent tool.
11
+ * Note: We use a simple shape without .default() to be compatible with MCP SDK.
12
+ */
13
+ export declare const logsGetRecentInputSchema: z.ZodObject<{
14
+ /** Number of logs to return. Defaults to 50. Range: 1-500. */
15
+ count: z.ZodOptional<z.ZodNumber>;
16
+ /** Filter logs to a specific project. Derived from workingDirectory if not provided. */
17
+ projectMarker: z.ZodOptional<z.ZodString>;
18
+ /** Directory path to derive project marker from. Ignored if projectMarker is set. */
19
+ workingDirectory: z.ZodOptional<z.ZodString>;
20
+ /** Filter by log level (e.g., "INFO", "ERROR", "DEBUG"). Case-sensitive. */
21
+ level: z.ZodOptional<z.ZodString>;
22
+ /** Return only logs after this timestamp. Format: ISO 8601 (e.g., "2025-01-08T12:00:00Z"). */
23
+ since: z.ZodOptional<z.ZodString>;
24
+ }, "strip", z.ZodTypeAny, {
25
+ level?: string | undefined;
26
+ projectMarker?: string | undefined;
27
+ since?: string | undefined;
28
+ workingDirectory?: string | undefined;
29
+ count?: number | undefined;
30
+ }, {
31
+ level?: string | undefined;
32
+ projectMarker?: string | undefined;
33
+ since?: string | undefined;
34
+ workingDirectory?: string | undefined;
35
+ count?: number | undefined;
36
+ }>;
37
+ /**
38
+ * Input type for the logs_get_recent handler.
39
+ */
40
+ export type LogsGetRecentInput = z.infer<typeof logsGetRecentInputSchema>;
41
+ /**
42
+ * Output type for the logs_get_recent handler.
43
+ */
44
+ export interface LogsGetRecentOutput {
45
+ logs: LogEntryWithSession[];
46
+ count: number;
47
+ }
48
+ /**
49
+ * Handler for the logs_get_recent tool.
50
+ *
51
+ * Returns recent logs sorted by time (oldest first), with optional filtering
52
+ * by project marker, level, or timestamp.
53
+ * @param storage - The log storage instance
54
+ * @param input - Input parameters
55
+ * @returns Recent logs and count
56
+ */
57
+ export declare function logsGetRecentHandler(storage: LogStorage, input: Partial<LogsGetRecentInput>): Promise<LogsGetRecentOutput>;
58
+ /**
59
+ * Tool definition for MCP registration.
60
+ */
61
+ export declare const logsGetRecentTool: {
62
+ name: string;
63
+ description: string;
64
+ inputSchema: z.ZodObject<{
65
+ /** Number of logs to return. Defaults to 50. Range: 1-500. */
66
+ count: z.ZodOptional<z.ZodNumber>;
67
+ /** Filter logs to a specific project. Derived from workingDirectory if not provided. */
68
+ projectMarker: z.ZodOptional<z.ZodString>;
69
+ /** Directory path to derive project marker from. Ignored if projectMarker is set. */
70
+ workingDirectory: z.ZodOptional<z.ZodString>;
71
+ /** Filter by log level (e.g., "INFO", "ERROR", "DEBUG"). Case-sensitive. */
72
+ level: z.ZodOptional<z.ZodString>;
73
+ /** Return only logs after this timestamp. Format: ISO 8601 (e.g., "2025-01-08T12:00:00Z"). */
74
+ since: z.ZodOptional<z.ZodString>;
75
+ }, "strip", z.ZodTypeAny, {
76
+ level?: string | undefined;
77
+ projectMarker?: string | undefined;
78
+ since?: string | undefined;
79
+ workingDirectory?: string | undefined;
80
+ count?: number | undefined;
81
+ }, {
82
+ level?: string | undefined;
83
+ projectMarker?: string | undefined;
84
+ since?: string | undefined;
85
+ workingDirectory?: string | undefined;
86
+ count?: number | undefined;
87
+ }>;
88
+ };
89
+ //# sourceMappingURL=logs-get-recent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logs-get-recent.d.ts","sourceRoot":"","sources":["../../../src/mcp/tools/logs-get-recent.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAE5B,OAAO,KAAK,EAAE,mBAAmB,EAAY,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAG7F;;;GAGG;AACH,eAAO,MAAM,wBAAwB;IACjC,8DAA8D;;IAE9D,wFAAwF;;IAExF,qFAAqF;;IAErF,4EAA4E;;IAE5E,8FAA8F;;;;;;;;;;;;;;EAEhG,CAAC;AAEH;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE1E;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAChC,IAAI,EAAE,mBAAmB,EAAE,CAAC;IAC5B,KAAK,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAChC,OAAO,EAAE,UAAU,EACnB,KAAK,EAAE,OAAO,CAAC,kBAAkB,CAAC,GACnC,OAAO,CAAC,mBAAmB,CAAC,CAmC9B;AAED;;GAEG;AACH,eAAO,MAAM,iBAAiB;;;;QA7E1B,8DAA8D;;QAE9D,wFAAwF;;QAExF,qFAAqF;;QAErF,4EAA4E;;QAE5E,8FAA8F;;;;;;;;;;;;;;;CA8EjG,CAAC"}
@@ -0,0 +1,74 @@
1
+ /**
2
+ * logs_get_recent MCP tool implementation.
3
+ *
4
+ * Returns recent logs sorted by time with optional filtering.
5
+ * @module mcp/tools/logs-get-recent
6
+ */
7
+ import * as z from "zod/v3";
8
+ import { resolveProjectMarker } from "../../server/marker-utils.js";
9
+ /**
10
+ * Input schema for the logs_get_recent tool.
11
+ * Note: We use a simple shape without .default() to be compatible with MCP SDK.
12
+ */
13
+ export const logsGetRecentInputSchema = z.object({
14
+ /** Number of logs to return. Defaults to 50. Range: 1-500. */
15
+ count: z.number().int().min(1).max(500).optional(),
16
+ /** Filter logs to a specific project. Derived from workingDirectory if not provided. */
17
+ projectMarker: z.string().optional(),
18
+ /** Directory path to derive project marker from. Ignored if projectMarker is set. */
19
+ workingDirectory: z.string().optional(),
20
+ /** Filter by log level (e.g., "INFO", "ERROR", "DEBUG"). Case-sensitive. */
21
+ level: z.string().optional(),
22
+ /** Return only logs after this timestamp. Format: ISO 8601 (e.g., "2025-01-08T12:00:00Z"). */
23
+ since: z.string().optional(),
24
+ });
25
+ /**
26
+ * Handler for the logs_get_recent tool.
27
+ *
28
+ * Returns recent logs sorted by time (oldest first), with optional filtering
29
+ * by project marker, level, or timestamp.
30
+ * @param storage - The log storage instance
31
+ * @param input - Input parameters
32
+ * @returns Recent logs and count
33
+ */
34
+ export function logsGetRecentHandler(storage, input) {
35
+ // Apply defaults
36
+ const requestedCount = input.count ?? 50;
37
+ // Resolve project marker from input
38
+ const projectMarker = resolveProjectMarker({
39
+ projectMarker: input.projectMarker,
40
+ workingDirectory: input.workingDirectory,
41
+ });
42
+ // Build filter
43
+ const filter = {};
44
+ if (projectMarker !== "default") {
45
+ filter.projectMarker = projectMarker;
46
+ }
47
+ if (input.level) {
48
+ filter.level = input.level;
49
+ }
50
+ if (input.since) {
51
+ filter.since = input.since;
52
+ }
53
+ // Ensure count doesn't exceed 500
54
+ const limitedCount = Math.min(requestedCount, 500);
55
+ // Get recent logs
56
+ const logs = storage.getRecentLogs(limitedCount, filter);
57
+ return Promise.resolve({
58
+ logs,
59
+ count: logs.length,
60
+ });
61
+ }
62
+ /**
63
+ * Tool definition for MCP registration.
64
+ */
65
+ export const logsGetRecentTool = {
66
+ name: "logs_get_recent",
67
+ description: "Get recent logs from the remote log server, sorted by time (oldest first). " +
68
+ "Use this to see the latest log output from browser applications. " +
69
+ "This is the primary tool for viewing logs. " +
70
+ "For error-only logs, use logs_get_errors instead. " +
71
+ "For searching specific text, use logs_search.",
72
+ inputSchema: logsGetRecentInputSchema,
73
+ };
74
+ //# sourceMappingURL=logs-get-recent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logs-get-recent.js","sourceRoot":"","sources":["../../../src/mcp/tools/logs-get-recent.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAG5B,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAEpE;;;GAGG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC7C,8DAA8D;IAC9D,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE;IAClD,wFAAwF;IACxF,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACpC,qFAAqF;IACrF,gBAAgB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACvC,4EAA4E;IAC5E,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC5B,8FAA8F;IAC9F,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC/B,CAAC,CAAC;AAeH;;;;;;;;GAQG;AACH,MAAM,UAAU,oBAAoB,CAChC,OAAmB,EACnB,KAAkC;IAElC,iBAAiB;IACjB,MAAM,cAAc,GAAG,KAAK,CAAC,KAAK,IAAI,EAAE,CAAC;IAEzC,oCAAoC;IACpC,MAAM,aAAa,GAAG,oBAAoB,CAAC;QACvC,aAAa,EAAE,KAAK,CAAC,aAAa;QAClC,gBAAgB,EAAE,KAAK,CAAC,gBAAgB;KAC3C,CAAC,CAAC;IAEH,eAAe;IACf,MAAM,MAAM,GAAc,EAAE,CAAC;IAE7B,IAAI,aAAa,KAAK,SAAS,EAAE,CAAC;QAC9B,MAAM,CAAC,aAAa,GAAG,aAAa,CAAC;IACzC,CAAC;IAED,IAAI,KAAK,CAAC,KAAK,EAAE,CAAC;QACd,MAAM,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;IAC/B,CAAC;IAED,IAAI,KAAK,CAAC,KAAK,EAAE,CAAC;QACd,MAAM,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;IAC/B,CAAC;IAED,kCAAkC;IAClC,MAAM,YAAY,GAAG,IAAI,CAAC,GAAG,CAAC,cAAc,EAAE,GAAG,CAAC,CAAC;IAEnD,kBAAkB;IAClB,MAAM,IAAI,GAAG,OAAO,CAAC,aAAa,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC;IAEzD,OAAO,OAAO,CAAC,OAAO,CAAC;QACnB,IAAI;QACJ,KAAK,EAAE,IAAI,CAAC,MAAM;KACrB,CAAC,CAAC;AACP,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC7B,IAAI,EAAE,iBAAiB;IACvB,WAAW,EACP,6EAA6E;QAC7E,mEAAmE;QACnE,6CAA6C;QAC7C,oDAAoD;QACpD,+CAA+C;IACnD,WAAW,EAAE,wBAAwB;CACxC,CAAC"}
@@ -0,0 +1,64 @@
1
+ /**
2
+ * logs_list_sessions MCP tool implementation.
3
+ *
4
+ * Lists all logging sessions with their metadata.
5
+ * @module mcp/tools/logs-list-sessions
6
+ */
7
+ import * as z from "zod/v3";
8
+ import type { LogStorage, SessionMetadata } from "../../server/log-storage.js";
9
+ /**
10
+ * Input schema for the logs_list_sessions tool.
11
+ */
12
+ export declare const logsListSessionsInputSchema: z.ZodObject<{
13
+ /** Filter sessions to a specific project identifier. */
14
+ projectMarker: z.ZodOptional<z.ZodString>;
15
+ /** When true, only return sessions that contain error-level logs. */
16
+ hasErrors: z.ZodOptional<z.ZodBoolean>;
17
+ }, "strip", z.ZodTypeAny, {
18
+ projectMarker?: string | undefined;
19
+ hasErrors?: boolean | undefined;
20
+ }, {
21
+ projectMarker?: string | undefined;
22
+ hasErrors?: boolean | undefined;
23
+ }>;
24
+ /**
25
+ * Input type for the logs_list_sessions handler.
26
+ */
27
+ export type LogsListSessionsInput = z.infer<typeof logsListSessionsInputSchema>;
28
+ /**
29
+ * Output type for the logs_list_sessions handler.
30
+ */
31
+ export interface LogsListSessionsOutput {
32
+ sessions: SessionMetadata[];
33
+ count: number;
34
+ }
35
+ /**
36
+ * Handler for the logs_list_sessions tool.
37
+ *
38
+ * Lists all logging sessions with their metadata including project marker,
39
+ * log counts, error counts, and timestamps.
40
+ * @param storage - The log storage instance
41
+ * @param input - Input parameters
42
+ * @returns List of sessions and count
43
+ */
44
+ export declare function logsListSessionsHandler(storage: LogStorage, input: Partial<LogsListSessionsInput>): Promise<LogsListSessionsOutput>;
45
+ /**
46
+ * Tool definition for MCP registration.
47
+ */
48
+ export declare const logsListSessionsTool: {
49
+ name: string;
50
+ description: string;
51
+ inputSchema: z.ZodObject<{
52
+ /** Filter sessions to a specific project identifier. */
53
+ projectMarker: z.ZodOptional<z.ZodString>;
54
+ /** When true, only return sessions that contain error-level logs. */
55
+ hasErrors: z.ZodOptional<z.ZodBoolean>;
56
+ }, "strip", z.ZodTypeAny, {
57
+ projectMarker?: string | undefined;
58
+ hasErrors?: boolean | undefined;
59
+ }, {
60
+ projectMarker?: string | undefined;
61
+ hasErrors?: boolean | undefined;
62
+ }>;
63
+ };
64
+ //# sourceMappingURL=logs-list-sessions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logs-list-sessions.d.ts","sourceRoot":"","sources":["../../../src/mcp/tools/logs-list-sessions.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAE5B,OAAO,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAE/E;;GAEG;AACH,eAAO,MAAM,2BAA2B;IACpC,wDAAwD;;IAExD,qEAAqE;;;;;;;;EAEvE,CAAC;AAEH;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAEhF;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACnC,QAAQ,EAAE,eAAe,EAAE,CAAC;IAC5B,KAAK,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CACnC,OAAO,EAAE,UAAU,EACnB,KAAK,EAAE,OAAO,CAAC,qBAAqB,CAAC,GACtC,OAAO,CAAC,sBAAsB,CAAC,CAWjC;AAED;;GAEG;AACH,eAAO,MAAM,oBAAoB;;;;QA/C7B,wDAAwD;;QAExD,qEAAqE;;;;;;;;;CAqDxE,CAAC"}
@@ -0,0 +1,48 @@
1
+ /**
2
+ * logs_list_sessions MCP tool implementation.
3
+ *
4
+ * Lists all logging sessions with their metadata.
5
+ * @module mcp/tools/logs-list-sessions
6
+ */
7
+ import * as z from "zod/v3";
8
+ /**
9
+ * Input schema for the logs_list_sessions tool.
10
+ */
11
+ export const logsListSessionsInputSchema = z.object({
12
+ /** Filter sessions to a specific project identifier. */
13
+ projectMarker: z.string().optional(),
14
+ /** When true, only return sessions that contain error-level logs. */
15
+ hasErrors: z.boolean().optional(),
16
+ });
17
+ /**
18
+ * Handler for the logs_list_sessions tool.
19
+ *
20
+ * Lists all logging sessions with their metadata including project marker,
21
+ * log counts, error counts, and timestamps.
22
+ * @param storage - The log storage instance
23
+ * @param input - Input parameters
24
+ * @returns List of sessions and count
25
+ */
26
+ export function logsListSessionsHandler(storage, input) {
27
+ // Get sessions with filter
28
+ const sessions = storage.getSessions({
29
+ projectMarker: input.projectMarker,
30
+ hasErrors: input.hasErrors,
31
+ });
32
+ return Promise.resolve({
33
+ sessions,
34
+ count: sessions.length,
35
+ });
36
+ }
37
+ /**
38
+ * Tool definition for MCP registration.
39
+ */
40
+ export const logsListSessionsTool = {
41
+ name: "logs_list_sessions",
42
+ description: "List all logging sessions with their metadata. " +
43
+ "Each session represents a browser tab or application instance. " +
44
+ "Use this to discover active sessions before fetching their logs, " +
45
+ "or to find sessions with errors using the hasErrors filter.",
46
+ inputSchema: logsListSessionsInputSchema,
47
+ };
48
+ //# sourceMappingURL=logs-list-sessions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logs-list-sessions.js","sourceRoot":"","sources":["../../../src/mcp/tools/logs-list-sessions.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAI5B;;GAEG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,CAAC,MAAM,CAAC;IAChD,wDAAwD;IACxD,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACpC,qEAAqE;IACrE,SAAS,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;CACpC,CAAC,CAAC;AAeH;;;;;;;;GAQG;AACH,MAAM,UAAU,uBAAuB,CACnC,OAAmB,EACnB,KAAqC;IAErC,2BAA2B;IAC3B,MAAM,QAAQ,GAAG,OAAO,CAAC,WAAW,CAAC;QACjC,aAAa,EAAE,KAAK,CAAC,aAAa;QAClC,SAAS,EAAE,KAAK,CAAC,SAAS;KAC7B,CAAC,CAAC;IAEH,OAAO,OAAO,CAAC,OAAO,CAAC;QACnB,QAAQ;QACR,KAAK,EAAE,QAAQ,CAAC,MAAM;KACzB,CAAC,CAAC;AACP,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAChC,IAAI,EAAE,oBAAoB;IAC1B,WAAW,EACP,iDAAiD;QACjD,iEAAiE;QACjE,mEAAmE;QACnE,6DAA6D;IACjE,WAAW,EAAE,2BAA2B;CAC3C,CAAC"}
@@ -0,0 +1,150 @@
1
+ /**
2
+ * logs_receive MCP tool implementation.
3
+ *
4
+ * Stores logs with session metadata for later retrieval.
5
+ * @module mcp/tools/logs-receive
6
+ */
7
+ import * as z from "zod/v3";
8
+ import type { LogStorage } from "../../server/log-storage.js";
9
+ /**
10
+ * Input schema for the logs_receive tool.
11
+ */
12
+ export declare const logsReceiveInputSchema: z.ZodObject<{
13
+ /** Unique identifier for this logging session. Links related logs together. */
14
+ sessionId: z.ZodString;
15
+ /** Array of log entries to store. At least one entry required. */
16
+ logs: z.ZodArray<z.ZodObject<{
17
+ /** When the log was created. Format: ISO 8601 (e.g., "2025-01-08T12:00:00Z"). */
18
+ time: z.ZodString;
19
+ /** Severity level (e.g., "INFO", "DEBUG", "WARN", "ERROR"). */
20
+ level: z.ZodString;
21
+ /** The log message text. */
22
+ message: z.ZodString;
23
+ /** Additional structured data to attach to the log entry. */
24
+ data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
25
+ }, "strip", z.ZodTypeAny, {
26
+ level: string;
27
+ message: string;
28
+ time: string;
29
+ data?: Record<string, unknown> | undefined;
30
+ }, {
31
+ level: string;
32
+ message: string;
33
+ time: string;
34
+ data?: Record<string, unknown> | undefined;
35
+ }>, "many">;
36
+ /** Project identifier for filtering. Derived from sessionId prefix if not provided. */
37
+ projectMarker: z.ZodOptional<z.ZodString>;
38
+ /** Git worktree path for project identification. */
39
+ worktreePath: z.ZodOptional<z.ZodString>;
40
+ /** URL of the page that generated these logs. */
41
+ pageUrl: z.ZodOptional<z.ZodString>;
42
+ }, "strip", z.ZodTypeAny, {
43
+ sessionId: string;
44
+ logs: {
45
+ level: string;
46
+ message: string;
47
+ time: string;
48
+ data?: Record<string, unknown> | undefined;
49
+ }[];
50
+ projectMarker?: string | undefined;
51
+ worktreePath?: string | undefined;
52
+ pageUrl?: string | undefined;
53
+ }, {
54
+ sessionId: string;
55
+ logs: {
56
+ level: string;
57
+ message: string;
58
+ time: string;
59
+ data?: Record<string, unknown> | undefined;
60
+ }[];
61
+ projectMarker?: string | undefined;
62
+ worktreePath?: string | undefined;
63
+ pageUrl?: string | undefined;
64
+ }>;
65
+ /**
66
+ * Input type for the logs_receive handler.
67
+ */
68
+ export type LogsReceiveInput = z.infer<typeof logsReceiveInputSchema>;
69
+ /**
70
+ * Output type for the logs_receive handler.
71
+ */
72
+ export interface LogsReceiveOutput {
73
+ /** Whether the operation succeeded */
74
+ success: boolean;
75
+ /** Number of logs stored */
76
+ count: number;
77
+ /** The session ID used */
78
+ sessionId: string;
79
+ }
80
+ /**
81
+ * Handler for the logs_receive tool.
82
+ *
83
+ * Stores logs with session metadata. The project marker is derived from
84
+ * the session ID prefix if not explicitly provided.
85
+ * @param storage - The log storage instance
86
+ * @param input - Input parameters
87
+ * @returns Success status, count, and session ID
88
+ */
89
+ export declare function logsReceiveHandler(storage: LogStorage, input: LogsReceiveInput): Promise<LogsReceiveOutput>;
90
+ /**
91
+ * Tool definition for MCP registration.
92
+ */
93
+ export declare const logsReceiveTool: {
94
+ name: string;
95
+ description: string;
96
+ inputSchema: z.ZodObject<{
97
+ /** Unique identifier for this logging session. Links related logs together. */
98
+ sessionId: z.ZodString;
99
+ /** Array of log entries to store. At least one entry required. */
100
+ logs: z.ZodArray<z.ZodObject<{
101
+ /** When the log was created. Format: ISO 8601 (e.g., "2025-01-08T12:00:00Z"). */
102
+ time: z.ZodString;
103
+ /** Severity level (e.g., "INFO", "DEBUG", "WARN", "ERROR"). */
104
+ level: z.ZodString;
105
+ /** The log message text. */
106
+ message: z.ZodString;
107
+ /** Additional structured data to attach to the log entry. */
108
+ data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
109
+ }, "strip", z.ZodTypeAny, {
110
+ level: string;
111
+ message: string;
112
+ time: string;
113
+ data?: Record<string, unknown> | undefined;
114
+ }, {
115
+ level: string;
116
+ message: string;
117
+ time: string;
118
+ data?: Record<string, unknown> | undefined;
119
+ }>, "many">;
120
+ /** Project identifier for filtering. Derived from sessionId prefix if not provided. */
121
+ projectMarker: z.ZodOptional<z.ZodString>;
122
+ /** Git worktree path for project identification. */
123
+ worktreePath: z.ZodOptional<z.ZodString>;
124
+ /** URL of the page that generated these logs. */
125
+ pageUrl: z.ZodOptional<z.ZodString>;
126
+ }, "strip", z.ZodTypeAny, {
127
+ sessionId: string;
128
+ logs: {
129
+ level: string;
130
+ message: string;
131
+ time: string;
132
+ data?: Record<string, unknown> | undefined;
133
+ }[];
134
+ projectMarker?: string | undefined;
135
+ worktreePath?: string | undefined;
136
+ pageUrl?: string | undefined;
137
+ }, {
138
+ sessionId: string;
139
+ logs: {
140
+ level: string;
141
+ message: string;
142
+ time: string;
143
+ data?: Record<string, unknown> | undefined;
144
+ }[];
145
+ projectMarker?: string | undefined;
146
+ worktreePath?: string | undefined;
147
+ pageUrl?: string | undefined;
148
+ }>;
149
+ };
150
+ //# sourceMappingURL=logs-receive.d.ts.map