@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.
@@ -1,8 +1,9 @@
1
1
  /**
2
2
  * Reload Runtime Extension
3
3
  *
4
- * Demonstrates ctx.reload() from ExtensionCommandContext and an LLM-callable
5
- * tool that queues a follow-up command to trigger reload.
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. Tools get ExtensionContext, so they cannot call ctx.reload() directly.
23
- // Instead, queue a follow-up user command that executes the command above.
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
- async execute() {
30
- pi.sendUserMessage("/reload-runtime", { deliverAs: "followUp" });
30
+ executionMode: "sequential",
31
+ async execute(_toolCallId, _params, _signal, _onUpdate, ctx) {
32
+ await ctx.reload();
31
33
  return {
32
- content: [{ type: "text", text: "Queued /reload-runtime as a follow-up command." }],
34
+ content: [{ type: "text", text: "Reloaded runtime. Refreshed tools are available on the next turn." }],
33
35
  details: {},
34
36
  };
35
37
  },
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@caupulican/pi-adaptative",
3
- "version": "0.75.6",
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.6",
9
+ "version": "0.75.7",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
12
  "@earendil-works/pi-agent-core": "^0.75.5",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@caupulican/pi-adaptative",
3
- "version": "0.75.6",
3
+ "version": "0.75.7",
4
4
  "description": "Adaptive fork of Pi coding agent for self-evolving agent harness experiments",
5
5
  "type": "module",
6
6
  "piConfig": {