agentlang 0.8.9 → 0.9.0
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/out/extension/main.cjs +250 -250
- package/out/extension/main.cjs.map +2 -2
- package/out/language/generated/ast.js +1 -0
- package/out/language/generated/ast.js.map +1 -1
- package/out/language/main.cjs +502 -502
- package/out/language/main.cjs.map +3 -3
- package/out/runtime/interpreter.js +2 -2
- package/out/runtime/interpreter.js.map +1 -1
- package/out/runtime/modules/core.d.ts.map +1 -1
- package/out/runtime/modules/core.js +3 -2
- package/out/runtime/modules/core.js.map +1 -1
- package/out/utils/runtime.d.ts +1 -0
- package/out/utils/runtime.d.ts.map +1 -1
- package/out/utils/runtime.js +6 -0
- package/out/utils/runtime.js.map +1 -1
- package/package.json +1 -1
- package/src/language/generated/ast.ts +1 -1
- package/src/runtime/interpreter.ts +2 -2
- package/src/runtime/modules/core.ts +3 -2
- package/src/utils/runtime.ts +7 -0
|
@@ -39,6 +39,7 @@ import {
|
|
|
39
39
|
} from '../defs.js';
|
|
40
40
|
import { getMonitor, getMonitorsForEvent, Monitor } from '../monitor.js';
|
|
41
41
|
import { registerResolver, setResolver } from '../resolvers/registry.js';
|
|
42
|
+
import { base64Encode } from '../../utils/runtime.js';
|
|
42
43
|
|
|
43
44
|
const CoreModuleDefinition = `module ${DefaultModuleName}
|
|
44
45
|
|
|
@@ -438,9 +439,9 @@ function getMonitoringEventName(inst: Instance): string {
|
|
|
438
439
|
}
|
|
439
440
|
|
|
440
441
|
async function saveMonitoringData(m: Monitor) {
|
|
441
|
-
const data =
|
|
442
|
+
const data = base64Encode(JSON.stringify(m.asObject()));
|
|
442
443
|
const inst = m.getEventInstance();
|
|
443
|
-
const eventInstance = inst ?
|
|
444
|
+
const eventInstance = inst ? base64Encode(JSON.stringify(inst.asSerializableObject())) : '';
|
|
444
445
|
const user = m.getUser() || 'admin';
|
|
445
446
|
const latency = m.getTotalLatencyMs();
|
|
446
447
|
const monitorId = m.getId();
|
package/src/utils/runtime.ts
CHANGED
|
@@ -22,6 +22,13 @@ export function isExecGraphEnabled(): boolean {
|
|
|
22
22
|
return true;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
+
export function base64Encode(str: string): string {
|
|
26
|
+
if (isNodeEnv) {
|
|
27
|
+
return Buffer.from(str, 'utf-8').toString('base64');
|
|
28
|
+
}
|
|
29
|
+
return btoa(String.fromCharCode(...new TextEncoder().encode(str)));
|
|
30
|
+
}
|
|
31
|
+
|
|
25
32
|
// Browser-compatible path utilities
|
|
26
33
|
export const browserPath = {
|
|
27
34
|
extname: (path: string): string => {
|