@kanonak-protocol/cli 5.10.0 → 5.12.0
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/dist/commands/ask.d.ts +23 -0
- package/dist/commands/docs.d.ts +5 -0
- package/dist/commands/models.d.ts +33 -0
- package/dist/index.js +250 -168
- package/dist/ui/ui.d.ts +70 -0
- package/package.json +3 -3
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
type Sanction = {
|
|
3
|
+
kind: 'run';
|
|
4
|
+
argv: string[];
|
|
5
|
+
} | {
|
|
6
|
+
kind: 'confirm';
|
|
7
|
+
argv: string[];
|
|
8
|
+
} | {
|
|
9
|
+
kind: 'refuse';
|
|
10
|
+
reason: string;
|
|
11
|
+
};
|
|
12
|
+
/** THE security boundary — structural, never prompt-based. */
|
|
13
|
+
export declare function classify(requested: string[]): Sanction;
|
|
14
|
+
/** Remove <think>…</think> deliberation blocks from an answer. */
|
|
15
|
+
export declare function stripThink(content: string): string;
|
|
16
|
+
/** The portion of an IN-FLIGHT answer safe to render now: closed <think> removed, an unclosed
|
|
17
|
+
* block held, and a tail that might begin `<think>` held. Append-only as the answer grows. */
|
|
18
|
+
export declare function streamVisible(full: string): string;
|
|
19
|
+
/** llama-family quirk: small models sometimes emit tool calls as JSON TEXT (possibly several, one
|
|
20
|
+
* per line). Recognize exactly that shape so the user gets an answer instead of protocol JSON. */
|
|
21
|
+
export declare function contentToolCalls(content: string): string[][];
|
|
22
|
+
export declare function registerAskCommand(program: Command): void;
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
/** Render the whole command tree as a plain-text / markdown reference. */
|
|
3
|
+
export declare function renderDocs(root: Command): string;
|
|
4
|
+
/** Register `kanonak docs` on the program. */
|
|
5
|
+
export declare function registerDocsCommand(program: Command): void;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
/** Ollama's standard localhost endpoint — the ONE definition (`kanonak ask` imports it). */
|
|
3
|
+
export declare const DEFAULT_OLLAMA_HOST = "http://localhost:11434";
|
|
4
|
+
/** The floor model — small, fast, tool-capable, runs anywhere. */
|
|
5
|
+
export declare const DEFAULT_MODEL = "llama3.2";
|
|
6
|
+
export interface CuratedModel {
|
|
7
|
+
tag: string;
|
|
8
|
+
family: string;
|
|
9
|
+
params: string;
|
|
10
|
+
pullGb: number;
|
|
11
|
+
minRamGb: number;
|
|
12
|
+
why: string;
|
|
13
|
+
}
|
|
14
|
+
/** Curated tool-capable models for `kanonak ask` — snapshot of the Ollama library, 2026-07.
|
|
15
|
+
* Ordered weakest→strongest; recommendation picks the LAST entry that fits. Every entry must
|
|
16
|
+
* support tool calls. Refresh deliberately. */
|
|
17
|
+
export declare const CURATED: CuratedModel[];
|
|
18
|
+
/** The best curated model this device comfortably supports (most capable whose minRamGb fits);
|
|
19
|
+
* unknown RAM → the floor model, never nothing. */
|
|
20
|
+
export declare function recommend(ramGb: number | null): CuratedModel;
|
|
21
|
+
/** Instant host facts: logical CPUs + total RAM in GiB. */
|
|
22
|
+
export declare function deviceBasics(): {
|
|
23
|
+
cpus: number;
|
|
24
|
+
ramGb: number | null;
|
|
25
|
+
};
|
|
26
|
+
/** The model the user chose with `kanonak models use`, if any. */
|
|
27
|
+
export declare function preferredModel(): string | null;
|
|
28
|
+
/** The strongest CURATED model among the installed tags — `ask`'s automatic default. */
|
|
29
|
+
export declare function bestInstalledCurated(installedNames: string[]): string | null;
|
|
30
|
+
/** Installed model names, or null if Ollama is unreachable — advisory only. */
|
|
31
|
+
export declare function installedNames(host: string): Promise<string[] | null>;
|
|
32
|
+
/** Register `kanonak models` (default action = list). */
|
|
33
|
+
export declare function registerModelsCommand(program: Command): void;
|