@mariozechner/pi 0.5.44 → 0.5.46

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,4 +1,4 @@
1
- import { main as agentMain } from "@mariozechner/pi-agent";
1
+ import { main as agentMain } from "@mariozechner/pi-agent-old";
2
2
  import chalk from "chalk";
3
3
  import { getActivePod, loadConfig } from "../config.js";
4
4
  // ────────────────────────────────────────────────────────────────────────────────
@@ -1 +1 @@
1
- {"version":3,"file":"prompt.js","sourceRoot":"","sources":["../../src/commands/prompt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,IAAI,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAWxD,mFAAmF;AACnF,uBAAuB;AACvB,mFAAmF;AAEnF,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,SAAiB,EAAE,QAAkB,EAAE,OAAsB,EAAE;IAChG,kCAAkC;IAClC,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,UAAU,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,YAAY,EAAE,CAAC;IAEnG,IAAI,CAAC,SAAS,EAAE,CAAC;QAChB,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,wDAAwD,CAAC,CAAC,CAAC;QACnF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACjB,CAAC;IAED,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,GAAG,SAAS,CAAC;IACzC,MAAM,WAAW,GAAG,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IAE1C,IAAI,CAAC,WAAW,EAAE,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AAC,OAAO,EAAE,CAAC,CAAC,CAAC;QACxD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACjB,CAAC;AACF,CAAC","sourcesContent":["import { main as agentMain } from \"@mariozechner/pi-agent\";\nimport chalk from \"chalk\";\nimport { getActivePod, loadConfig } from \"../config.js\";\n\n// ────────────────────────────────────────────────────────────────────────────────\n// Types\n// ────────────────────────────────────────────────────────────────────────────────\n\ninterface PromptOptions {\n\tpod?: string;\n\tapiKey?: string;\n}\n\n// ────────────────────────────────────────────────────────────────────────────────\n// Main prompt function\n// ────────────────────────────────────────────────────────────────────────────────\n\nexport async function promptModel(modelName: string, userArgs: string[], opts: PromptOptions = {}) {\n\t// Get pod and model configuration\n\tconst activePod = opts.pod ? { name: opts.pod, pod: loadConfig().pods[opts.pod] } : getActivePod();\n\n\tif (!activePod) {\n\t\tconsole.error(chalk.red(\"No active pod. Use 'pi pods active <name>' to set one.\"));\n\t\tprocess.exit(1);\n\t}\n\n\tconst { name: podName, pod } = activePod;\n\tconst modelConfig = pod.models[modelName];\n\n\tif (!modelConfig) {\n\t\tconsole.error(chalk.red(`Model '${modelName}' not found on pod '${podName}'`));\n\t\tprocess.exit(1);\n\t}\n\n\t// Extract host from SSH string\n\tconst host =\n\t\tpod.ssh\n\t\t\t.split(\" \")\n\t\t\t.find((p) => p.includes(\"@\"))\n\t\t\t?.split(\"@\")[1] ?? \"localhost\";\n\n\t// Build the system prompt for code navigation\n\tconst systemPrompt = `You help the user understand and navigate the codebase in the current working directory.\n\nYou can read files, list directories, and execute shell commands via the respective tools.\n\nDo not output file contents you read via the read_file tool directly, unless asked to.\n\nDo not output markdown tables as part of your responses.\n\nKeep your responses concise and relevant to the user's request.\n\nFile paths you output must include line numbers where possible, e.g. \"src/index.ts:10-20\" for lines 10 to 20 in src/index.ts.\n\nCurrent working directory: ${process.cwd()}`;\n\n\t// Build arguments for agent main function\n\tconst args: string[] = [];\n\n\t// Add base configuration that we control\n\targs.push(\n\t\t\"--base-url\",\n\t\t`http://${host}:${modelConfig.port}/v1`,\n\t\t\"--model\",\n\t\tmodelConfig.model,\n\t\t\"--api-key\",\n\t\topts.apiKey || process.env.PI_API_KEY || \"dummy\",\n\t\t\"--api\",\n\t\tmodelConfig.model.toLowerCase().includes(\"gpt-oss\") ? \"responses\" : \"completions\",\n\t\t\"--system-prompt\",\n\t\tsystemPrompt,\n\t);\n\n\t// Pass through all user-provided arguments\n\t// This includes messages, --continue, --json, etc.\n\targs.push(...userArgs);\n\n\t// Call agent main function directly\n\ttry {\n\t\tawait agentMain(args);\n\t} catch (err: any) {\n\t\tconsole.error(chalk.red(`Agent error: ${err.message}`));\n\t\tprocess.exit(1);\n\t}\n}\n"]}
1
+ {"version":3,"file":"prompt.js","sourceRoot":"","sources":["../../src/commands/prompt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,IAAI,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAWxD,mFAAmF;AACnF,uBAAuB;AACvB,mFAAmF;AAEnF,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,SAAiB,EAAE,QAAkB,EAAE,OAAsB,EAAE;IAChG,kCAAkC;IAClC,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,UAAU,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,YAAY,EAAE,CAAC;IAEnG,IAAI,CAAC,SAAS,EAAE,CAAC;QAChB,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,wDAAwD,CAAC,CAAC,CAAC;QACnF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACjB,CAAC;IAED,MAAM,EAAE,IAAI,EAA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AAS,CAAC,IAAI,CAAC,CAAC;IACvB,CAAC;IAAC,OAAO,GAAQ,EAAE,CAAC;QACnB,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,gBAAgB,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;QACxD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACjB,CAAC;AACF,CAAC","sourcesContent":["import { main as agentMain } from \"@mariozechner/pi-agent-old\";\nimport chalk from \"chalk\";\nimport { getActivePod, loadConfig } from \"../config.js\";\n\n// ────────────────────────────────────────────────────────────────────────────────\n// Types\n// ────────────────────────────────────────────────────────────────────────────────\n\ninterface PromptOptions {\n\tpod?: string;\n\tapiKey?: string;\n}\n\n// ────────────────────────────────────────────────────────────────────────────────\n// Main prompt function\n// ────────────────────────────────────────────────────────────────────────────────\n\nexport async function promptModel(modelName: string, userArgs: string[], opts: PromptOptions = {}) {\n\t// Get pod and model configuration\n\tconst activePod = opts.pod ? { name: opts.pod, pod: loadConfig().pods[opts.pod] } : getActivePod();\n\n\tif (!activePod) {\n\t\tconsole.error(chalk.red(\"No active pod. Use 'pi pods active <name>' to set one.\"));\n\t\tprocess.exit(1);\n\t}\n\n\tconst { name: podName, pod } = activePod;\n\tconst modelConfig = pod.models[modelName];\n\n\tif (!modelConfig) {\n\t\tconsole.error(chalk.red(`Model '${modelName}' not found on pod '${podName}'`));\n\t\tprocess.exit(1);\n\t}\n\n\t// Extract host from SSH string\n\tconst host =\n\t\tpod.ssh\n\t\t\t.split(\" \")\n\t\t\t.find((p) => p.includes(\"@\"))\n\t\t\t?.split(\"@\")[1] ?? \"localhost\";\n\n\t// Build the system prompt for code navigation\n\tconst systemPrompt = `You help the user understand and navigate the codebase in the current working directory.\n\nYou can read files, list directories, and execute shell commands via the respective tools.\n\nDo not output file contents you read via the read_file tool directly, unless asked to.\n\nDo not output markdown tables as part of your responses.\n\nKeep your responses concise and relevant to the user's request.\n\nFile paths you output must include line numbers where possible, e.g. \"src/index.ts:10-20\" for lines 10 to 20 in src/index.ts.\n\nCurrent working directory: ${process.cwd()}`;\n\n\t// Build arguments for agent main function\n\tconst args: string[] = [];\n\n\t// Add base configuration that we control\n\targs.push(\n\t\t\"--base-url\",\n\t\t`http://${host}:${modelConfig.port}/v1`,\n\t\t\"--model\",\n\t\tmodelConfig.model,\n\t\t\"--api-key\",\n\t\topts.apiKey || process.env.PI_API_KEY || \"dummy\",\n\t\t\"--api\",\n\t\tmodelConfig.model.toLowerCase().includes(\"gpt-oss\") ? \"responses\" : \"completions\",\n\t\t\"--system-prompt\",\n\t\tsystemPrompt,\n\t);\n\n\t// Pass through all user-provided arguments\n\t// This includes messages, --continue, --json, etc.\n\targs.push(...userArgs);\n\n\t// Call agent main function directly\n\ttry {\n\t\tawait agentMain(args);\n\t} catch (err: any) {\n\t\tconsole.error(chalk.red(`Agent error: ${err.message}`));\n\t\tprocess.exit(1);\n\t}\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mariozechner/pi",
3
- "version": "0.5.44",
3
+ "version": "0.5.46",
4
4
  "description": "CLI tool for managing vLLM deployments on GPU pods",
5
5
  "type": "module",
6
6
  "bin": {
@@ -34,7 +34,7 @@
34
34
  "node": ">=20.0.0"
35
35
  },
36
36
  "dependencies": {
37
- "@mariozechner/pi-agent": "^0.5.44",
37
+ "@mariozechner/pi-agent": "^0.5.46",
38
38
  "chalk": "^5.5.0"
39
39
  },
40
40
  "devDependencies": {}