@caupulican/pi-adaptative 0.75.5 → 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,16 +1,16 @@
1
1
  {
2
2
  "name": "@caupulican/pi-adaptative",
3
- "version": "0.75.5",
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.5",
9
+ "version": "0.75.7",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
12
  "@earendil-works/pi-agent-core": "^0.75.5",
13
- "@earendil-works/pi-ai": "^0.75.5",
13
+ "@earendil-works/pi-ai": "npm:@caupulican/pi-ai@0.75.6",
14
14
  "@earendil-works/pi-tui": "^0.75.5",
15
15
  "@silvia-odwyer/photon-node": "0.3.4",
16
16
  "chalk": "5.6.2",
@@ -38,26 +38,6 @@
38
38
  "node": ">=22.19.0"
39
39
  }
40
40
  },
41
- "node_modules/@anthropic-ai/sdk": {
42
- "version": "0.91.1",
43
- "resolved": "https://registry.npmjs.org/@anthropic-ai/sdk/-/sdk-0.91.1.tgz",
44
- "integrity": "sha512-LAmu761tSN9r66ixvmciswUj/ZC+1Q4iAfpedTfSVLeswRwnY3n2Nb6Tsk+cLPP28aLOPWeMgIuTuCcMC6W/iw==",
45
- "license": "MIT",
46
- "dependencies": {
47
- "json-schema-to-ts": "^3.1.1"
48
- },
49
- "peerDependencies": {
50
- "zod": "^3.25.0 || ^4.0.0"
51
- },
52
- "peerDependenciesMeta": {
53
- "zod": {
54
- "optional": true
55
- }
56
- },
57
- "bin": {
58
- "anthropic-ai-sdk": "bin/cli"
59
- }
60
- },
61
41
  "node_modules/@aws-crypto/crc32": {
62
42
  "version": "5.2.0",
63
43
  "resolved": "https://registry.npmjs.org/@aws-crypto/crc32/-/crc32-5.2.0.tgz",
@@ -488,15 +468,17 @@
488
468
  }
489
469
  },
490
470
  "node_modules/@earendil-works/pi-ai": {
491
- "version": "0.75.5",
492
- "resolved": "https://registry.npmjs.org/@earendil-works/pi-ai/-/pi-ai-0.75.5.tgz",
471
+ "name": "@caupulican/pi-ai",
472
+ "version": "0.75.6",
473
+ "resolved": "https://registry.npmjs.org/@caupulican/pi-ai/-/pi-ai-0.75.6.tgz",
474
+ "integrity": "sha512-nulh1HGr7Cd9gwZewYcYghRhB7rEqXv66or0zOrKAZI6TVZhv16vpXNqfAdYrn29iBjMHLZkEZQPImbOBEKdcw==",
493
475
  "license": "MIT",
494
476
  "dependencies": {
495
477
  "@anthropic-ai/sdk": "0.91.1",
496
478
  "@aws-sdk/client-bedrock-runtime": "3.1048.0",
497
- "@smithy/node-http-handler": "4.7.3",
498
479
  "@google/genai": "1.52.0",
499
480
  "@mistralai/mistralai": "2.2.1",
481
+ "@smithy/node-http-handler": "4.7.3",
500
482
  "http-proxy-agent": "7.0.2",
501
483
  "https-proxy-agent": "7.0.6",
502
484
  "openai": "6.26.0",
@@ -504,12 +486,32 @@
504
486
  "typebox": "1.1.38"
505
487
  },
506
488
  "bin": {
507
- "pi-ai": "./dist/cli.js"
489
+ "pi-ai": "dist/cli.js"
508
490
  },
509
491
  "engines": {
510
492
  "node": ">=22.19.0"
511
493
  }
512
494
  },
495
+ "node_modules/@earendil-works/pi-ai/node_modules/@anthropic-ai/sdk": {
496
+ "version": "0.91.1",
497
+ "resolved": "https://registry.npmjs.org/@anthropic-ai/sdk/-/sdk-0.91.1.tgz",
498
+ "integrity": "sha512-LAmu761tSN9r66ixvmciswUj/ZC+1Q4iAfpedTfSVLeswRwnY3n2Nb6Tsk+cLPP28aLOPWeMgIuTuCcMC6W/iw==",
499
+ "license": "MIT",
500
+ "dependencies": {
501
+ "json-schema-to-ts": "^3.1.1"
502
+ },
503
+ "peerDependencies": {
504
+ "zod": "^3.25.0 || ^4.0.0"
505
+ },
506
+ "peerDependenciesMeta": {
507
+ "zod": {
508
+ "optional": true
509
+ }
510
+ },
511
+ "bin": {
512
+ "anthropic-ai-sdk": "bin/cli"
513
+ }
514
+ },
513
515
  "node_modules/@earendil-works/pi-tui": {
514
516
  "version": "0.75.5",
515
517
  "resolved": "https://registry.npmjs.org/@earendil-works/pi-tui/-/pi-tui-0.75.5.tgz",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@caupulican/pi-adaptative",
3
- "version": "0.75.5",
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": {
@@ -42,7 +42,7 @@
42
42
  },
43
43
  "dependencies": {
44
44
  "@earendil-works/pi-agent-core": "^0.75.5",
45
- "@earendil-works/pi-ai": "^0.75.5",
45
+ "@earendil-works/pi-ai": "npm:@caupulican/pi-ai@0.75.6",
46
46
  "@earendil-works/pi-tui": "^0.75.5",
47
47
  "@silvia-odwyer/photon-node": "0.3.4",
48
48
  "chalk": "5.6.2",