@herjarsa/omo-meta-governor 0.27.0 → 0.28.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/cli-anything-sync.d.ts +37 -0
- package/dist/cli-anything.d.ts +103 -0
- package/dist/config.d.ts +13 -0
- package/dist/custom-tools.d.ts +54 -0
- package/dist/health.d.ts +41 -0
- package/dist/index.js +75 -72
- package/dist/index.js.map +10 -8
- package/dist/lib.js +75 -72
- package/dist/lib.js.map +11 -9
- package/dist/plugin.d.ts +2 -0
- package/dist/types.d.ts +11 -0
- package/package.json +1 -1
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { type CliAnythingCode, type Runner } from "./cli-anything";
|
|
2
|
+
export interface CliAnythingSyncConfig {
|
|
3
|
+
/** Enable auto-install + auto-upgrade on plugin load. Default true. */
|
|
4
|
+
enabled: boolean;
|
|
5
|
+
/** Auto-install when missing. Default true. */
|
|
6
|
+
autoInstall: boolean;
|
|
7
|
+
/** Auto-upgrade when a newer version is available. Default true. */
|
|
8
|
+
autoUpgrade: boolean;
|
|
9
|
+
/** Filesystem path for the upgrade-cache file (latest-known version per channel). */
|
|
10
|
+
cachePath: string;
|
|
11
|
+
/** Minimum ms between registry queries. Default 24h. */
|
|
12
|
+
upgradeCheckTtlMs: number;
|
|
13
|
+
/** Project dir. Default process.cwd(). */
|
|
14
|
+
projectDir?: string;
|
|
15
|
+
/** Test-only DI seam — replaces execSync so version probes never spawn real
|
|
16
|
+
* pip/npx in hermetic tests. */
|
|
17
|
+
runner?: Runner;
|
|
18
|
+
/** Where to install the meta-skill. Default 'global'. */
|
|
19
|
+
installScope?: "global" | "project";
|
|
20
|
+
/** Override cli-hub binary path. */
|
|
21
|
+
cliHubBin?: string;
|
|
22
|
+
/** Override skills binary path. */
|
|
23
|
+
skillsBin?: string;
|
|
24
|
+
/** Install timeout ms. Default 60_000. */
|
|
25
|
+
installTimeoutMs?: number;
|
|
26
|
+
}
|
|
27
|
+
export interface CliAnythingSyncResult {
|
|
28
|
+
attempted: boolean;
|
|
29
|
+
codes: CliAnythingCode[];
|
|
30
|
+
availability: {
|
|
31
|
+
cliHub: boolean;
|
|
32
|
+
cliHubVersion: string | null;
|
|
33
|
+
metaSkill: boolean;
|
|
34
|
+
};
|
|
35
|
+
alreadyInitialized: boolean;
|
|
36
|
+
}
|
|
37
|
+
export declare function runCliAnythingSync(config?: Partial<CliAnythingSyncConfig>): Promise<CliAnythingSyncResult>;
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
export interface CliAnythingConfig {
|
|
2
|
+
/** Path to `cli-hub` binary. Default: lookup in PATH. */
|
|
3
|
+
cliHubBin?: string;
|
|
4
|
+
/** Path to `pip` binary. Default: auto-probe pip → pip3 → python -m pip → uv. */
|
|
5
|
+
pipBin?: string;
|
|
6
|
+
/** Path to `npx skills` invocation. Default: `npx skills`. */
|
|
7
|
+
skillsBin?: string;
|
|
8
|
+
/** Default timeoutMs for each subprocess. Default: 60_000. */
|
|
9
|
+
installTimeoutMs?: number;
|
|
10
|
+
/** Default timeoutMs for version probes. Default: 10_000. */
|
|
11
|
+
probeTimeoutMs?: number;
|
|
12
|
+
}
|
|
13
|
+
export interface CliAnythingResult<T = unknown> {
|
|
14
|
+
/** True if the operation succeeded. */
|
|
15
|
+
ok: boolean;
|
|
16
|
+
/** Parsed payload (when JSON output was requested and the call succeeded). */
|
|
17
|
+
data: T | null;
|
|
18
|
+
/** Raw stdout (when JSON was not requested). */
|
|
19
|
+
rawOutput: string | null;
|
|
20
|
+
/** Truncated stderr (always populated, even on success, for diagnostics). */
|
|
21
|
+
stderr: string;
|
|
22
|
+
/** Wall-clock duration in ms. */
|
|
23
|
+
durationMs: number;
|
|
24
|
+
/** Diagnostic code (matches CliAnythingCode union). */
|
|
25
|
+
code: CliAnythingCode;
|
|
26
|
+
}
|
|
27
|
+
export type CliAnythingCode = "cli-anything-install-succeeded" | "cli-anything-install-failed" | "cli-anything-already-installed" | "cli-anything-upgrade-succeeded" | "cli-anything-upgrade-failed" | "cli-anything-upgrade-skipped" | "cli-hub-version-probed" | "cli-hub-version-probe-failed" | "cli-hub-list-succeeded" | "cli-hub-list-failed" | "cli-hub-search-succeeded" | "cli-hub-search-failed" | "cli-hub-info-succeeded" | "cli-hub-info-failed" | "cli-hub-install-succeeded" | "cli-hub-install-failed" | "skill-install-succeeded" | "skill-install-failed" | "skill-upgrade-succeeded" | "skill-upgrade-failed" | "skill-already-current";
|
|
28
|
+
export interface CliHubListEntry {
|
|
29
|
+
name: string;
|
|
30
|
+
display_name: string;
|
|
31
|
+
version: string;
|
|
32
|
+
description: string;
|
|
33
|
+
requires: string | null;
|
|
34
|
+
homepage: string | null;
|
|
35
|
+
install_cmd: string | null;
|
|
36
|
+
entry_point: string | null;
|
|
37
|
+
category: string;
|
|
38
|
+
_source: "harness" | "public" | "npm";
|
|
39
|
+
}
|
|
40
|
+
export type Runner = (cmd: string, opts?: {
|
|
41
|
+
timeoutMs?: number;
|
|
42
|
+
}) => string;
|
|
43
|
+
/**
|
|
44
|
+
* Get the installed cli-anything-hub version.
|
|
45
|
+
* Returns null when not installed.
|
|
46
|
+
*/
|
|
47
|
+
export declare function getInstalledCliHubVersion(runner?: Runner): string | null;
|
|
48
|
+
/**
|
|
49
|
+
* Fetch the latest cli-anything-hub version from PyPI.
|
|
50
|
+
* Returns null on any failure.
|
|
51
|
+
*/
|
|
52
|
+
export declare function fetchCliHubLatestVersion(runner?: Runner): string | null;
|
|
53
|
+
/**
|
|
54
|
+
* Compare two semver strings. Returns -1 / 0 / 1.
|
|
55
|
+
* Treats "latest" / empty as newer than anything (defensive).
|
|
56
|
+
*/
|
|
57
|
+
export declare function compareSemver(a: string, b: string): -1 | 0 | 1;
|
|
58
|
+
/**
|
|
59
|
+
* Install cli-anything-hub. Tries the safer methods first to avoid
|
|
60
|
+
* PEP 668 conflicts:
|
|
61
|
+
* 1. uv tool install (clean isolated env)
|
|
62
|
+
* 2. uv pip install --system (PEP 668-safe with --break-system-packages)
|
|
63
|
+
* 3. pip install --user (older fallback, no system pollution)
|
|
64
|
+
* 4. pip install (last resort; uses --break-system-packages on PEP 668 systems)
|
|
65
|
+
*/
|
|
66
|
+
export declare function installCliHub(runner?: Runner, timeoutMs?: number): CliAnythingResult;
|
|
67
|
+
/**
|
|
68
|
+
* Upgrade cli-anything-hub. Same tier order as installCliHub.
|
|
69
|
+
*/
|
|
70
|
+
export declare function upgradeCliHub(runner?: Runner, timeoutMs?: number): CliAnythingResult;
|
|
71
|
+
export interface ListOptions {
|
|
72
|
+
category?: string;
|
|
73
|
+
source?: "harness" | "public" | "npm" | "all";
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* List all available CLIs from the CLI-Anything hub registry.
|
|
77
|
+
*/
|
|
78
|
+
export declare function listClis(options?: ListOptions, runner?: Runner, timeoutMs?: number, cliHubBin?: string): CliAnythingResult<CliHubListEntry[]>;
|
|
79
|
+
/**
|
|
80
|
+
* Search CLIs by query string.
|
|
81
|
+
*/
|
|
82
|
+
export declare function searchClis(query: string, runner?: Runner, timeoutMs?: number, cliHubBin?: string): CliAnythingResult<CliHubListEntry[]>;
|
|
83
|
+
/**
|
|
84
|
+
* Show details for a specific CLI by name.
|
|
85
|
+
*/
|
|
86
|
+
export declare function infoCli(name: string, runner?: Runner, timeoutMs?: number, cliHubBin?: string): CliAnythingResult<string>;
|
|
87
|
+
/**
|
|
88
|
+
* Install a specific CLI by name (e.g. "gimp").
|
|
89
|
+
*/
|
|
90
|
+
export declare function installCli(name: string, runner?: Runner, timeoutMs?: number, cliHubBin?: string): CliAnythingResult;
|
|
91
|
+
/**
|
|
92
|
+
* Install the cli-hub-meta-skill via `npx skills add HKUDS/CLI-Anything --skill cli-hub-meta-skill`.
|
|
93
|
+
* scope: 'global' (default) installs to ~/.claude/skills/, 'project' to ./.claude/skills/.
|
|
94
|
+
*/
|
|
95
|
+
export declare function installCliHubMetaSkill(scope?: "global" | "project", runner?: Runner, timeoutMs?: number, skillsBin?: string): CliAnythingResult;
|
|
96
|
+
/**
|
|
97
|
+
* Upgrade the cli-hub-meta-skill via `npx skills update`.
|
|
98
|
+
*/
|
|
99
|
+
export declare function upgradeCliHubMetaSkill(scope?: "global" | "project", runner?: Runner, timeoutMs?: number, skillsBin?: string): CliAnythingResult;
|
|
100
|
+
/**
|
|
101
|
+
* Check whether cli-hub-meta-skill is installed by parsing `npx skills list --global`.
|
|
102
|
+
*/
|
|
103
|
+
export declare function isCliHubMetaSkillInstalled(scope?: "global" | "project", runner?: Runner, timeoutMs?: number, skillsBin?: string): boolean;
|
package/dist/config.d.ts
CHANGED
|
@@ -105,6 +105,19 @@ export interface MetaGovernorPluginConfig {
|
|
|
105
105
|
* Default false (opt-in — multi-project users want explicit control). */
|
|
106
106
|
addToGlobalGraph?: boolean;
|
|
107
107
|
};
|
|
108
|
+
/** v0.28.0: CLI-Anything hub auto-install + auto-upgrade. Opt-in.
|
|
109
|
+
* When enabled, the plugin ensures `cli-anything-hub` (pip) and
|
|
110
|
+
* `cli-hub-meta-skill` (npx skills) are installed and current. */
|
|
111
|
+
cliAnything?: {
|
|
112
|
+
enabled?: boolean;
|
|
113
|
+
autoInstall?: boolean;
|
|
114
|
+
autoUpgrade?: boolean;
|
|
115
|
+
cachePath?: string;
|
|
116
|
+
upgradeCheckTtlMs?: number;
|
|
117
|
+
cliHubBin?: string;
|
|
118
|
+
skillsBin?: string;
|
|
119
|
+
installScope?: "global" | "project";
|
|
120
|
+
};
|
|
108
121
|
/** Skill priming config (v0.20.0): proactive skill-selection nudge. */
|
|
109
122
|
skillPriming?: {
|
|
110
123
|
enabled?: boolean;
|
package/dist/custom-tools.d.ts
CHANGED
|
@@ -441,4 +441,58 @@ export declare function buildOmoHookStatusTool(deps: OmoHookStatusDeps): {
|
|
|
441
441
|
args: {};
|
|
442
442
|
execute(args: Record<string, never>, context: ToolContext): Promise<ToolResult>;
|
|
443
443
|
};
|
|
444
|
+
export interface OmoCliAnythingDeps {
|
|
445
|
+
cwd: string;
|
|
446
|
+
/** Optional runner DI seam for tests. When undefined, uses real execSync. */
|
|
447
|
+
runner?: (cmd: string, opts?: {
|
|
448
|
+
timeoutMs?: number;
|
|
449
|
+
}) => string;
|
|
450
|
+
}
|
|
451
|
+
/** Install a CLI from the CLI-Anything hub (e.g. `gimp`, `blender`, `drawio`). */
|
|
452
|
+
export declare function buildOmoCliAnythingInstallTool(deps: OmoCliAnythingDeps): {
|
|
453
|
+
description: string;
|
|
454
|
+
args: {
|
|
455
|
+
name: import("zod").ZodString;
|
|
456
|
+
};
|
|
457
|
+
execute(args: {
|
|
458
|
+
name: string;
|
|
459
|
+
}, context: ToolContext): Promise<ToolResult>;
|
|
460
|
+
};
|
|
461
|
+
/** List all CLIs available in the CLI-Anything hub. */
|
|
462
|
+
export declare function buildOmoCliAnythingListTool(deps: OmoCliAnythingDeps): {
|
|
463
|
+
description: string;
|
|
464
|
+
args: {
|
|
465
|
+
category: import("zod").ZodOptional<import("zod").ZodString>;
|
|
466
|
+
source: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
467
|
+
all: "all";
|
|
468
|
+
harness: "harness";
|
|
469
|
+
npm: "npm";
|
|
470
|
+
public: "public";
|
|
471
|
+
}>>;
|
|
472
|
+
};
|
|
473
|
+
execute(args: {
|
|
474
|
+
category?: string | undefined;
|
|
475
|
+
source?: "all" | "harness" | "npm" | "public" | undefined;
|
|
476
|
+
}, context: ToolContext): Promise<ToolResult>;
|
|
477
|
+
};
|
|
478
|
+
/** Search the CLI-Anything hub for CLIs matching a query. */
|
|
479
|
+
export declare function buildOmoCliAnythingSearchTool(deps: OmoCliAnythingDeps): {
|
|
480
|
+
description: string;
|
|
481
|
+
args: {
|
|
482
|
+
query: import("zod").ZodString;
|
|
483
|
+
};
|
|
484
|
+
execute(args: {
|
|
485
|
+
query: string;
|
|
486
|
+
}, context: ToolContext): Promise<ToolResult>;
|
|
487
|
+
};
|
|
488
|
+
/** Show details (display name, version, requires, install cmd, entry point) for a CLI. */
|
|
489
|
+
export declare function buildOmoCliAnythingInfoTool(deps: OmoCliAnythingDeps): {
|
|
490
|
+
description: string;
|
|
491
|
+
args: {
|
|
492
|
+
name: import("zod").ZodString;
|
|
493
|
+
};
|
|
494
|
+
execute(args: {
|
|
495
|
+
name: string;
|
|
496
|
+
}, context: ToolContext): Promise<ToolResult>;
|
|
497
|
+
};
|
|
444
498
|
export {};
|
package/dist/health.d.ts
CHANGED
|
@@ -39,6 +39,47 @@ export interface PluginHealth {
|
|
|
39
39
|
firstSeenISO: string;
|
|
40
40
|
lastSeenISO: string;
|
|
41
41
|
};
|
|
42
|
+
graphSync?: {
|
|
43
|
+
lastUpgradeAtISO: string | null;
|
|
44
|
+
lastUpgradeResult: "success" | "failed" | "skipped" | "unknown";
|
|
45
|
+
lastUpgradeTarget: "codegraph" | "graphify" | null;
|
|
46
|
+
lastUpgradeMs: number | null;
|
|
47
|
+
};
|
|
48
|
+
graphToolsUsed: {
|
|
49
|
+
omo_search: number;
|
|
50
|
+
omo_recall: number;
|
|
51
|
+
omo_health: number;
|
|
52
|
+
omo_find: number;
|
|
53
|
+
omo_impact: number;
|
|
54
|
+
omo_remember: number;
|
|
55
|
+
omo_recall_mcp: number;
|
|
56
|
+
omo_path: number;
|
|
57
|
+
omo_explain: number;
|
|
58
|
+
omo_files: number;
|
|
59
|
+
omo_callers: number;
|
|
60
|
+
omo_node: number;
|
|
61
|
+
omo_context: number;
|
|
62
|
+
omo_affected_cg: number;
|
|
63
|
+
omo_status: number;
|
|
64
|
+
omo_unlock: number;
|
|
65
|
+
omo_mark_dirty: number;
|
|
66
|
+
omo_sync_if_dirty: number;
|
|
67
|
+
omo_index: number;
|
|
68
|
+
omo_visualize: number;
|
|
69
|
+
omo_serve: number;
|
|
70
|
+
omo_uninit: number;
|
|
71
|
+
omo_diagnose: number;
|
|
72
|
+
omo_merge_graphs: number;
|
|
73
|
+
omo_save_result: number;
|
|
74
|
+
omo_extract: number;
|
|
75
|
+
omo_cluster_only: number;
|
|
76
|
+
omo_label: number;
|
|
77
|
+
omo_tree: number;
|
|
78
|
+
omo_clone: number;
|
|
79
|
+
omo_add: number;
|
|
80
|
+
omo_check_update: number;
|
|
81
|
+
omo_hook_status: number;
|
|
82
|
+
};
|
|
42
83
|
}
|
|
43
84
|
/**
|
|
44
85
|
* Atomically write the health state to the given path. Writes to a
|