1st-pi 0.3.1 → 0.3.2
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/README.md +1 -1
- package/extensions/packages/subagents.ts +46 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -158,7 +158,7 @@ TUI 与 tool ownership:
|
|
|
158
158
|
- Pi built-ins:继续负责 `bash`、`ls` 及其原生渲染
|
|
159
159
|
- Pi 内置 MCP:负责 MCP servers、`/mcp` 与 `pi mcp add/list`,读取 `~/.pi/agent/mcp.json` 与 `.pi/mcp.json`。preset 不再捆绑 `pi-mcp-adapter`;原先放在 `.mcp.json` 或 `~/.config/mcp/mcp.json` 的 servers 需要移入上述文件。曾加载 0.3.0 的用户,`settings.json` 的 `extensions` 中可能残留 adapter 写入的 `-builtin:mcp`,需在 `pi config` → Built-in 重新开启 MCP
|
|
160
160
|
- Tasks、Subagents、Workflows、Goal、BTW、Context 与 Memory:继续使用各 package 自己的领域 UI
|
|
161
|
-
- `workflow` tool 由 `@quintinshaw/pi-dynamic-workflows`
|
|
161
|
+
- `workflow` tool 由 `@quintinshaw/pi-dynamic-workflows` 负责。`@tintinweb/pi-subagents` 只保留 `Agent` 等 subagent 能力:全局与项目 `subagents.json` 都未设置 `workflowsEnabled` 时,preset 会在 `~/.pi/agent/subagents.json` 写入 `"workflowsEnabled": false`(保留其他字段,格式损坏的文件不动),关闭其 `SubagentWorkflow`,避免每次启动出现 workflow 冲突 warning(见 [tintinweb/pi-subagents#283](https://github.com/tintinweb/pi-subagents/issues/283))。已有的显式 `true`/`false` 不会被覆盖;设为 `true` 可强制两套 workflow 并存,不推荐
|
|
162
162
|
|
|
163
163
|
Workflow 关键词触发在首次加载 preset 时默认写为关闭;已有明确的 `on`/`off` 用户配置会保留,不会被 preset 覆盖。关闭关键词触发不影响 `/workflows` 及已保存 workflow 的 slash commands。
|
|
164
164
|
|
|
@@ -1 +1,46 @@
|
|
|
1
|
-
|
|
1
|
+
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
2
|
+
import { dirname, join } from "node:path";
|
|
3
|
+
import { getAgentDir } from "@earendil-works/pi-coding-agent";
|
|
4
|
+
import { loadSettings } from "@tintinweb/pi-subagents/src/settings.ts";
|
|
5
|
+
import registerSubagents from "@tintinweb/pi-subagents/src/index.ts";
|
|
6
|
+
|
|
7
|
+
type RawSettings = Record<string, unknown>;
|
|
8
|
+
|
|
9
|
+
function readGlobalSettings(path: string): RawSettings | undefined {
|
|
10
|
+
if (!existsSync(path)) return {};
|
|
11
|
+
try {
|
|
12
|
+
const parsed: unknown = JSON.parse(readFileSync(path, "utf-8"));
|
|
13
|
+
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) return undefined;
|
|
14
|
+
return parsed as RawSettings;
|
|
15
|
+
} catch {
|
|
16
|
+
// Leave malformed user files untouched; pi-subagents reports them itself.
|
|
17
|
+
return undefined;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* 1st-pi ships `@quintinshaw/pi-dynamic-workflows` as the sole `workflow`
|
|
23
|
+
* owner. When `workflowsEnabled` is unset, pi-subagents auto-detects that tool,
|
|
24
|
+
* stands down, and warns on every startup (tintinweb/pi-subagents#283). Pin the
|
|
25
|
+
* same outcome globally so the warning disappears, but only when neither the
|
|
26
|
+
* global nor the project settings already contain an explicit choice.
|
|
27
|
+
*/
|
|
28
|
+
export function applySubagentsPresetDefaults(cwd: string): void {
|
|
29
|
+
if (typeof loadSettings(cwd).workflowsEnabled === "boolean") return;
|
|
30
|
+
|
|
31
|
+
const path = join(getAgentDir(), "subagents.json");
|
|
32
|
+
const settings = readGlobalSettings(path);
|
|
33
|
+
if (!settings) return;
|
|
34
|
+
|
|
35
|
+
try {
|
|
36
|
+
mkdirSync(dirname(path), { recursive: true });
|
|
37
|
+
writeFileSync(path, `${JSON.stringify({ ...settings, workflowsEnabled: false }, null, 2)}\n`, "utf-8");
|
|
38
|
+
} catch {
|
|
39
|
+
// Non-fatal: pi-subagents still stands down automatically, just with a warning.
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export default function subagentsAdapter(...args: Parameters<typeof registerSubagents>): ReturnType<typeof registerSubagents> {
|
|
44
|
+
applySubagentsPresetDefaults(process.cwd());
|
|
45
|
+
return registerSubagents(...args);
|
|
46
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "1st-pi",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"description": "est7's Pi coding agent preset — skills, extensions, prompts, and themes.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "est7",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"@tintinweb/pi-subagents": "^0.20.0",
|
|
41
41
|
"@tintinweb/pi-tasks": "^0.9.0",
|
|
42
42
|
"pi-btw": "^0.7.1",
|
|
43
|
-
"pi-everforest-tui": "^0.2.
|
|
43
|
+
"pi-everforest-tui": "^0.2.1",
|
|
44
44
|
"pi-init": "^1.0.0",
|
|
45
45
|
"pi-readseek": "^0.10.4",
|
|
46
46
|
"pi-session-name": "^0.1.7",
|