@pasko70/pibo 2.0.0 → 2.1.1

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.
@@ -0,0 +1,57 @@
1
+ import { OMP_AGENT_RUNTIME_DRIVER } from "../agent-runtimes/omp/adapter.js";
2
+ import { InitialSessionContextBuilder } from "../core/profiles.js";
3
+ import { definePiboPlugin } from "./registry.js";
4
+ export const OMP_RUNTIME_INSTANCE_ID = "omp-native";
5
+ export const OMP_PROFILE_NAME = "orp";
6
+ /**
7
+ * Resolve the OMP CLI entry for the default configured instance.
8
+ *
9
+ * The operator must point Pibo at an Oh My Pi install. We honour (in order):
10
+ * PIBO_OMP_CLI absolute path to the OMP CLI entry (clover cli.ts / dist/cli.js)
11
+ * OMP_HOME absolute directory containing `src/cli.ts`
12
+ * If neither is set, ompEntry stays empty and `diagnose` reports it clearly; the
13
+ * adapter refuses to spawn until configured. We never invent a workspace-relative
14
+ * default.
15
+ */
16
+ function defaultOmpEntry() {
17
+ const cli = process.env.PIBO_OMP_CLI;
18
+ if (cli && (cli.startsWith("/") || /^[a-zA-Z]:[\\/]/.test(cli)))
19
+ return cli.trim();
20
+ const home = process.env.OMP_HOME;
21
+ if (home && (home.startsWith("/") || /^[a-zA-Z]:[\\/]/.test(home))) {
22
+ return `${home.replace(/[\\/]+$/, "")}${process.platform === "win32" ? "\\" : "/"}packages/coding-agent/src/cli.ts`;
23
+ }
24
+ return "";
25
+ }
26
+ export const piboOmpPlugin = definePiboPlugin({
27
+ id: "pibo.orp",
28
+ name: "Pibo Oh My Pi",
29
+ register(api) {
30
+ api.registerAgentRuntimeDriver(OMP_AGENT_RUNTIME_DRIVER);
31
+ api.registerAgentRuntimeInstance({
32
+ id: OMP_RUNTIME_INSTANCE_ID,
33
+ adapterId: OMP_AGENT_RUNTIME_DRIVER.descriptor.id,
34
+ displayName: "Oh My Pi Native",
35
+ config: {
36
+ bunExecutable: "bun",
37
+ ompEntry: defaultOmpEntry(),
38
+ defaultProvider: "alibaba-token-plan",
39
+ defaultModel: "deepseek-v4-flash-0731",
40
+ environmentAllowlist: ["PATH", "SystemRoot", "WINDIR", "TZ", "HTTP_PROXY", "HTTPS_PROXY", "NO_PROXY", "ALL_PROXY"],
41
+ apiKeyEnvironment: ["OPENAI_API_KEY", "ANTHROPIC_API_KEY", "GEMINI_API_KEY", "DEEPSEEK_API_KEY", "ALIBABA_TOKEN_PLAN_API_KEY", "BAILIAN_TOKEN_PLAN_API_KEY"],
42
+ },
43
+ });
44
+ api.registerProfile({
45
+ name: OMP_PROFILE_NAME,
46
+ description: "Oh My Pi native runtime profile. Uses the OMP engine (can1357/oh-my-pi) via its RPC bridge; OMP owns its native tools, base prompt, and sessions; Pibo delivers selected portable tools, skills, and context files.",
47
+ create() {
48
+ return new InitialSessionContextBuilder(OMP_PROFILE_NAME)
49
+ .withAgentRuntime(OMP_RUNTIME_INSTANCE_ID)
50
+ .withBuiltinTools("disabled")
51
+ .withBuiltinToolNames([])
52
+ .withToolPackages({ goalControl: true })
53
+ .createSession();
54
+ },
55
+ });
56
+ },
57
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pasko70/pibo",
3
- "version": "2.0.0",
3
+ "version": "2.1.1",
4
4
  "type": "module",
5
5
  "workspaces": [
6
6
  "packages/workflows",