@pasko70/pibo 1.7.4 → 1.7.6

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.
Files changed (26) hide show
  1. package/dist/apps/chat/chat-api-routes.js +14 -0
  2. package/dist/apps/chat/web-app.js +125 -2
  3. package/dist/apps/chat/workflow-manual-trigger-runtime.js +223 -0
  4. package/dist/apps/chat-ui/assets/{dist-BzmsjE6I.js → dist-BUfawaFa.js} +1 -1
  5. package/dist/apps/chat-ui/assets/{dist-CSKVaxJI.js → dist-BhCflw5L.js} +1 -1
  6. package/dist/apps/chat-ui/assets/{dist-B8jyBeFH.js → dist-C2wdpulS.js} +1 -1
  7. package/dist/apps/chat-ui/assets/{dist-MCSKIQ04.js → dist-C5S2MWeq.js} +1 -1
  8. package/dist/apps/chat-ui/assets/{dist-C6kgrKy2.js → dist-CJOnkhP1.js} +1 -1
  9. package/dist/apps/chat-ui/assets/{dist-BS-A0VYR.js → dist-COMZszUx.js} +1 -1
  10. package/dist/apps/chat-ui/assets/{dist-OTFZZTiY.js → dist-ChMCJ0Xh.js} +1 -1
  11. package/dist/apps/chat-ui/assets/{dist-ChDQZXGN.js → dist-CqZsX_X9.js} +1 -1
  12. package/dist/apps/chat-ui/assets/{dist-Bl9cf-yT.js → dist-NDLYTRqO.js} +1 -1
  13. package/dist/apps/chat-ui/assets/{dist-BZoXuF9y.js → dist-XR2wwVeo.js} +1 -1
  14. package/dist/apps/chat-ui/assets/{dist-D6v32djn.js → dist-iblHo9vw.js} +1 -1
  15. package/dist/apps/chat-ui/assets/index-BStUapSa.css +1 -0
  16. package/dist/apps/chat-ui/assets/{index-CXXHizfD.js → index-BYqOi32B.js} +51 -44
  17. package/dist/apps/chat-ui/index.html +2 -2
  18. package/dist/apps/vscode-artifacts/latest.vsix +0 -0
  19. package/dist/apps/vscode-artifacts/{pibo-vscode-ext-1.7.4.vsix → pibo-vscode-ext-1.7.6.vsix} +0 -0
  20. package/dist/cli.js +10 -1
  21. package/dist/gateway/pidfile.js +9 -9
  22. package/dist/gateway/web.js +28 -3
  23. package/dist/plugins/builtin.js +2 -0
  24. package/dist/ralph/cli.js +2 -1
  25. package/package.json +93 -93
  26. package/dist/apps/chat-ui/assets/index-DgVHk3gL.css +0 -1
@@ -9,10 +9,10 @@
9
9
  <link rel="manifest" href="/apps/chat/manifest.webmanifest" />
10
10
  <link rel="apple-touch-icon" href="/apps/chat/assets/pwa-images/ios/180.png" />
11
11
  <title>Pibo Web Chat</title>
12
- <script type="module" crossorigin src="/apps/chat/assets/index-CXXHizfD.js"></script>
12
+ <script type="module" crossorigin src="/apps/chat/assets/index-BYqOi32B.js"></script>
13
13
  <link rel="modulepreload" crossorigin href="/apps/chat/assets/rolldown-runtime-S-ySWqyJ.js">
14
14
  <link rel="modulepreload" crossorigin href="/apps/chat/assets/dist-SVPsM5Oi.js">
15
- <link rel="stylesheet" crossorigin href="/apps/chat/assets/index-DgVHk3gL.css">
15
+ <link rel="stylesheet" crossorigin href="/apps/chat/assets/index-BStUapSa.css">
16
16
  </head>
17
17
  <body>
18
18
  <div id="root"></div>
package/dist/cli.js CHANGED
@@ -48,6 +48,15 @@ function parsePositiveInteger(value) {
48
48
  }
49
49
  return parsed;
50
50
  }
