@ycodium-ai/agent-pi 0.2.3710 → 0.2.3766

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/index.js CHANGED
@@ -1,5 +1,11 @@
1
1
  // src/index.ts
2
+ import * as NodeOS2 from "node:os";
3
+ import * as NodePath3 from "node:path";
2
4
  import { definePlugin } from "@ycodium-ai/plugin-api";
5
+ import {
6
+ EXECUTOR_EFFECTIVE_PAYLOAD_SCHEMA,
7
+ readExecutorEffectiveRequest
8
+ } from "@ycodium-ai/plugin-api/executor";
3
9
 
4
10
  // src/config.ts
5
11
  import * as NodeCrypto from "node:crypto";
@@ -98,6 +104,8 @@ var PI_CARD = {
98
104
  commandName: "pi",
99
105
  launchArgs: "",
100
106
  homeEnvVar: "",
107
+ // 设置表单里留空的格子此刻会用什么,见 index.ts 的同名命令。
108
+ effectiveCommand: "effectiveConfig",
101
109
  environment: [],
102
110
  install: { kind: "npm" },
103
111
  signIn: [],
@@ -1442,11 +1450,29 @@ function createPiInstance(value, host) {
1442
1450
  // src/index.ts
1443
1451
  var index_default = definePlugin({
1444
1452
  id: "agent-pi",
1445
- apiVersion: 53,
1453
+ apiVersion: 56,
1446
1454
  executors: [
1447
- { card: PI_CARD, createInstance: async (config, host) => createPiInstance(config, host) }
1455
+ {
1456
+ card: PI_CARD,
1457
+ createInstance: async (config, host) => createPiInstance(config, host),
1458
+ lifecycle: [{ kind: "detect", reversible: true }]
1459
+ }
1448
1460
  ],
1449
1461
  activate(ctx) {
1462
+ ctx.command({
1463
+ name: "effectiveConfig",
1464
+ description: "Settings form: the session directory an empty path resolves to.",
1465
+ scope: "read",
1466
+ payloadSchema: EXECUTOR_EFFECTIVE_PAYLOAD_SCHEMA,
1467
+ handle: async (payload) => {
1468
+ const { instanceId } = readExecutorEffectiveRequest(payload);
1469
+ return {
1470
+ homePath: instanceId === void 0 ? { detailKey: "form.homePath.newInstance" } : {
1471
+ value: NodePath3.join(NodeOS2.homedir(), ".pi", "ycodium", identifier(instanceId))
1472
+ }
1473
+ };
1474
+ }
1475
+ });
1450
1476
  ctx.log.info("Pi executor ready");
1451
1477
  }
1452
1478
  });
package/locales/en.json CHANGED
@@ -1,4 +1,8 @@
1
1
  {
2
+ "presentation": {
3
+ "name": "Pi",
4
+ "description": "Use Pi in Ycodium with your own model API."
5
+ },
2
6
  "setupNote": "Pi runs tools with the permissions of its process; it does not provide a sandbox or per-tool approvals.",
3
7
  "connectionNotVerified": "API credentials and model access will be checked on the first request.",
4
8
  "connection": {
@@ -34,11 +38,12 @@
34
38
  },
35
39
  "binaryPath": {
36
40
  "title": "Pi executable",
37
- "description": "Optional path to Pi 1.4.0 or newer. Uses pi from PATH when empty."
41
+ "description": "Absolute path to Pi 1.4.0 or newer."
38
42
  },
39
43
  "homePath": {
40
44
  "title": "Session directory",
41
- "description": "Optional storage root for this instance. Keep separate instances in separate directories."
45
+ "description": "Optional storage root for this instance. Keep separate instances in separate directories.",
46
+ "newInstance": "A private directory for this provider, created when you add it"
42
47
  }
43
48
  }
44
49
  }
@@ -1,4 +1,8 @@
1
1
  {
2
+ "presentation": {
3
+ "name": "Pi",
4
+ "description": "在 Ycodium 里使用 Pi,接你自己的模型 API。"
5
+ },
2
6
  "setupNote": "Pi 按进程权限执行工具,不提供沙箱或逐工具审批。",
3
7
  "connectionNotVerified": "首次请求时将验证 API 凭据和模型访问权限。",
4
8
  "connection": {
@@ -34,11 +38,12 @@
34
38
  },
35
39
  "binaryPath": {
36
40
  "title": "Pi 程序",
37
- "description": "可选的 Pi 1.4.0 或更高版本程序路径。留空则从 PATH 查找 pi。"
41
+ "description": "Pi 1.4.0 或更高版本程序的绝对路径。"
38
42
  },
39
43
  "homePath": {
40
44
  "title": "会话目录",
41
- "description": "可选的实例存储根目录。不同实例应使用各自的目录。"
45
+ "description": "可选的实例存储根目录。不同实例应使用各自的目录。",
46
+ "newInstance": "添加后为这个 provider 建一个私有目录"
42
47
  }
43
48
  }
44
49
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ycodium-ai/agent-pi",
3
- "version": "0.2.3710",
3
+ "version": "0.2.3766",
4
4
  "description": "Pi executor over the native RPC protocol.",
5
5
  "keywords": [
6
6
  "ycodium",
@@ -30,14 +30,16 @@
30
30
  "tailwindcss": "^4.0.0",
31
31
  "typescript": "~6.0.3",
32
32
  "vite-plus": "0.2.2",
33
- "@ycodium-ai/plugin-api": "0.2.3710",
34
- "@ycodium/contracts": "0.0.33",
35
- "ycodium-executor-testing": "0.0.0"
33
+ "@ycodium-ai/plugin-api": "0.2.3766",
34
+ "ycodium-executor-testing": "0.0.0",
35
+ "@ycodium/contracts": "0.0.33"
36
36
  },
37
37
  "ycodium": {
38
38
  "plugin": "./dist/index.js",
39
39
  "displayName": "Pi",
40
- "description": "Run Pi with your model API, native session resume and searchable Ycodium tools.",
40
+ "displayNameKey": "presentation.name",
41
+ "description": "Use Pi in Ycodium with your own model API.",
42
+ "descriptionKey": "presentation.description",
41
43
  "icon": "./assets/icon.svg",
42
44
  "permissions": [
43
45
  {