@mastra/loggers 0.1.0-alpha.33 → 0.1.0-alpha.35
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/CHANGELOG.md +16 -0
- package/dist/_tsup-dts-rollup.d.ts +48 -0
- package/dist/file/index.d.ts +1 -19
- package/dist/file/index.js +2 -0
- package/dist/upstash/index.d.ts +1 -31
- package/dist/upstash/index.js +9 -0
- package/package.json +5 -7
- package/src/file/index.ts +1 -1
- package/src/upstash/index.ts +1 -1
- package/tsconfig.json +1 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @mastra/loggers
|
|
2
2
|
|
|
3
|
+
## 0.1.0-alpha.35
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [a9345f9]
|
|
8
|
+
- @mastra/core@0.2.0-alpha.102
|
|
9
|
+
|
|
10
|
+
## 0.1.0-alpha.34
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- 4f1d1a1: Enforce types ann cleanup package.json
|
|
15
|
+
- Updated dependencies [66a03ec]
|
|
16
|
+
- Updated dependencies [4f1d1a1]
|
|
17
|
+
- @mastra/core@0.2.0-alpha.101
|
|
18
|
+
|
|
3
19
|
## 0.1.0-alpha.33
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { BaseLogMessage } from '@mastra/core/logger';
|
|
2
|
+
import { LoggerTransport } from '@mastra/core/logger';
|
|
3
|
+
import { WriteStream } from 'fs';
|
|
4
|
+
|
|
5
|
+
export declare class FileTransport extends LoggerTransport {
|
|
6
|
+
path: string;
|
|
7
|
+
fileStream: WriteStream;
|
|
8
|
+
constructor({ path }: {
|
|
9
|
+
path: string;
|
|
10
|
+
});
|
|
11
|
+
_transform(chunk: any, _encoding: string, callback: (error: Error | null, chunk: any) => void): void;
|
|
12
|
+
_flush(callback: Function): void;
|
|
13
|
+
_destroy(error: Error, callback: Function): void;
|
|
14
|
+
getLogs(): Promise<BaseLogMessage[]>;
|
|
15
|
+
getLogsByRunId({ runId }: {
|
|
16
|
+
runId: string;
|
|
17
|
+
}): Promise<BaseLogMessage[]>;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export declare class UpstashTransport extends LoggerTransport {
|
|
21
|
+
upstashUrl: string;
|
|
22
|
+
upstashToken: string;
|
|
23
|
+
listName: string;
|
|
24
|
+
maxListLength: number;
|
|
25
|
+
batchSize: number;
|
|
26
|
+
flushInterval: number;
|
|
27
|
+
logBuffer: any[];
|
|
28
|
+
lastFlush: number;
|
|
29
|
+
flushIntervalId: NodeJS.Timeout;
|
|
30
|
+
constructor(opts: {
|
|
31
|
+
listName?: string;
|
|
32
|
+
maxListLength?: number;
|
|
33
|
+
batchSize?: number;
|
|
34
|
+
upstashUrl: string;
|
|
35
|
+
flushInterval?: number;
|
|
36
|
+
upstashToken: string;
|
|
37
|
+
});
|
|
38
|
+
private executeUpstashCommand;
|
|
39
|
+
_flush(): Promise<void>;
|
|
40
|
+
_transform(chunk: string, _enc: string, cb: Function): void;
|
|
41
|
+
_destroy(err: Error, cb: Function): void;
|
|
42
|
+
getLogs(): Promise<BaseLogMessage[]>;
|
|
43
|
+
getLogsByRunId({ runId }: {
|
|
44
|
+
runId: string;
|
|
45
|
+
}): Promise<BaseLogMessage[]>;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export { }
|
package/dist/file/index.d.ts
CHANGED
|
@@ -1,19 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { WriteStream } from 'fs';
|
|
3
|
-
|
|
4
|
-
declare class FileTransport extends LoggerTransport {
|
|
5
|
-
path: string;
|
|
6
|
-
fileStream: WriteStream;
|
|
7
|
-
constructor({ path }: {
|
|
8
|
-
path: string;
|
|
9
|
-
});
|
|
10
|
-
_transform(chunk: any, _encoding: string, callback: (error: Error | null, chunk: any) => void): void;
|
|
11
|
-
_flush(callback: Function): void;
|
|
12
|
-
_destroy(error: Error, callback: Function): void;
|
|
13
|
-
getLogs(): Promise<BaseLogMessage[]>;
|
|
14
|
-
getLogsByRunId({ runId }: {
|
|
15
|
-
runId: string;
|
|
16
|
-
}): Promise<BaseLogMessage[]>;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export { FileTransport };
|
|
1
|
+
export { FileTransport } from '../_tsup-dts-rollup.js';
|
package/dist/file/index.js
CHANGED
package/dist/upstash/index.d.ts
CHANGED
|
@@ -1,31 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
declare class UpstashTransport extends LoggerTransport {
|
|
4
|
-
upstashUrl: string;
|
|
5
|
-
upstashToken: string;
|
|
6
|
-
listName: string;
|
|
7
|
-
maxListLength: number;
|
|
8
|
-
batchSize: number;
|
|
9
|
-
flushInterval: number;
|
|
10
|
-
logBuffer: any[];
|
|
11
|
-
lastFlush: number;
|
|
12
|
-
flushIntervalId: NodeJS.Timeout;
|
|
13
|
-
constructor(opts: {
|
|
14
|
-
listName?: string;
|
|
15
|
-
maxListLength?: number;
|
|
16
|
-
batchSize?: number;
|
|
17
|
-
upstashUrl: string;
|
|
18
|
-
flushInterval?: number;
|
|
19
|
-
upstashToken: string;
|
|
20
|
-
});
|
|
21
|
-
private executeUpstashCommand;
|
|
22
|
-
_flush(): Promise<void>;
|
|
23
|
-
_transform(chunk: string, _enc: string, cb: Function): void;
|
|
24
|
-
_destroy(err: Error, cb: Function): void;
|
|
25
|
-
getLogs(): Promise<BaseLogMessage[]>;
|
|
26
|
-
getLogsByRunId({ runId }: {
|
|
27
|
-
runId: string;
|
|
28
|
-
}): Promise<BaseLogMessage[]>;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export { UpstashTransport };
|
|
1
|
+
export { UpstashTransport } from '../_tsup-dts-rollup.js';
|
package/dist/upstash/index.js
CHANGED
|
@@ -2,6 +2,15 @@ import { LoggerTransport } from '@mastra/core/logger';
|
|
|
2
2
|
|
|
3
3
|
// src/upstash/index.ts
|
|
4
4
|
var UpstashTransport = class extends LoggerTransport {
|
|
5
|
+
upstashUrl;
|
|
6
|
+
upstashToken;
|
|
7
|
+
listName;
|
|
8
|
+
maxListLength;
|
|
9
|
+
batchSize;
|
|
10
|
+
flushInterval;
|
|
11
|
+
logBuffer;
|
|
12
|
+
lastFlush;
|
|
13
|
+
flushIntervalId;
|
|
5
14
|
constructor(opts) {
|
|
6
15
|
super({ objectMode: true });
|
|
7
16
|
if (!opts.upstashUrl || !opts.upstashToken) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/loggers",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.35",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -30,18 +30,16 @@
|
|
|
30
30
|
"author": "",
|
|
31
31
|
"license": "ISC",
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@mastra/core": "^0.2.0-alpha.
|
|
33
|
+
"@mastra/core": "^0.2.0-alpha.102"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@
|
|
37
|
-
"@
|
|
38
|
-
"@tsconfig/recommended": "^1.0.7",
|
|
39
|
-
"@types/node": "^22.9.0",
|
|
36
|
+
"@microsoft/api-extractor": "^7.49.2",
|
|
37
|
+
"@types/node": "^22.13.1",
|
|
40
38
|
"tsup": "^8.0.1",
|
|
41
39
|
"vitest": "^3.0.4"
|
|
42
40
|
},
|
|
43
41
|
"scripts": {
|
|
44
|
-
"build": "tsup src/file/index.ts src/upstash/index.ts --format esm --dts --clean --treeshake",
|
|
42
|
+
"build": "tsup src/file/index.ts src/upstash/index.ts --format esm --experimental-dts --clean --treeshake",
|
|
45
43
|
"build:watch": "pnpm build --watch",
|
|
46
44
|
"test": "vitest run"
|
|
47
45
|
}
|
package/src/file/index.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LoggerTransport, BaseLogMessage } from '@mastra/core/logger';
|
|
1
|
+
import { LoggerTransport, type BaseLogMessage } from '@mastra/core/logger';
|
|
2
2
|
import { createWriteStream, existsSync, readFileSync, WriteStream } from 'fs';
|
|
3
3
|
|
|
4
4
|
export class FileTransport extends LoggerTransport {
|
package/src/upstash/index.ts
CHANGED
package/tsconfig.json
CHANGED
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"extends": "../../tsconfig.json",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"moduleResolution": "bundler",
|
|
5
|
-
"outDir": "./dist",
|
|
6
|
-
"rootDir": "./src"
|
|
7
|
-
},
|
|
2
|
+
"extends": "../../tsconfig.node.json",
|
|
8
3
|
"include": ["src/**/*"],
|
|
9
4
|
"exclude": ["node_modules", "**/*.test.ts"]
|
|
10
5
|
}
|