@caupulican/pi-adaptative 0.75.6 → 0.75.7
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/core/agent-session.d.ts +2 -0
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +27 -5
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +1 -2
- package/dist/core/extensions/runner.js.map +1 -1
- package/docs/extensions.md +7 -5
- package/examples/extensions/reload-runtime.ts +9 -7
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Reload Runtime Extension
|
|
3
3
|
*
|
|
4
|
-
* Demonstrates ctx.reload() from
|
|
5
|
-
*
|
|
4
|
+
* Demonstrates ctx.reload() from a command and an LLM-callable tool.
|
|
5
|
+
* Tool-triggered reload is sequential so the next provider request in the same
|
|
6
|
+
* active run sees the refreshed tool definitions.
|
|
6
7
|
*/
|
|
7
8
|
|
|
8
9
|
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
@@ -19,17 +20,18 @@ export default function (pi: ExtensionAPI) {
|
|
|
19
20
|
},
|
|
20
21
|
});
|
|
21
22
|
|
|
22
|
-
// LLM-callable tool.
|
|
23
|
-
//
|
|
23
|
+
// LLM-callable tool. Treat reload as terminal for this handler too:
|
|
24
|
+
// old in-memory extension state should not be used after await ctx.reload().
|
|
24
25
|
pi.registerTool({
|
|
25
26
|
name: "reload_runtime",
|
|
26
27
|
label: "Reload Runtime",
|
|
27
28
|
description: "Reload extensions, skills, prompts, and themes",
|
|
28
29
|
parameters: Type.Object({}),
|
|
29
|
-
|
|
30
|
-
|
|
30
|
+
executionMode: "sequential",
|
|
31
|
+
async execute(_toolCallId, _params, _signal, _onUpdate, ctx) {
|
|
32
|
+
await ctx.reload();
|
|
31
33
|
return {
|
|
32
|
-
content: [{ type: "text", text: "
|
|
34
|
+
content: [{ type: "text", text: "Reloaded runtime. Refreshed tools are available on the next turn." }],
|
|
33
35
|
details: {},
|
|
34
36
|
};
|
|
35
37
|
},
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@caupulican/pi-adaptative",
|
|
3
|
-
"version": "0.75.
|
|
3
|
+
"version": "0.75.7",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@caupulican/pi-adaptative",
|
|
9
|
-
"version": "0.75.
|
|
9
|
+
"version": "0.75.7",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@earendil-works/pi-agent-core": "^0.75.5",
|