51
+ function defaultGatewayPortForWebPort(webPort) {
52
+ if (webPort === undefined)
53
+ return undefined;
54
+ const gatewayPort = webPort + 1;
55
+ if (gatewayPort > 65535) {
56
+ throw new Error("--web-port 65535 requires an explicit --gateway-port because the derived gateway port would exceed 65535");
57
+ }
58
+ return gatewayPort;
59
+ }
51
60
  function isLoopbackBindForCli(host) {
52
61
  const normalized = host.startsWith("[") && host.endsWith("]") ? host.slice(1, -1) : host;
53
62
  return normalized === "127.0.0.1" || normalized === "::1" || normalized === "localhost";
@@ -380,7 +389,7 @@ export async function runPiboCli(argv = process.argv) {
380
389
  }
381
390
  await runWebGatewayServer({
382
391
  authMode: authMode,
383
- port: options.gatewayPort,
392
+ port: options.gatewayPort ?? defaultGatewayPortForWebPort(options.webPort),
384
393
  web: {
385
394
  host: options.webHost,
386
395
  port: options.webPort,
@@ -1,14 +1,14 @@
1
1
  import { existsSync, readFileSync, unlinkSync, writeFileSync } from "node:fs";
2
2
  import { piboHomePath } from "../core/pibo-home.js";
3
- function gatewayPidPath() {
4
- return piboHomePath("gateway.pid");
3
+ function gatewayPidPath(port) {
4
+ return piboHomePath(port === undefined ? "gateway.pid" : `gateway-${port}.pid`);
5
5
  }
6
6
  function fallbackGatewayPidPath() {
7
7
  return piboHomePath("gateway-fallback.pid");
8
8
  }
9
- export function readPidFile() {
9
+ export function readPidFile(port) {
10
10
  try {
11
- const path = gatewayPidPath();
11
+ const path = gatewayPidPath(port);
12
12
  if (!existsSync(path))
13
13
  return undefined;
14
14
  const pid = parseInt(readFileSync(path, "utf-8").trim(), 10);
@@ -26,9 +26,9 @@ export function readPidFile() {
26
26
  return undefined;
27
27
  }
28
28
  }
29
- export function clearPidFile() {
29
+ export function clearPidFile(port) {
30
30
  try {
31
- const path = gatewayPidPath();
31
+ const path = gatewayPidPath(port);
32
32
  if (existsSync(path)) {
33
33
  unlinkSync(path);
34
34
  }
@@ -37,12 +37,12 @@ export function clearPidFile() {
37
37
  // ignore
38
38
  }
39
39
  }
40
- export function writeGatewayPid() {
41
- const existingPid = readPidFile();
40
+ export function writeGatewayPid(port) {
41
+ const existingPid = readPidFile(port);
42
42
  if (existingPid !== undefined && existingPid !== process.pid) {
43
43
  throw new Error(`Gateway already running (PID ${existingPid})`);
44
44
  }
45
- writeFileSync(gatewayPidPath(), String(process.pid), "utf-8");
45
+ writeFileSync(gatewayPidPath(port), String(process.pid), "utf-8");
46
46
  }
47
47
  export function readFallbackPidFile() {
48
48
  try {
@@ -62,8 +62,28 @@ export function resolveWebGatewayAuthMode(options = {}) {
62
62
  }
63
63
  return "better-auth";
64
64
  }
65
+ function rebaseLoopbackAuthBaseURL(baseURL, options) {
66
+ if (!baseURL)
67
+ return undefined;
68
+ if (options.web?.host === undefined && options.web?.port === undefined)
69
+ return baseURL;
70
+ try {
71
+ const parsed = new URL(baseURL);
72
+ if (!isLoopbackHost(parsed.hostname))
73
+ return baseURL;
74
+ if (options.web?.host !== undefined && isLoopbackHost(options.web.host)) {
75
+ parsed.hostname = options.web.host.startsWith("[") && options.web.host.endsWith("]") ? options.web.host.slice(1, -1) : options.web.host;
76
+ }
77
+ if (options.web?.port !== undefined)
78
+ parsed.port = String(options.web.port);
79
+ return parsed.toString().replace(/\/$/, "");
80
+ }
81
+ catch {
82
+ return baseURL;
83
+ }
84
+ }
65
85
  function authBaseURL(options) {
66
- return options.auth?.baseURL ?? loadPiboConfig().auth?.baseURL;
86
+ return options.auth?.baseURL ?? rebaseLoopbackAuthBaseURL(loadPiboConfig().auth?.baseURL, options);
67
87
  }
68
88
  function defaultWebHost(baseURL, options = {}) {
69
89
  // When local auth is selected, always default to loopback bind to keep the
@@ -86,6 +106,10 @@ export function resolveWebGatewayServerOptions(options = {}) {
86
106
  const baseURL = authBaseURL(options);
87
107
  return {
88
108
  ...options,
109
+ auth: {
110
+ ...options.auth,
111
+ ...(baseURL ? { baseURL } : {}),
112
+ },
89
113
  web: {
90
114
  ...options.web,
91
115
  host: options.web?.host ?? defaultWebHost(baseURL, options),
@@ -146,6 +170,7 @@ function createChatAppURL(options, host, port) {
146
170
  export async function runWebGatewayServer(options = {}) {
147
171
  const resolvedOptions = resolveWebGatewayServerOptions(options);
148
172
  const pluginRegistry = resolvedOptions.pluginRegistry ?? createWebPiboPluginRegistry(resolvedOptions);
173
+ const pidFilePort = resolvedOptions.port;
149
174
  const server = new PiboGatewayServer({
150
175
  ...resolvedOptions,
151
176
  pluginRegistry,
@@ -156,7 +181,7 @@ export async function runWebGatewayServer(options = {}) {
156
181
  writeFallbackGatewayPid();
157
182
  }
158
183
  else {
159
- writeGatewayPid();
184
+ writeGatewayPid(pidFilePort);
160
185
  }
161
186
  }
162
187
  catch (err) {
@@ -173,7 +198,7 @@ export async function runWebGatewayServer(options = {}) {
173
198
  clearFallbackPidFile();
174
199
  }
175
200
  else {
176
- clearPidFile();
201
+ clearPidFile(pidFilePort);
177
202
  }
178
203
  };
179
204
  process.once("SIGINT", () => {
@@ -461,6 +461,8 @@ export function resolvePiboProfileNameFromRegistryOrDefault(registry, profileNam
461
461
  catch (error) {
462
462
  if (requestedProfileName === DEFAULT_PIBO_PROFILE_NAME)
463
463
  return DEFAULT_PIBO_PROFILE_NAME;
464
+ if (requestedProfileName === "default")
465
+ return selectDefaultPiboProfileName(registry);
464
466
  throw error;
465
467
  }
466
468
  }
package/dist/ralph/cli.js CHANGED
@@ -2,6 +2,7 @@ import { readFileSync } from 'node:fs';
2
2
  import { Command } from 'commander';
3
3
  import { createDefaultPiboRalphStore } from './store.js';
4
4
  import { createBuiltInRalphStopConditions } from './stopping.js';
5
+ import { DEFAULT_PIBO_PROFILE_NAME } from '../plugins/builtin.js';
5
6
  import { getRalphJobTemplate, listRalphJobTemplates } from './templates.js';
6
7
  function printDiscovery() {
7
8
  console.log(`pibo ralph
@@ -76,7 +77,7 @@ export async function runRalphCli(argv = process.argv) {
76
77
  else
77
78
  for (const job of jobs)
78
79
  console.log(formatRalphJobLine(job)); store.close(); });
79
- program.command('add').description('Create a Ralph job').option('--template <id>', 'Built-in job template id').option('--prompt <text>', 'Task prompt').option('--name <name>', 'Job name').option('--description <text>', 'Job description').option('--profile <profile>', 'Agent profile', 'default').option('--room <room-id>', 'Target room id').option('--default-chat', 'Target the shared default chat').option('--max-iterations <n>', 'Stop after n completed run attempts')
80
+ program.command('add').description('Create a Ralph job').option('--template <id>', 'Built-in job template id').option('--prompt <text>', 'Task prompt').option('--name <name>', 'Job name').option('--description <text>', 'Job description').option('--profile <profile>', 'Agent profile', DEFAULT_PIBO_PROFILE_NAME).option('--room <room-id>', 'Target room id').option('--default-chat', 'Target the shared default chat').option('--max-iterations <n>', 'Stop after n completed run attempts')
80
81
  .option('--start', 'Start immediately').option('--json', 'Print JSON').action((options) => { const base = templatePatch(options.template); const prompt = options.prompt ?? base.prompt; if (typeof prompt !== 'string' || !prompt.trim())
81
82
  throw new Error('Choose --template <id> or provide --prompt <text>'); const store = createDefaultPiboRalphStore({ path: program.opts().store }); const job = store.createJob({ name: options.name ?? base.name, description: options.description ?? base.description, enabled: options.start === true, target: targetFromOptions(options), profile: options.profile, prompt, maxIterations: options.maxIterations !== undefined ? maxIterations(options.maxIterations) : typeof base.maxIterations === 'number' ? base.maxIterations : undefined, stopPolicy: base.stopPolicy ?? undefined }); if (options.json)
82
83
  printJson(job);
package/package.json CHANGED
@@ -1,93 +1,93 @@
1
- {
2
- "name": "@pasko70/pibo",
3
- "version": "1.7.4",
4
- "type": "module",
5
- "imports": {
6
- "vscode": "./src/apps/chat-vscode/extension/src/vscode-shim.js"
7
- },
8
- "description": "Minimal TypeScript wrapper around Pi Coding Agent.",
9
- "files": [
10
- "dist",
11
- "context",
12
- "skills/builtin/**",
13
- "docs/ops/**",
14
- "README.md",
15
- "src/mcp/LICENSE.mcp-cli"
16
- ],
17
- "bin": {
18
- "pibo": "dist/bin/pibo.js",
19
- "rg": "dist/bin/rg.js"
20
- },
21
- "engines": {
22
- "node": ">=24"
23
- },
24
- "scripts": {
25
- "dev": "tsx src/bin/pibo.ts",
26
- "profile": "tsx src/bin/pibo.ts profile",
27
- "tui": "tsx src/bin/pibo.ts tui",
28
- "tui:routed": "tsx src/bin/pibo.ts tui:routed",
29
- "tui:gateway": "tsx src/bin/pibo.ts tui gateway-producer",
30
- "gateway": "tsx src/bin/pibo.ts gateway",
31
- "gateway:web": "npm run web-ui:build && tsx src/bin/pibo.ts gateway:web",
32
- "client": "tsx src/bin/pibo.ts client",
33
- "chat-ui:build": "vite build --config src/apps/chat-ui/vite.config.ts",
34
- "chat-ui:typecheck": "tsc -p src/apps/chat-ui/tsconfig.json --noEmit",
35
- "context-files-ui:build": "vite build --config src/apps/context-files-ui/vite.config.ts",
36
- "context-files-ui:typecheck": "tsc -p src/apps/context-files-ui/tsconfig.json --noEmit",
37
- "web-ui:build": "npm run chat-ui:build && npm run context-files-ui:build",
38
- "vscode:typecheck": "tsc -p src/apps/chat-vscode/extension/tsconfig.json --noEmit && tsc -p src/apps/chat-vscode/extension/webview/tsconfig.json --noEmit",
39
- "vscode:webview:build": "vite build --config src/apps/chat-vscode/extension/webview/vite.config.ts",
40
- "vscode:extension:build": "esbuild src/apps/chat-vscode/extension/src/extension.ts --bundle --platform=node --target=node24 --format=cjs --outfile=src/apps/chat-vscode/dist/extension/extension.cjs --external:vscode --sourcemap=inline",
41
- "vscode:package": "node scripts/vscode-package.mjs",
42
- "release": "node scripts/release.mjs",
43
- "release:github": "node scripts/create-github-release.mjs",
44
- "build": "tsc -p tsconfig.json && npm run web-ui:build && npm run vscode:webview:build && node scripts/ensure-bin-executable.mjs",
45
- "start": "node dist/bin/pibo.js",
46
- "test": "npm run build && node --test test/*.test.mjs test/chat-vscode/*.test.mjs",
47
- "check:product-vocab": "node scripts/legacy-product-vocabulary-gate.mjs",
48
- "validate:ink-web-derived": "node scripts/ink-cli-web-derived-parity-validate.mjs",
49
- "compute:limited-worker-smoke": "node scripts/compute-limited-worker-smoke.mjs",
50
- "typecheck": "tsc -p tsconfig.json --noEmit && npm run chat-ui:typecheck && npm run context-files-ui:typecheck && npm run vscode:typecheck",
51
- "clean": "node -e \"fs.rmSync('dist', { recursive: true, force: true })\"",
52
- "prepack": "npm run build"
53
- },
54
- "dependencies": {
55
- "@mariozechner/pi-ai": "^0.73.1",
56
- "@mariozechner/pi-coding-agent": "^0.73.1",
57
- "@mdxeditor/editor": "^3.55.0",
58
- "@modelcontextprotocol/sdk": "^1.29.0",
59
- "@tailwindcss/vite": "^4.2.4",
60
- "@tanstack/react-query": "^5.100.7",
61
- "@tanstack/react-router": "^1.168.25",
62
- "@tanstack/react-start": "^1.167.50",
63
- "@uiw/react-json-view": "^2.0.0-alpha.41",
64
- "@vscode/ripgrep": "^1.18.0",
65
- "@xyflow/react": "12.10.2",
66
- "better-auth": "^1.6.9",
67
- "commander": "^14.0.3",
68
- "ink": "^7.0.3",
69
- "lexical": "^0.35.0",
70
- "lucide-react": "^0.545.0",
71
- "prismjs": "^1.30.0",
72
- "react": "^19.2.5",
73
- "react-dom": "^19.2.5",
74
- "react-markdown": "^10.1.0",
75
- "react-virtuoso": "^4.18.6",
76
- "remark-gfm": "^4.0.1",
77
- "tailwindcss": "^4.2.4"
78
- },
79
- "devDependencies": {
80
- "@tanstack/router-plugin": "^1.167.28",
81
- "@types/node": "^25.6.0",
82
- "@types/prismjs": "^1.26.6",
83
- "@types/react": "^19.2.14",
84
- "@types/react-dom": "^19.2.3",
85
- "@vitejs/plugin-react": "^6.0.1",
86
- "@vscode/vsce": "^3.6.0",
87
- "esbuild": "^0.27.7",
88
- "tsx": "^4.21.0",
89
- "typescript": "^6.0.3",
90
- "vite": "^8.0.10",
91
- "vite-tsconfig-paths": "^5.1.4"
92
- }
93
- }
1
+ {
2
+ "name": "@pasko70/pibo",
3
+ "version": "1.7.6",
4
+ "type": "module",
5
+ "imports": {
6
+ "vscode": "./src/apps/chat-vscode/extension/src/vscode-shim.js"
7
+ },
8
+ "description": "Minimal TypeScript wrapper around Pi Coding Agent.",
9
+ "files": [
10
+ "dist",
11
+ "context",
12
+ "skills/builtin/**",
13
+ "docs/ops/**",
14
+ "README.md",
15
+ "src/mcp/LICENSE.mcp-cli"
16
+ ],
17
+ "bin": {
18
+ "pibo": "dist/bin/pibo.js",
19
+ "rg": "dist/bin/rg.js"
20
+ },
21
+ "engines": {
22
+ "node": ">=24"
23
+ },
24
+ "scripts": {
25
+ "dev": "tsx src/bin/pibo.ts",
26
+ "profile": "tsx src/bin/pibo.ts profile",
27
+ "tui": "tsx src/bin/pibo.ts tui",
28
+ "tui:routed": "tsx src/bin/pibo.ts tui:routed",
29
+ "tui:gateway": "tsx src/bin/pibo.ts tui gateway-producer",
30
+ "gateway": "tsx src/bin/pibo.ts gateway",
31
+ "gateway:web": "npm run web-ui:build && tsx src/bin/pibo.ts gateway:web",
32
+ "client": "tsx src/bin/pibo.ts client",
33
+ "chat-ui:build": "vite build --config src/apps/chat-ui/vite.config.ts",
34
+ "chat-ui:typecheck": "tsc -p src/apps/chat-ui/tsconfig.json --noEmit",
35
+ "context-files-ui:build": "vite build --config src/apps/context-files-ui/vite.config.ts",
36
+ "context-files-ui:typecheck": "tsc -p src/apps/context-files-ui/tsconfig.json --noEmit",
37
+ "web-ui:build": "npm run chat-ui:build && npm run context-files-ui:build",
38
+ "vscode:typecheck": "tsc -p src/apps/chat-vscode/extension/tsconfig.json --noEmit && tsc -p src/apps/chat-vscode/extension/webview/tsconfig.json --noEmit",
39
+ "vscode:webview:build": "vite build --config src/apps/chat-vscode/extension/webview/vite.config.ts",
40
+ "vscode:extension:build": "esbuild src/apps/chat-vscode/extension/src/extension.ts --bundle --platform=node --target=node24 --format=cjs --outfile=src/apps/chat-vscode/dist/extension/extension.cjs --external:vscode --sourcemap=inline",
41
+ "vscode:package": "node scripts/vscode-package.mjs",
42
+ "release": "node scripts/release.mjs",
43
+ "release:github": "node scripts/create-github-release.mjs",
44
+ "build": "tsc -p tsconfig.json && npm run web-ui:build && npm run vscode:webview:build && node scripts/ensure-bin-executable.mjs",
45
+ "start": "node dist/bin/pibo.js",
46
+ "test": "npm run build && node --test test/*.test.mjs test/chat-vscode/*.test.mjs",
47
+ "check:product-vocab": "node scripts/legacy-product-vocabulary-gate.mjs",
48
+ "validate:ink-web-derived": "node scripts/ink-cli-web-derived-parity-validate.mjs",
49
+ "compute:limited-worker-smoke": "node scripts/compute-limited-worker-smoke.mjs",
50
+ "typecheck": "tsc -p tsconfig.json --noEmit && npm run chat-ui:typecheck && npm run context-files-ui:typecheck && npm run vscode:typecheck",
51
+ "clean": "node -e \"fs.rmSync('dist', { recursive: true, force: true })\"",
52
+ "prepack": "npm run build"
53
+ },
54
+ "dependencies": {
55
+ "@mariozechner/pi-ai": "^0.73.1",
56
+ "@mariozechner/pi-coding-agent": "^0.73.1",
57
+ "@mdxeditor/editor": "^3.55.0",
58
+ "@modelcontextprotocol/sdk": "^1.29.0",
59
+ "@tailwindcss/vite": "^4.2.4",
60
+ "@tanstack/react-query": "^5.100.7",
61
+ "@tanstack/react-router": "^1.168.25",
62
+ "@tanstack/react-start": "^1.167.50",
63
+ "@uiw/react-json-view": "^2.0.0-alpha.41",
64
+ "@vscode/ripgrep": "^1.18.0",
65
+ "@xyflow/react": "12.10.2",
66
+ "better-auth": "^1.6.9",
67
+ "commander": "^14.0.3",
68
+ "ink": "^7.0.3",
69
+ "lexical": "^0.35.0",
70
+ "lucide-react": "^0.545.0",
71
+ "prismjs": "^1.30.0",
72
+ "react": "^19.2.5",
73
+ "react-dom": "^19.2.5",
74
+ "react-markdown": "^10.1.0",
75
+ "react-virtuoso": "^4.18.6",
76
+ "remark-gfm": "^4.0.1",
77
+ "tailwindcss": "^4.2.4"
78
+ },
79
+ "devDependencies": {
80
+ "@tanstack/router-plugin": "^1.167.28",
81
+ "@types/node": "^25.6.0",
82
+ "@types/prismjs": "^1.26.6",
83
+ "@types/react": "^19.2.14",
84
+ "@types/react-dom": "^19.2.3",
85
+ "@vitejs/plugin-react": "^6.0.1",
86
+ "@vscode/vsce": "^3.6.0",
87
+ "esbuild": "^0.27.7",
88
+ "tsx": "^4.21.0",
89
+ "typescript": "^6.0.3",
90
+ "vite": "^8.0.10",
91
+ "vite-tsconfig-paths": "^5.1.4"
92
+ }
93
+ }