@hydraharness/harness-plugin-runtime 0.1.1-rc.10

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.
@@ -0,0 +1,9 @@
1
+ /** Package-owned invariant companion. @module @hydraharness/harness-plugin-runtime/invariant */
2
+ import type { Context } from '@hydraharness/cordis';
3
+ /** Cordis companion plugin name. */
4
+ export declare const name = "plugin-runtime-invariant";
5
+ /** Service required before the companion can reserve package ownership. */
6
+ export declare const inject: string[];
7
+ /** Register the package ownership companion. */
8
+ export declare const apply: (ctx: Context) => Promise<() => void>;
9
+ //# sourceMappingURL=invariant.d.ts.map
@@ -0,0 +1,11 @@
1
+ /** Package-owned invariant companion. @module @hydraharness/harness-plugin-runtime/invariant */
2
+ const PACKAGE_NAME = '@hydraharness/harness-plugin-runtime';
3
+ /** Cordis companion plugin name. */
4
+ export const name = 'plugin-runtime-invariant';
5
+ /** Service required before the companion can reserve package ownership. */
6
+ export const inject = ['invariants'];
7
+ /** No runtime invariant: runtime lifecycle observations are covered by the package's focused tests. */
8
+ const install = () => { };
9
+ /** Register the package ownership companion. */
10
+ export const apply = (ctx) => Promise.resolve(ctx.invariants.register(PACKAGE_NAME, install));
11
+ //# sourceMappingURL=invariant.js.map
@@ -0,0 +1,107 @@
1
+ /** Public types for the shared imported-plugin runtime. */
2
+ declare const importedPluginIdentityBrand: unique symbol;
3
+ /** Source-qualified identity: `<plugin-name>@<source-id>`. */
4
+ export type ImportedPluginIdentity = string & {
5
+ readonly [importedPluginIdentityBrand]: true;
6
+ };
7
+ /** Source descriptor retained for stable upgrades and source-owned paths. */
8
+ export interface ImportedPluginSource {
9
+ readonly kind: 'local' | 'git' | 'marketplace-local' | 'marketplace-git';
10
+ readonly source: string;
11
+ readonly sourceId: string;
12
+ readonly ref?: string;
13
+ readonly path?: string;
14
+ readonly marketplace?: string;
15
+ }
16
+ /** Optional structured form of an import source. A string is the common direct-import form. */
17
+ export interface ImportPluginRequest {
18
+ /** Local plugin/marketplace folder or a Git repository source. */
19
+ readonly source: string;
20
+ /** Marketplace plugin name when the source is a marketplace with multiple entries. */
21
+ readonly plugin?: string;
22
+ /** Optional Git ref for a direct Git source. */
23
+ readonly ref?: string;
24
+ /** Optional plugin subdirectory for a direct Git source. */
25
+ readonly path?: string;
26
+ }
27
+ /** A direct source string or the structured marketplace/Git form. */
28
+ export type PluginImportSource = string | ImportPluginRequest;
29
+ /** Persisted/imported bundle lifecycle state. */
30
+ export type ImportedPluginLifecycle = 'installed' | 'disabled' | 'enabled' | 'loaded';
31
+ /** Current review state for discovered hooks, independent of plugin enablement. */
32
+ export type HookTrustState = 'not-applicable' | 'pending' | 'trusted';
33
+ /** OpenAI skill/plugin presentation and invocation metadata from `agents/openai.yaml`. */
34
+ export interface ImportedPluginAgentMetadata {
35
+ readonly displayName?: string;
36
+ readonly shortDescription?: string;
37
+ readonly iconSmall?: string;
38
+ readonly iconLarge?: string;
39
+ readonly brandColor?: string;
40
+ readonly defaultPrompt?: string;
41
+ readonly allowImplicitInvocation?: boolean;
42
+ }
43
+ /** Per-server state projected even before an MCP process is mounted. */
44
+ export interface ImportedMcpServerSnapshot {
45
+ readonly name: string;
46
+ readonly enabled: boolean;
47
+ readonly startupState: 'not-started' | 'starting' | 'started' | 'failed';
48
+ /** Local stdio servers need no connection authentication; remote state is host-observed. */
49
+ readonly authenticationState: 'not-applicable' | 'unknown';
50
+ readonly defaultToolsApprovalMode: 'ask' | 'allow' | 'deny';
51
+ readonly toolApproval: Readonly<Record<string, 'ask' | 'allow' | 'deny'>>;
52
+ /** Currently registered, host-qualified MCP tool names. */
53
+ readonly tools: readonly string[];
54
+ }
55
+ /** One installed bundle's browser/command-facing state. */
56
+ export interface ImportedPluginEntry {
57
+ readonly identity: ImportedPluginIdentity;
58
+ readonly name: string;
59
+ /** Summary supplied by the installed plugin manifest. */
60
+ readonly description?: string;
61
+ /** Usage guidance supplied by the installed plugin manifest. */
62
+ readonly application?: string;
63
+ readonly version: string;
64
+ readonly source: ImportedPluginSource;
65
+ readonly pluginRoot: string;
66
+ readonly dataPath: string;
67
+ readonly enabled: boolean;
68
+ /** Enablement at runtime startup; bundles installed afterwards start disabled. */
69
+ readonly initialEnabled?: boolean;
70
+ readonly lifecycle: ImportedPluginLifecycle;
71
+ readonly hookTrustState: HookTrustState;
72
+ readonly hookDefinitionDigest?: string;
73
+ readonly skills: readonly string[];
74
+ readonly mcpServers: readonly ImportedMcpServerSnapshot[];
75
+ readonly hooks: readonly string[];
76
+ /** OpenAI presentation metadata; it does not execute plugin code. */
77
+ readonly agentMetadata?: ImportedPluginAgentMetadata;
78
+ /** Registered app/MCP mapping names from inert `.app.json` metadata. */
79
+ readonly appMappings?: readonly string[];
80
+ readonly installationStatus: 'installed';
81
+ }
82
+ /** Complete immutable snapshot returned by every public operation. */
83
+ export interface ImportedPluginSnapshot {
84
+ readonly plugins: readonly ImportedPluginEntry[];
85
+ }
86
+ /** Manifest metadata that the importer understands without executing bundle code. */
87
+ export interface PluginManifest {
88
+ /** Manifest format selected by the runtime. */
89
+ readonly format?: 'legacy' | 'portable' | 'claude';
90
+ readonly name: string;
91
+ readonly version: string;
92
+ readonly description?: string;
93
+ /** Optional usage guidance shown by plugin information dialogs. */
94
+ readonly application?: string;
95
+ readonly author?: string | Readonly<Record<string, unknown>>;
96
+ readonly homepage?: string;
97
+ readonly repository?: string;
98
+ readonly license?: string;
99
+ readonly keywords?: readonly string[];
100
+ readonly skills?: string | readonly string[];
101
+ readonly mcpServers?: string | readonly string[] | Readonly<Record<string, unknown>>;
102
+ readonly apps?: string | readonly string[] | Readonly<Record<string, unknown>>;
103
+ readonly hooks?: string | readonly string[] | Readonly<Record<string, unknown>> | readonly Readonly<Record<string, unknown>>[];
104
+ readonly interface?: Readonly<Record<string, unknown>>;
105
+ }
106
+ export {};
107
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1,3 @@
1
+ /** Public types for the shared imported-plugin runtime. */
2
+ export {};
3
+ //# sourceMappingURL=types.js.map
package/package.json ADDED
@@ -0,0 +1,77 @@
1
+ {
2
+ "name": "@hydraharness/harness-plugin-runtime",
3
+ "description": "Shared immutable OpenAI/Codex-compatible imported plugin runtime for the Hydra harness",
4
+ "hydra": {
5
+ "plugin": {
6
+ "application": "Import compatible plugin bundles and activate their skills, commands, MCP servers, and trusted hooks."
7
+ }
8
+ },
9
+ "version": "0.1.1-rc.10",
10
+ "publishConfig": {
11
+ "access": "public"
12
+ },
13
+ "repository": {
14
+ "type": "git",
15
+ "url": "git+https://github.com/MaiHongPhong2010/Hydra-Harness.git",
16
+ "directory": "packages/host/plugin-runtime"
17
+ },
18
+ "type": "module",
19
+ "main": "lib/index.js",
20
+ "types": "lib/types/index.d.ts",
21
+ "exports": {
22
+ ".": {
23
+ "types": "./lib/types/index.d.ts",
24
+ "default": "./lib/index.js"
25
+ },
26
+ "./invariant": {
27
+ "types": "./lib/types/invariant.d.ts",
28
+ "default": "./lib/invariant.js"
29
+ },
30
+ "./types": {
31
+ "types": "./lib/types/types.d.ts",
32
+ "default": "./lib/types/types.js"
33
+ },
34
+ "./src/*": "./src/*",
35
+ "./package.json": "./package.json"
36
+ },
37
+ "files": [
38
+ "lib/index.js",
39
+ "lib/invariant.js",
40
+ "lib/types/**/*.js",
41
+ "lib/types/**/*.d.ts"
42
+ ],
43
+ "license": "MIT",
44
+ "peerDependencies": {
45
+ "@hydraharness/harness-optional-plugins": "^0.1.1-rc.10",
46
+ "@hydraharness/harness-atomic-write": "^0.1.1-rc.10",
47
+ "@hydraharness/harness-commands": "^0.1.1-rc.10",
48
+ "@hydraharness/harness-hook-protocol": "^0.1.1-rc.10",
49
+ "@hydraharness/harness-home-paths": "^0.1.1-rc.10",
50
+ "@hydraharness/harness-invariants": "^0.1.1-rc.10",
51
+ "@hydraharness/harness-llm": "^0.1.1-rc.10",
52
+ "@hydraharness/harness-hooks-codex": "^0.1.1-rc.10",
53
+ "@hydraharness/harness-mcp-client": "^0.1.1-rc.10",
54
+ "@hydraharness/harness-skill": "^0.1.1-rc.10",
55
+ "@hydraharness/cordis": "^4.0.2",
56
+ "@hydraharness/harness-tools": "^0.1.1-rc.10"
57
+ },
58
+ "dependencies": {
59
+ "smol-toml": "^1.7.1",
60
+ "yaml": "^2.9.0"
61
+ },
62
+ "devDependencies": {
63
+ "@hydraharness/harness-optional-plugins": "^0.1.1-rc.10",
64
+ "@hydraharness/harness-hooks-codex": "^0.1.1-rc.10",
65
+ "@hydraharness/harness-commands": "^0.1.1-rc.10",
66
+ "@hydraharness/harness-atomic-write": "^0.1.1-rc.10",
67
+ "@hydraharness/harness-hook-protocol": "^0.1.1-rc.10",
68
+ "@hydraharness/harness-home-paths": "^0.1.1-rc.10",
69
+ "@hydraharness/harness-invariants": "^0.1.1-rc.10",
70
+ "@hydraharness/harness-llm": "^0.1.1-rc.10",
71
+ "@hydraharness/harness-mcp-client": "^0.1.1-rc.10",
72
+ "@hydraharness/harness-skill": "^0.1.1-rc.10",
73
+ "@hydraharness/harness-system-prompt": "^0.1.1-rc.10",
74
+ "@hydraharness/cordis": "^4.0.2",
75
+ "@hydraharness/harness-tools": "^0.1.1-rc.10"
76
+ }
77
+ }