@zenera/neo 1.3.33 → 1.3.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/dist/tools/identity.d.ts +6 -0
- package/dist/tools/identity.js +15 -7
- package/package.json +2 -2
package/dist/tools/identity.d.ts
CHANGED
|
@@ -15,6 +15,10 @@ export interface RunIdentity {
|
|
|
15
15
|
name?: string;
|
|
16
16
|
/** the user's role in this project, in the host's own words */
|
|
17
17
|
role?: string;
|
|
18
|
+
/** IANA time zone the user is in, e.g. `Europe/Berlin` */
|
|
19
|
+
timeZone?: string;
|
|
20
|
+
/** https URL of the user's avatar */
|
|
21
|
+
picture?: string;
|
|
18
22
|
source: IdentitySource;
|
|
19
23
|
}
|
|
20
24
|
/** The variables the identity is exported as, inside the sandbox. */
|
|
@@ -23,6 +27,8 @@ export declare const IDENTITY_ENV: {
|
|
|
23
27
|
readonly email: "ZEN_USER_EMAIL";
|
|
24
28
|
readonly name: "ZEN_USER_NAME";
|
|
25
29
|
readonly role: "ZEN_USER_ROLE";
|
|
30
|
+
readonly timeZone: "ZEN_USER_TIME_ZONE";
|
|
31
|
+
readonly picture: "ZEN_USER_PICTURE";
|
|
26
32
|
readonly source: "ZEN_USER_SOURCE";
|
|
27
33
|
};
|
|
28
34
|
/** Every name under it is the host's to set; a project may not. */
|
package/dist/tools/identity.js
CHANGED
|
@@ -20,8 +20,12 @@ export const IDENTITY_ENV = {
|
|
|
20
20
|
email: 'ZEN_USER_EMAIL',
|
|
21
21
|
name: 'ZEN_USER_NAME',
|
|
22
22
|
role: 'ZEN_USER_ROLE',
|
|
23
|
+
timeZone: 'ZEN_USER_TIME_ZONE',
|
|
24
|
+
picture: 'ZEN_USER_PICTURE',
|
|
23
25
|
source: 'ZEN_USER_SOURCE',
|
|
24
26
|
};
|
|
27
|
+
/** The optional fields, in the order they are exported. */
|
|
28
|
+
const IDENTITY_FIELDS = ['email', 'name', 'role', 'timeZone', 'picture'];
|
|
25
29
|
/** Every name under it is the host's to set; a project may not. */
|
|
26
30
|
export const IDENTITY_ENV_PREFIX = 'ZEN_USER_';
|
|
27
31
|
export function isIdentityEnv(name) {
|
|
@@ -50,7 +54,7 @@ export function identityEnv(identity) {
|
|
|
50
54
|
[IDENTITY_ENV.id]: identity.id,
|
|
51
55
|
[IDENTITY_ENV.source]: identity.source,
|
|
52
56
|
};
|
|
53
|
-
for (const key of
|
|
57
|
+
for (const key of IDENTITY_FIELDS) {
|
|
54
58
|
const value = identity[key];
|
|
55
59
|
if (value) {
|
|
56
60
|
env[IDENTITY_ENV[key]] = value;
|
|
@@ -75,6 +79,8 @@ export function identityFromEnv(env) {
|
|
|
75
79
|
email: pick(IDENTITY_ENV.email),
|
|
76
80
|
name: pick(IDENTITY_ENV.name),
|
|
77
81
|
role: pick(IDENTITY_ENV.role),
|
|
82
|
+
timeZone: pick(IDENTITY_ENV.timeZone),
|
|
83
|
+
picture: pick(IDENTITY_ENV.picture),
|
|
78
84
|
source: 'local',
|
|
79
85
|
});
|
|
80
86
|
}
|
|
@@ -91,12 +97,14 @@ export function identityTools(identity) {
|
|
|
91
97
|
const currentUser = tool({
|
|
92
98
|
name: 'current_user',
|
|
93
99
|
group: IDENTITY_GROUP,
|
|
94
|
-
description: 'Returns the signed-in user this run is acting for: id, and email, name
|
|
95
|
-
'
|
|
96
|
-
'
|
|
97
|
-
'
|
|
98
|
-
`
|
|
99
|
-
`
|
|
100
|
+
description: 'Returns the signed-in user this run is acting for: id, and email, name, role, ' +
|
|
101
|
+
'timeZone (IANA, e.g. "Europe/Berlin") and picture (avatar URL) when known. Use it ' +
|
|
102
|
+
'when an answer depends on who is asking - how to address them, their local time - ' +
|
|
103
|
+
'instead of asking them or guessing. `source: "host"` means the application ' +
|
|
104
|
+
'authenticated them; `"local"` means it was only stated on this machine. Code you ' +
|
|
105
|
+
`run in the sandbox sees the same as $${IDENTITY_ENV.id}, $${IDENTITY_ENV.email}, ` +
|
|
106
|
+
`$${IDENTITY_ENV.name}, $${IDENTITY_ENV.role}, $${IDENTITY_ENV.timeZone} and ` +
|
|
107
|
+
`$${IDENTITY_ENV.picture}, or through the \`zenera\` library: ` +
|
|
100
108
|
'`import zenera; zenera.identity()` in Python, `require("zenera").identity()` in Node.',
|
|
101
109
|
parameters: { type: 'object', properties: {}, additionalProperties: false },
|
|
102
110
|
execute: () => identity
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zenera/neo",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.35",
|
|
4
4
|
"description": "A multi-agent runtime for Node.js: agents, models, tools, skills, memory and an append-only trajectory.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"agents",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"prepack": "tsc -b"
|
|
63
63
|
},
|
|
64
64
|
"dependencies": {
|
|
65
|
-
"@zenera/sandbox": "^1.3.
|
|
65
|
+
"@zenera/sandbox": "^1.3.35",
|
|
66
66
|
"graphology": "^0.26.0",
|
|
67
67
|
"yaml": "^2.9.1",
|
|
68
68
|
"zod": "^4.6.7"
|