@adminforth/agent 1.6.0 → 1.7.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/agent/systemPrompt.ts +4 -1
- package/build.log +2 -2
- package/custom/skills/fetch_data/SKILL.md +1 -1
- package/custom/skills/mutate_data/SKILL.md +5 -5
- package/dist/agent/systemPrompt.js +4 -1
- package/dist/custom/skills/fetch_data/SKILL.md +1 -1
- package/dist/custom/skills/mutate_data/SKILL.md +5 -5
- package/package.json +1 -1
package/agent/systemPrompt.ts
CHANGED
|
@@ -57,9 +57,10 @@ export async function buildAgentSystemPrompt(adminforth: IAdminForth) {
|
|
|
57
57
|
listBundledSkillManifests(),
|
|
58
58
|
]);
|
|
59
59
|
const alwaysAvailableTools = ALWAYS_AVAILABLE_API_TOOL_NAMES.join(", ");
|
|
60
|
+
const adminBasePath = adminforth.config.baseUrlSlashed;
|
|
60
61
|
const sections = [
|
|
61
62
|
DEFAULT_AGENT_SYSTEM_PROMPT,
|
|
62
|
-
`
|
|
63
|
+
`ADMIN_BASE_PATH: ${adminBasePath}`,
|
|
63
64
|
`List of resources:\n${formatResources(adminforth.config.resources)}`,
|
|
64
65
|
`You have always-available base tools: ${alwaysAvailableTools}.`,
|
|
65
66
|
primarySkills.length > 0
|
|
@@ -76,6 +77,8 @@ export async function buildAgentSystemPrompt(adminforth: IAdminForth) {
|
|
|
76
77
|
"If a fetched skill lists a non-base tool you need, call fetch_tool_schema for it immediately instead of telling the user the tool is unavailable.",
|
|
77
78
|
"For example: for record creation load mutate_data, read its tool list, call fetch_tool_schema for create_record, and then use create_record after confirmation.",
|
|
78
79
|
"When fetch_tool_schema succeeds, that tool becomes available on the next step.",
|
|
80
|
+
"All admin links must be relative paths and must start with ADMIN_BASE_PATH.",
|
|
81
|
+
"Build record links as ADMIN_BASE_PATH + resource/{resourceId}/show/{primary key}. Do not prepend any extra slash before resource.",
|
|
79
82
|
"Try to call as many tools as possible in parallel in one step.",
|
|
80
83
|
];
|
|
81
84
|
|
package/build.log
CHANGED
|
@@ -29,5 +29,5 @@ custom/skills/fetch_data/SKILL.md
|
|
|
29
29
|
custom/skills/mutate_data/
|
|
30
30
|
custom/skills/mutate_data/SKILL.md
|
|
31
31
|
|
|
32
|
-
sent 170,
|
|
33
|
-
total size is 168,
|
|
32
|
+
sent 170,560 bytes received 413 bytes 341,946.00 bytes/sec
|
|
33
|
+
total size is 168,886 speedup is 0.99
|
|
@@ -12,4 +12,4 @@ To find specific data record you should use filters. ILIKE filters are preferred
|
|
|
12
12
|
|
|
13
13
|
For long texts show only several first words and add "..." at the end (only if user did not request this field specifically).
|
|
14
14
|
|
|
15
|
-
Also when you communicate with user about record, add related link to this record.
|
|
15
|
+
Also when you communicate with user about record, add related link to this record. Build it as `{ADMIN_BASE_PATH}resource/{resourceId}/show/{primary key}`. Use _label from `get_resource_data` as anchor text for link (use markdown link). Links should always be relative paths and must start with `ADMIN_BASE_PATH`. Do not add an extra slash after `ADMIN_BASE_PATH`.
|
|
@@ -21,7 +21,7 @@ Use `start_custom_action` and `start_custom_bulk_action` for resource actions.
|
|
|
21
21
|
Before performing any state mutation including action calls edit/delete please fetch record which is going to be edited/deleted and show user record in format field → value (show several most important fields which can help user to understand what exactly record he is going to edit or delete).
|
|
22
22
|
|
|
23
23
|
For field values with long texts show only several first words and add "..." at the end.
|
|
24
|
-
Also please add related link to record with will be changed.
|
|
24
|
+
Also please add related link to record with will be changed. Build it as `{ADMIN_BASE_PATH}resource/{resourceId}/show/{primary key}`. Use _label from `get_resource_data` as anchor text for link (use markdown link). Links should always be relative paths and must start with `ADMIN_BASE_PATH`. Do not add an extra slash after `ADMIN_BASE_PATH`.
|
|
25
25
|
|
|
26
26
|
And in the same message ask user for final confirmation.
|
|
27
27
|
|
|
@@ -62,7 +62,7 @@ If you want to block some user you can confirm that this action by saying:
|
|
|
62
62
|
* IP Country: USA
|
|
63
63
|
* Currently blocked: No // show this field only if it exists in user record
|
|
64
64
|
|
|
65
|
-
View [John Doe](
|
|
65
|
+
View [John Doe]({ADMIN_BASE_PATH}resource/users/show/123)
|
|
66
66
|
Are you sure?
|
|
67
67
|
```
|
|
68
68
|
|
|
@@ -85,7 +85,7 @@ I am going to update user:
|
|
|
85
85
|
* IP Country: USA
|
|
86
86
|
I am going to change email from john_doe@example.com to new_email@example.com
|
|
87
87
|
|
|
88
|
-
View [John Doe](
|
|
88
|
+
View [John Doe]({ADMIN_BASE_PATH}resource/users/show/123)
|
|
89
89
|
|
|
90
90
|
Are you sure?
|
|
91
91
|
```
|
|
@@ -105,7 +105,7 @@ If you gonna delete user record, in confirmation please share full user info (no
|
|
|
105
105
|
* Signed up: 2024 Jan 1
|
|
106
106
|
* IP Country: USA
|
|
107
107
|
|
|
108
|
-
View [John Doe](
|
|
108
|
+
View [John Doe]({ADMIN_BASE_PATH}resource/users/show/123)
|
|
109
109
|
|
|
110
110
|
Are you sure?
|
|
111
111
|
```
|
|
@@ -130,7 +130,7 @@ I am going to create user:
|
|
|
130
130
|
* Username: john_doe
|
|
131
131
|
* Email: john_doe@example.com
|
|
132
132
|
|
|
133
|
-
View [John Doe](
|
|
133
|
+
View [John Doe]({ADMIN_BASE_PATH}resource/users/show/421) # 421 is id of new created record
|
|
134
134
|
|
|
135
135
|
Are you sure?
|
|
136
136
|
```
|
|
@@ -52,9 +52,10 @@ export function buildAgentSystemPrompt(adminforth) {
|
|
|
52
52
|
listBundledSkillManifests(),
|
|
53
53
|
]);
|
|
54
54
|
const alwaysAvailableTools = ALWAYS_AVAILABLE_API_TOOL_NAMES.join(", ");
|
|
55
|
+
const adminBasePath = adminforth.config.baseUrlSlashed;
|
|
55
56
|
const sections = [
|
|
56
57
|
DEFAULT_AGENT_SYSTEM_PROMPT,
|
|
57
|
-
`
|
|
58
|
+
`ADMIN_BASE_PATH: ${adminBasePath}`,
|
|
58
59
|
`List of resources:\n${formatResources(adminforth.config.resources)}`,
|
|
59
60
|
`You have always-available base tools: ${alwaysAvailableTools}.`,
|
|
60
61
|
primarySkills.length > 0
|
|
@@ -71,6 +72,8 @@ export function buildAgentSystemPrompt(adminforth) {
|
|
|
71
72
|
"If a fetched skill lists a non-base tool you need, call fetch_tool_schema for it immediately instead of telling the user the tool is unavailable.",
|
|
72
73
|
"For example: for record creation load mutate_data, read its tool list, call fetch_tool_schema for create_record, and then use create_record after confirmation.",
|
|
73
74
|
"When fetch_tool_schema succeeds, that tool becomes available on the next step.",
|
|
75
|
+
"All admin links must be relative paths and must start with ADMIN_BASE_PATH.",
|
|
76
|
+
"Build record links as ADMIN_BASE_PATH + resource/{resourceId}/show/{primary key}. Do not prepend any extra slash before resource.",
|
|
74
77
|
"Try to call as many tools as possible in parallel in one step.",
|
|
75
78
|
];
|
|
76
79
|
return sections.filter(Boolean).join("\n\n");
|
|
@@ -12,4 +12,4 @@ To find specific data record you should use filters. ILIKE filters are preferred
|
|
|
12
12
|
|
|
13
13
|
For long texts show only several first words and add "..." at the end (only if user did not request this field specifically).
|
|
14
14
|
|
|
15
|
-
Also when you communicate with user about record, add related link to this record.
|
|
15
|
+
Also when you communicate with user about record, add related link to this record. Build it as `{ADMIN_BASE_PATH}resource/{resourceId}/show/{primary key}`. Use _label from `get_resource_data` as anchor text for link (use markdown link). Links should always be relative paths and must start with `ADMIN_BASE_PATH`. Do not add an extra slash after `ADMIN_BASE_PATH`.
|
|
@@ -21,7 +21,7 @@ Use `start_custom_action` and `start_custom_bulk_action` for resource actions.
|
|
|
21
21
|
Before performing any state mutation including action calls edit/delete please fetch record which is going to be edited/deleted and show user record in format field → value (show several most important fields which can help user to understand what exactly record he is going to edit or delete).
|
|
22
22
|
|
|
23
23
|
For field values with long texts show only several first words and add "..." at the end.
|
|
24
|
-
Also please add related link to record with will be changed.
|
|
24
|
+
Also please add related link to record with will be changed. Build it as `{ADMIN_BASE_PATH}resource/{resourceId}/show/{primary key}`. Use _label from `get_resource_data` as anchor text for link (use markdown link). Links should always be relative paths and must start with `ADMIN_BASE_PATH`. Do not add an extra slash after `ADMIN_BASE_PATH`.
|
|
25
25
|
|
|
26
26
|
And in the same message ask user for final confirmation.
|
|
27
27
|
|
|
@@ -62,7 +62,7 @@ If you want to block some user you can confirm that this action by saying:
|
|
|
62
62
|
* IP Country: USA
|
|
63
63
|
* Currently blocked: No // show this field only if it exists in user record
|
|
64
64
|
|
|
65
|
-
View [John Doe](
|
|
65
|
+
View [John Doe]({ADMIN_BASE_PATH}resource/users/show/123)
|
|
66
66
|
Are you sure?
|
|
67
67
|
```
|
|
68
68
|
|
|
@@ -85,7 +85,7 @@ I am going to update user:
|
|
|
85
85
|
* IP Country: USA
|
|
86
86
|
I am going to change email from john_doe@example.com to new_email@example.com
|
|
87
87
|
|
|
88
|
-
View [John Doe](
|
|
88
|
+
View [John Doe]({ADMIN_BASE_PATH}resource/users/show/123)
|
|
89
89
|
|
|
90
90
|
Are you sure?
|
|
91
91
|
```
|
|
@@ -105,7 +105,7 @@ If you gonna delete user record, in confirmation please share full user info (no
|
|
|
105
105
|
* Signed up: 2024 Jan 1
|
|
106
106
|
* IP Country: USA
|
|
107
107
|
|
|
108
|
-
View [John Doe](
|
|
108
|
+
View [John Doe]({ADMIN_BASE_PATH}resource/users/show/123)
|
|
109
109
|
|
|
110
110
|
Are you sure?
|
|
111
111
|
```
|
|
@@ -130,7 +130,7 @@ I am going to create user:
|
|
|
130
130
|
* Username: john_doe
|
|
131
131
|
* Email: john_doe@example.com
|
|
132
132
|
|
|
133
|
-
View [John Doe](
|
|
133
|
+
View [John Doe]({ADMIN_BASE_PATH}resource/users/show/421) # 421 is id of new created record
|
|
134
134
|
|
|
135
135
|
Are you sure?
|
|
136
136
|
```
|