@lunora/agent 1.0.0-alpha.1 → 1.0.0-alpha.3
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/README.md +2 -0
- package/dist/channels.d.mts +17 -5
- package/dist/channels.d.ts +17 -5
- package/dist/component.d.mts +14 -0
- package/dist/component.d.ts +14 -0
- package/dist/inbound.d.mts +7 -2
- package/dist/inbound.d.ts +7 -2
- package/dist/index.d.mts +136 -28
- package/dist/index.d.ts +136 -28
- package/dist/naming.d.mts +17 -4
- package/dist/naming.d.ts +17 -4
- package/dist/packem_shared/{types.d-BWG0uUtX.d.mts → types.d-BhJFTvz_.d.mts} +123 -24
- package/dist/packem_shared/{types.d-BWG0uUtX.d.ts → types.d-BhJFTvz_.d.ts} +123 -24
- package/dist/sandbox.d.mts +19 -4
- package/dist/sandbox.d.ts +19 -4
- package/dist/telemetry/index.d.mts +28 -5
- package/dist/telemetry/index.d.ts +28 -5
- package/package.json +7 -7
|
@@ -7,6 +7,7 @@ import { Telemetry } from 'ai';
|
|
|
7
7
|
* to a downstream tracer — only structural metadata (model id, finish reason,
|
|
8
8
|
* token counts, tool name, timing, success/failure) is recorded. This is the
|
|
9
9
|
* privacy-safe default: turn recording on deliberately, per integration.
|
|
10
|
+
* @experimental
|
|
10
11
|
*/
|
|
11
12
|
interface CommonOptions {
|
|
12
13
|
/**
|
|
@@ -20,7 +21,10 @@ interface CommonOptions {
|
|
|
20
21
|
*/
|
|
21
22
|
recordOutputs?: boolean;
|
|
22
23
|
}
|
|
23
|
-
/**
|
|
24
|
+
/**
|
|
25
|
+
* The span handle a {@link BraintrustLike.traced} callback receives.
|
|
26
|
+
* @experimental
|
|
27
|
+
*/
|
|
24
28
|
interface BraintrustSpan {
|
|
25
29
|
/** Attach structured fields to the current span. */
|
|
26
30
|
log: (event: Record<string, unknown>) => void;
|
|
@@ -30,6 +34,7 @@ interface BraintrustSpan {
|
|
|
30
34
|
* `braintrust` is intentionally **not** a dependency — the app passes its own
|
|
31
35
|
* initialized logger, so this package stays dependency-free and works with any
|
|
32
36
|
* compatible Braintrust SDK version.
|
|
37
|
+
* @experimental
|
|
33
38
|
*/
|
|
34
39
|
interface BraintrustLike {
|
|
35
40
|
/** Run `callback` inside a new traced span and return its result. */
|
|
@@ -38,7 +43,10 @@ interface BraintrustLike {
|
|
|
38
43
|
type?: string;
|
|
39
44
|
}) => T;
|
|
40
45
|
}
|
|
41
|
-
/**
|
|
46
|
+
/**
|
|
47
|
+
* Options for {@link braintrustTelemetry}.
|
|
48
|
+
* @experimental
|
|
49
|
+
*/
|
|
42
50
|
interface BraintrustTelemetryOptions extends CommonOptions {
|
|
43
51
|
/** Span-name prefix for the language-model call (e.g. the agent name). */
|
|
44
52
|
functionId?: string;
|
|
@@ -57,6 +65,7 @@ interface BraintrustTelemetryOptions extends CommonOptions {
|
|
|
57
65
|
* only when `recordOutputs` is set. `onError` opens a span and logs the error.
|
|
58
66
|
*
|
|
59
67
|
* The app owns Braintrust initialization; pass the logger in as `logger`.
|
|
68
|
+
* @experimental
|
|
60
69
|
*/
|
|
61
70
|
declare const braintrustTelemetry: (options: BraintrustTelemetryOptions) => Telemetry;
|
|
62
71
|
/**
|
|
@@ -69,17 +78,25 @@ declare const braintrustTelemetry: (options: BraintrustTelemetryOptions) => Tele
|
|
|
69
78
|
* parallel. The wrappers (`executeLanguageModelCall`, `executeTool`) are
|
|
70
79
|
* composed by nesting right-to-left; integrations without a wrapper are skipped,
|
|
71
80
|
* and with none defined the plain `execute` still runs.
|
|
81
|
+
* @experimental
|
|
72
82
|
*/
|
|
73
83
|
declare const combineTelemetry: (...integrations: Telemetry[]) => Telemetry;
|
|
74
|
-
/**
|
|
84
|
+
/**
|
|
85
|
+
* Severity level passed to a {@link ConsoleLogger}.
|
|
86
|
+
* @experimental
|
|
87
|
+
*/
|
|
75
88
|
type ConsoleLogLevel = "error" | "info" | "warn";
|
|
76
89
|
/**
|
|
77
90
|
* Structured log sink. Receives a level, a static human message, and a bag of
|
|
78
91
|
* structured fields (never interpolated into the message, so log processors can
|
|
79
92
|
* index them). The default sink writes to `globalThis.console`.
|
|
93
|
+
* @experimental
|
|
80
94
|
*/
|
|
81
95
|
type ConsoleLogger = (level: ConsoleLogLevel, message: string, fields: Record<string, unknown>) => void;
|
|
82
|
-
/**
|
|
96
|
+
/**
|
|
97
|
+
* Options for {@link consoleTelemetry}.
|
|
98
|
+
* @experimental
|
|
99
|
+
*/
|
|
83
100
|
interface ConsoleTelemetryOptions extends CommonOptions {
|
|
84
101
|
/**
|
|
85
102
|
* Identifier prefixed into every log message (e.g. the agent name). Helps
|
|
@@ -102,6 +119,7 @@ interface ConsoleTelemetryOptions extends CommonOptions {
|
|
|
102
119
|
* arguments, and `recordOutputs` to log generated text / tool results.
|
|
103
120
|
*
|
|
104
121
|
* Every callback is defensive (event fields may be absent) and synchronous.
|
|
122
|
+
* @experimental
|
|
105
123
|
*/
|
|
106
124
|
declare const consoleTelemetry: (options?: ConsoleTelemetryOptions) => Telemetry;
|
|
107
125
|
/**
|
|
@@ -110,6 +128,7 @@ declare const consoleTelemetry: (options?: ConsoleTelemetryOptions) => Telemetry
|
|
|
110
128
|
* intentionally **not** a dependency — the app passes its own already-initialized
|
|
111
129
|
* Sentry namespace, so this package stays dependency-free and works with any
|
|
112
130
|
* compatible Sentry SDK version.
|
|
131
|
+
* @experimental
|
|
113
132
|
*/
|
|
114
133
|
interface SentryLike {
|
|
115
134
|
/** Capture a thrown value / exception. */
|
|
@@ -125,7 +144,10 @@ interface SentryLike {
|
|
|
125
144
|
} | string) => void;
|
|
126
145
|
}) => T) => T;
|
|
127
146
|
}
|
|
128
|
-
/**
|
|
147
|
+
/**
|
|
148
|
+
* Options for {@link sentryTelemetry}.
|
|
149
|
+
* @experimental
|
|
150
|
+
*/
|
|
129
151
|
interface SentryTelemetryOptions extends CommonOptions {
|
|
130
152
|
/** Span-name prefix for the language-model call (e.g. the agent name). */
|
|
131
153
|
functionId?: string;
|
|
@@ -145,6 +167,7 @@ interface SentryTelemetryOptions extends CommonOptions {
|
|
|
145
167
|
* set, in which case prompts / tool arguments are attached too.
|
|
146
168
|
*
|
|
147
169
|
* The app owns Sentry initialization; pass the namespace in as `Sentry`.
|
|
170
|
+
* @experimental
|
|
148
171
|
*/
|
|
149
172
|
declare const sentryTelemetry: (options: SentryTelemetryOptions) => Telemetry;
|
|
150
173
|
export { type BraintrustLike, type BraintrustSpan, type BraintrustTelemetryOptions, type CommonOptions, type ConsoleLogLevel, type ConsoleLogger, type ConsoleTelemetryOptions, type SentryLike, type SentryTelemetryOptions, braintrustTelemetry, combineTelemetry, consoleTelemetry, sentryTelemetry };
|
|
@@ -7,6 +7,7 @@ import { Telemetry } from 'ai';
|
|
|
7
7
|
* to a downstream tracer — only structural metadata (model id, finish reason,
|
|
8
8
|
* token counts, tool name, timing, success/failure) is recorded. This is the
|
|
9
9
|
* privacy-safe default: turn recording on deliberately, per integration.
|
|
10
|
+
* @experimental
|
|
10
11
|
*/
|
|
11
12
|
interface CommonOptions {
|
|
12
13
|
/**
|
|
@@ -20,7 +21,10 @@ interface CommonOptions {
|
|
|
20
21
|
*/
|
|
21
22
|
recordOutputs?: boolean;
|
|
22
23
|
}
|
|
23
|
-
/**
|
|
24
|
+
/**
|
|
25
|
+
* The span handle a {@link BraintrustLike.traced} callback receives.
|
|
26
|
+
* @experimental
|
|
27
|
+
*/
|
|
24
28
|
interface BraintrustSpan {
|
|
25
29
|
/** Attach structured fields to the current span. */
|
|
26
30
|
log: (event: Record<string, unknown>) => void;
|
|
@@ -30,6 +34,7 @@ interface BraintrustSpan {
|
|
|
30
34
|
* `braintrust` is intentionally **not** a dependency — the app passes its own
|
|
31
35
|
* initialized logger, so this package stays dependency-free and works with any
|
|
32
36
|
* compatible Braintrust SDK version.
|
|
37
|
+
* @experimental
|
|
33
38
|
*/
|
|
34
39
|
interface BraintrustLike {
|
|
35
40
|
/** Run `callback` inside a new traced span and return its result. */
|
|
@@ -38,7 +43,10 @@ interface BraintrustLike {
|
|
|
38
43
|
type?: string;
|
|
39
44
|
}) => T;
|
|
40
45
|
}
|
|
41
|
-
/**
|
|
46
|
+
/**
|
|
47
|
+
* Options for {@link braintrustTelemetry}.
|
|
48
|
+
* @experimental
|
|
49
|
+
*/
|
|
42
50
|
interface BraintrustTelemetryOptions extends CommonOptions {
|
|
43
51
|
/** Span-name prefix for the language-model call (e.g. the agent name). */
|
|
44
52
|
functionId?: string;
|
|
@@ -57,6 +65,7 @@ interface BraintrustTelemetryOptions extends CommonOptions {
|
|
|
57
65
|
* only when `recordOutputs` is set. `onError` opens a span and logs the error.
|
|
58
66
|
*
|
|
59
67
|
* The app owns Braintrust initialization; pass the logger in as `logger`.
|
|
68
|
+
* @experimental
|
|
60
69
|
*/
|
|
61
70
|
declare const braintrustTelemetry: (options: BraintrustTelemetryOptions) => Telemetry;
|
|
62
71
|
/**
|
|
@@ -69,17 +78,25 @@ declare const braintrustTelemetry: (options: BraintrustTelemetryOptions) => Tele
|
|
|
69
78
|
* parallel. The wrappers (`executeLanguageModelCall`, `executeTool`) are
|
|
70
79
|
* composed by nesting right-to-left; integrations without a wrapper are skipped,
|
|
71
80
|
* and with none defined the plain `execute` still runs.
|
|
81
|
+
* @experimental
|
|
72
82
|
*/
|
|
73
83
|
declare const combineTelemetry: (...integrations: Telemetry[]) => Telemetry;
|
|
74
|
-
/**
|
|
84
|
+
/**
|
|
85
|
+
* Severity level passed to a {@link ConsoleLogger}.
|
|
86
|
+
* @experimental
|
|
87
|
+
*/
|
|
75
88
|
type ConsoleLogLevel = "error" | "info" | "warn";
|
|
76
89
|
/**
|
|
77
90
|
* Structured log sink. Receives a level, a static human message, and a bag of
|
|
78
91
|
* structured fields (never interpolated into the message, so log processors can
|
|
79
92
|
* index them). The default sink writes to `globalThis.console`.
|
|
93
|
+
* @experimental
|
|
80
94
|
*/
|
|
81
95
|
type ConsoleLogger = (level: ConsoleLogLevel, message: string, fields: Record<string, unknown>) => void;
|
|
82
|
-
/**
|
|
96
|
+
/**
|
|
97
|
+
* Options for {@link consoleTelemetry}.
|
|
98
|
+
* @experimental
|
|
99
|
+
*/
|
|
83
100
|
interface ConsoleTelemetryOptions extends CommonOptions {
|
|
84
101
|
/**
|
|
85
102
|
* Identifier prefixed into every log message (e.g. the agent name). Helps
|
|
@@ -102,6 +119,7 @@ interface ConsoleTelemetryOptions extends CommonOptions {
|
|
|
102
119
|
* arguments, and `recordOutputs` to log generated text / tool results.
|
|
103
120
|
*
|
|
104
121
|
* Every callback is defensive (event fields may be absent) and synchronous.
|
|
122
|
+
* @experimental
|
|
105
123
|
*/
|
|
106
124
|
declare const consoleTelemetry: (options?: ConsoleTelemetryOptions) => Telemetry;
|
|
107
125
|
/**
|
|
@@ -110,6 +128,7 @@ declare const consoleTelemetry: (options?: ConsoleTelemetryOptions) => Telemetry
|
|
|
110
128
|
* intentionally **not** a dependency — the app passes its own already-initialized
|
|
111
129
|
* Sentry namespace, so this package stays dependency-free and works with any
|
|
112
130
|
* compatible Sentry SDK version.
|
|
131
|
+
* @experimental
|
|
113
132
|
*/
|
|
114
133
|
interface SentryLike {
|
|
115
134
|
/** Capture a thrown value / exception. */
|
|
@@ -125,7 +144,10 @@ interface SentryLike {
|
|
|
125
144
|
} | string) => void;
|
|
126
145
|
}) => T) => T;
|
|
127
146
|
}
|
|
128
|
-
/**
|
|
147
|
+
/**
|
|
148
|
+
* Options for {@link sentryTelemetry}.
|
|
149
|
+
* @experimental
|
|
150
|
+
*/
|
|
129
151
|
interface SentryTelemetryOptions extends CommonOptions {
|
|
130
152
|
/** Span-name prefix for the language-model call (e.g. the agent name). */
|
|
131
153
|
functionId?: string;
|
|
@@ -145,6 +167,7 @@ interface SentryTelemetryOptions extends CommonOptions {
|
|
|
145
167
|
* set, in which case prompts / tool arguments are attached too.
|
|
146
168
|
*
|
|
147
169
|
* The app owns Sentry initialization; pass the namespace in as `Sentry`.
|
|
170
|
+
* @experimental
|
|
148
171
|
*/
|
|
149
172
|
declare const sentryTelemetry: (options: SentryTelemetryOptions) => Telemetry;
|
|
150
173
|
export { type BraintrustLike, type BraintrustSpan, type BraintrustTelemetryOptions, type CommonOptions, type ConsoleLogLevel, type ConsoleLogger, type ConsoleTelemetryOptions, type SentryLike, type SentryTelemetryOptions, braintrustTelemetry, combineTelemetry, consoleTelemetry, sentryTelemetry };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lunora/agent",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.3",
|
|
4
4
|
"description": "Durable AI agents for Lunora: defineAgent compiles a replay-safe tool-loop onto Cloudflare Workflows, with DO SQLite threads and live message subscriptions",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"agent",
|
|
@@ -76,12 +76,12 @@
|
|
|
76
76
|
"access": "public"
|
|
77
77
|
},
|
|
78
78
|
"dependencies": {
|
|
79
|
-
"@lunora/ai": "1.0.0-alpha.
|
|
80
|
-
"@lunora/errors": "1.0.0-alpha.
|
|
81
|
-
"@lunora/mail": "1.0.0-alpha.
|
|
82
|
-
"@lunora/server": "1.0.0-alpha.
|
|
83
|
-
"@lunora/values": "1.0.0-alpha.
|
|
84
|
-
"@lunora/workflow": "1.0.0-alpha.
|
|
79
|
+
"@lunora/ai": "1.0.0-alpha.15",
|
|
80
|
+
"@lunora/errors": "1.0.0-alpha.5",
|
|
81
|
+
"@lunora/mail": "1.0.0-alpha.15",
|
|
82
|
+
"@lunora/server": "1.0.0-alpha.26",
|
|
83
|
+
"@lunora/values": "1.0.0-alpha.8",
|
|
84
|
+
"@lunora/workflow": "1.0.0-alpha.10",
|
|
85
85
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
86
86
|
"ai": "7.0.16"
|
|
87
87
|
},
|