ollanet 0.5.0 → 0.6.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.
- package/README.md +41 -7
- package/dist/argv.d.ts +17 -0
- package/dist/argv.js +73 -0
- package/dist/bench-suite.d.ts +2 -0
- package/dist/bench-suite.js +1 -0
- package/dist/bench.js +75 -79
- package/dist/chats.js +4 -6
- package/dist/cli.js +16 -2
- package/dist/compare-store.d.ts +8 -0
- package/dist/compare-store.js +55 -0
- package/dist/compare.d.ts +52 -0
- package/dist/compare.js +288 -0
- package/dist/index.d.ts +7 -1
- package/dist/index.js +4 -0
- package/dist/mcp.js +118 -3
- package/dist/paths.d.ts +4 -0
- package/dist/paths.js +8 -0
- package/dist/prompt-input.d.ts +7 -0
- package/dist/prompt-input.js +36 -0
- package/dist/prompt.js +46 -72
- package/dist/ps.js +4 -10
- package/dist/pull.js +7 -12
- package/dist/rm.js +7 -12
- package/dist/scan-store.d.ts +15 -0
- package/dist/scan-store.js +41 -0
- package/dist/scan.d.ts +12 -1
- package/dist/scan.js +73 -42
- package/dist/show.js +7 -12
- package/dist/target.d.ts +2 -0
- package/dist/target.js +10 -5
- package/package.json +2 -1
package/dist/target.js
CHANGED
|
@@ -1,15 +1,20 @@
|
|
|
1
1
|
import { configFromPartial, loadConfig } from "./config.js";
|
|
2
2
|
import { discoverHosts, resolveHost, shortName } from "./hosts.js";
|
|
3
|
-
/**
|
|
4
|
-
export async function
|
|
5
|
-
const query = machine.trim();
|
|
6
|
-
if (!query)
|
|
7
|
-
throw new Error("Machine is required.");
|
|
3
|
+
/** Discover hosts the same way every command does (config + Tailscale + …). */
|
|
4
|
+
export async function listTargets(config) {
|
|
8
5
|
const app = config ? configFromPartial(config) : await loadConfig();
|
|
9
6
|
const { hosts } = await discoverHosts({
|
|
10
7
|
hosts: app.hosts,
|
|
11
8
|
discovery: app.discovery,
|
|
12
9
|
});
|
|
10
|
+
return hosts;
|
|
11
|
+
}
|
|
12
|
+
/** Resolve a machine name the same way pull / prompt / bench do. */
|
|
13
|
+
export async function resolveTarget(machine, config) {
|
|
14
|
+
const query = machine.trim();
|
|
15
|
+
if (!query)
|
|
16
|
+
throw new Error("Machine is required.");
|
|
17
|
+
const hosts = await listTargets(config);
|
|
13
18
|
const host = resolveHost(hosts, query);
|
|
14
19
|
if (!host.online && !host.isSelf && host.source === "tailscale") {
|
|
15
20
|
throw new Error(`Machine "${shortName(host)}" appears offline.`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ollanet",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.1",
|
|
4
4
|
"description": "Discover and talk to Ollama on any reachable network — CLI, MCP, and a Node library",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
"ollanet": "tsx src/cli.ts",
|
|
30
30
|
"scan": "tsx src/cli.ts scan",
|
|
31
31
|
"prompt": "tsx src/cli.ts prompt",
|
|
32
|
+
"compare": "tsx src/cli.ts compare",
|
|
32
33
|
"pull": "tsx src/cli.ts pull",
|
|
33
34
|
"show": "tsx src/cli.ts show",
|
|
34
35
|
"rm": "tsx src/cli.ts rm",
|