jeopi-cli 16.2.13 → 16.2.15
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/CHANGELOG.md +21 -3
- package/README.md +1 -1
- package/dist/cli.js +3087 -3060
- package/dist/types/advisor/watchdog.d.ts +2 -2
- package/dist/types/autolearn/managed-skills.d.ts +2 -2
- package/dist/types/capability/types.d.ts +2 -2
- package/dist/types/cli/commands/migrate-legacy.d.ts +1 -0
- package/dist/types/cli/config-cli.d.ts +1 -1
- package/dist/types/cli/flag-tables.d.ts +1 -1
- package/dist/types/cli/grievances-cli.d.ts +1 -1
- package/dist/types/cli/models-cli.d.ts +1 -1
- package/dist/types/cli/update-cli.d.ts +2 -2
- package/dist/types/cli/worktree-cli.d.ts +1 -1
- package/dist/types/commit/index.d.ts +1 -1
- package/dist/types/commit/pipeline.d.ts +1 -1
- package/dist/types/commit/types.d.ts +1 -1
- package/dist/types/config/prompt-templates.d.ts +1 -1
- package/dist/types/config/settings-schema.d.ts +16 -6
- package/dist/types/config.d.ts +7 -7
- package/dist/types/discovery/helpers.d.ts +8 -8
- package/dist/types/discovery/omp-extension-roots.d.ts +2 -2
- package/dist/types/eval/py/runtime.d.ts +1 -1
- package/dist/types/extensibility/custom-tools/loader.d.ts +2 -2
- package/dist/types/extensibility/extensions/loader.d.ts +1 -1
- package/dist/types/extensibility/hooks/loader.d.ts +1 -1
- package/dist/types/extensibility/plugins/loader.d.ts +2 -2
- package/dist/types/extensibility/plugins/types.d.ts +13 -3
- package/dist/types/lsp/config.d.ts +2 -2
- package/dist/types/mcp/client.d.ts +1 -1
- package/dist/types/mcp/config-writer.d.ts +1 -1
- package/dist/types/mcp/oauth-flow.d.ts +1 -1
- package/dist/types/mcp/transports/http.d.ts +1 -1
- package/dist/types/memories/okf.d.ts +36 -0
- package/dist/types/modes/components/__tests__/assistant-agent-label.test.d.ts +1 -0
- package/dist/types/modes/components/assistant-message.d.ts +4 -0
- package/dist/types/modes/interactive-mode.d.ts +1 -1
- package/dist/types/sdk.d.ts +5 -5
- package/dist/types/session/agent-session.d.ts +3 -0
- package/dist/types/session/auth-broker-config.d.ts +4 -4
- package/dist/types/session/snapcompact-savings-journal.d.ts +1 -1
- package/dist/types/task/commands.d.ts +1 -1
- package/dist/types/task/critic-gate.d.ts +76 -0
- package/dist/types/task/critic-gate.test.d.ts +1 -0
- package/dist/types/task/discovery.d.ts +1 -1
- package/dist/types/task/executor.d.ts +1 -1
- package/dist/types/tools/acp-bridge.d.ts +2 -2
- package/dist/types/tools/browser/tab-protocol.d.ts +1 -1
- package/dist/types/tools/index.d.ts +6 -1
- package/dist/types/tools/plan-mode-guard.d.ts +8 -0
- package/dist/types/tools/report-tool-issue.d.ts +1 -1
- package/dist/types/utils/changelog.d.ts +2 -2
- package/dist/types/utils/image-loading.d.ts +4 -4
- package/dist/types/utils/image-resize.d.ts +1 -1
- package/dist/types/web/search/index.d.ts +1 -1
- package/examples/custom-tools/README.md +1 -1
- package/examples/extensions/README.md +1 -1
- package/examples/extensions/pirate.ts +1 -1
- package/examples/extensions/plan-mode.ts +1 -1
- package/examples/extensions/tools.ts +1 -1
- package/examples/hooks/README.md +1 -1
- package/examples/sdk/01-minimal.ts +1 -1
- package/examples/sdk/04-skills.ts +1 -1
- package/examples/sdk/06-extensions.ts +3 -3
- package/examples/sdk/09-api-keys-and-oauth.ts +2 -2
- package/examples/sdk/12-redis-sessions.ts +1 -1
- package/examples/sdk/13-sql-sessions.ts +1 -1
- package/examples/sdk/README.md +1 -1
- package/package.json +12 -12
- package/scripts/jeopi +1 -1
- package/src/advisor/__tests__/config.test.ts +4 -4
- package/src/advisor/watchdog.ts +8 -8
- package/src/autolearn/managed-skills.ts +4 -4
- package/src/autoresearch/storage.ts +2 -2
- package/src/capability/types.ts +2 -2
- package/src/cli/agents-cli.ts +2 -2
- package/src/cli/args.ts +3 -3
- package/src/cli/auth-broker-cli.ts +5 -5
- package/src/cli/auth-gateway-cli.ts +4 -4
- package/src/cli/claude-trace-cli.ts +1 -1
- package/src/cli/commands/migrate-legacy.ts +24 -0
- package/src/cli/config-cli.ts +20 -5
- package/src/cli/flag-tables.ts +1 -1
- package/src/cli/gallery-fixtures/misc.ts +7 -7
- package/src/cli/gallery-screenshot.ts +2 -2
- package/src/cli/grievances-cli.ts +1 -1
- package/src/cli/models-cli.ts +1 -1
- package/src/cli/plugin-cli.ts +2 -2
- package/src/cli/profile-alias.ts +8 -8
- package/src/cli/read-cli.ts +1 -1
- package/src/cli/ssh-cli.ts +2 -2
- package/src/cli/update-cli.ts +27 -27
- package/src/cli/worktree-cli.ts +3 -3
- package/src/cli.ts +5 -5
- package/src/commands/agents.ts +2 -2
- package/src/commands/auth-broker.ts +1 -1
- package/src/commands/config.ts +1 -1
- package/src/commands/dry-balance.ts +6 -6
- package/src/commands/launch.ts +2 -2
- package/src/commands/models.ts +1 -1
- package/src/commands/say.ts +1 -1
- package/src/commands/token.ts +5 -5
- package/src/commands/ttsr.ts +2 -2
- package/src/commands/worktree.ts +3 -3
- package/src/commit/agentic/prompts/system.md +1 -1
- package/src/commit/cli.ts +1 -1
- package/src/commit/index.ts +1 -1
- package/src/commit/pipeline.ts +1 -1
- package/src/commit/types.ts +1 -1
- package/src/config/mcp-schema.json +5 -5
- package/src/config/models-config-schema.ts +1 -1
- package/src/config/prompt-templates.ts +2 -2
- package/src/config/settings-schema.ts +20 -8
- package/src/config/settings.ts +1 -1
- package/src/config.ts +10 -10
- package/src/dap/session.ts +2 -2
- package/src/debug/protocol-probe.ts +1 -1
- package/src/debug/raw-sse-buffer.ts +3 -3
- package/src/debug/raw-sse.ts +2 -2
- package/src/discovery/builtin.ts +9 -9
- package/src/discovery/helpers.ts +13 -13
- package/src/discovery/omp-extension-roots.ts +4 -4
- package/src/discovery/omp-plugins.ts +2 -2
- package/src/discovery/substitute-plugin-root.ts +3 -3
- package/src/eval/py/runtime.ts +1 -1
- package/src/eval/rb/runner.rb +6 -6
- package/src/export/custom-share.ts +1 -1
- package/src/extensibility/custom-tools/loader.ts +3 -3
- package/src/extensibility/extensions/loader.ts +4 -4
- package/src/extensibility/hooks/loader.ts +1 -1
- package/src/extensibility/plugins/loader.ts +16 -10
- package/src/extensibility/plugins/manager.ts +10 -9
- package/src/extensibility/plugins/types.ts +15 -4
- package/src/internal-urls/docs-index.generated.txt +1 -1
- package/src/lsp/config.ts +4 -4
- package/src/lsp/index.ts +1 -1
- package/src/main.ts +1 -1
- package/src/mcp/client.ts +1 -1
- package/src/mcp/config-writer.ts +2 -2
- package/src/mcp/manager.ts +1 -1
- package/src/mcp/oauth-flow.ts +1 -1
- package/src/mcp/timeout.ts +2 -2
- package/src/mcp/transports/http.ts +1 -1
- package/src/memories/index.ts +82 -11
- package/src/memories/okf.ts +129 -0
- package/src/modes/components/__tests__/assistant-agent-label.test.ts +87 -0
- package/src/modes/components/assistant-message.ts +27 -0
- package/src/modes/components/extensions/extension-dashboard.ts +1 -1
- package/src/modes/controllers/mcp-command-controller.ts +2 -2
- package/src/modes/controllers/omfg-controller.ts +2 -2
- package/src/modes/controllers/ssh-command-controller.ts +2 -2
- package/src/modes/interactive-mode.ts +3 -1
- package/src/modes/setup-wizard/index.ts +1 -1
- package/src/prompts/agents/jeo.md +20 -10
- package/src/prompts/system/autolearn-guidance.md +2 -2
- package/src/prompts/system/system-prompt.md +10 -1
- package/src/prompts/tools/learn.md +1 -1
- package/src/prompts/tools/manage-skill.md +1 -1
- package/src/sdk.ts +8 -6
- package/src/secrets/index.ts +2 -2
- package/src/session/agent-session.ts +86 -6
- package/src/session/auth-broker-config.ts +6 -6
- package/src/session/snapcompact-savings-journal.ts +1 -1
- package/src/slash-commands/helpers/mcp.ts +1 -1
- package/src/system-prompt.test.ts +14 -14
- package/src/task/commands.ts +1 -1
- package/src/task/critic-gate.test.ts +181 -0
- package/src/task/critic-gate.ts +148 -0
- package/src/task/discovery.ts +5 -5
- package/src/task/executor.ts +1 -1
- package/src/task/index.ts +35 -2
- package/src/tools/acp-bridge.ts +2 -2
- package/src/tools/browser/launch.ts +1 -1
- package/src/tools/browser/tab-protocol.ts +1 -1
- package/src/tools/grep.ts +2 -2
- package/src/tools/index.ts +6 -1
- package/src/tools/plan-mode-guard.ts +16 -0
- package/src/tools/read.ts +1 -1
- package/src/tools/report-tool-issue.ts +2 -2
- package/src/utils/changelog.ts +2 -2
- package/src/utils/image-loading.ts +4 -4
- package/src/utils/image-resize.ts +5 -5
- package/src/web/search/index.ts +1 -1
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
*/
|
|
18
18
|
import * as fs from "node:fs/promises";
|
|
19
19
|
import * as path from "node:path";
|
|
20
|
-
import { getAgentDir, isEnoent, logger, tryParseJson } from "jeopi-utils";
|
|
20
|
+
import { CONFIG_DIR_NAME, getAgentDir, isEnoent, logger, tryParseJson } from "jeopi-utils";
|
|
21
21
|
import { readDirEntries, readFile } from "../capability/fs";
|
|
22
22
|
import type { LoadContext } from "../capability/types";
|
|
23
23
|
import { getEnabledPlugins } from "../extensibility/plugins/loader";
|
|
@@ -82,7 +82,7 @@ interface ScopeDirs {
|
|
|
82
82
|
|
|
83
83
|
function scopeDirs(ctx: LoadContext): ScopeDirs {
|
|
84
84
|
return {
|
|
85
|
-
project: path.join(ctx.cwd,
|
|
85
|
+
project: path.join(ctx.cwd, CONFIG_DIR_NAME),
|
|
86
86
|
user: getAgentDir(),
|
|
87
87
|
};
|
|
88
88
|
}
|
|
@@ -122,8 +122,8 @@ async function isDirectory(p: string): Promise<boolean> {
|
|
|
122
122
|
* are dropped):
|
|
123
123
|
*
|
|
124
124
|
* 1. CLI roots injected via {@link injectOmpExtensionCliRoots}
|
|
125
|
-
* 2. Project `<cwd>/.
|
|
126
|
-
* 3. User `~/.
|
|
125
|
+
* 2. Project `<cwd>/.jeopi/settings.json#extensions`
|
|
126
|
+
* 3. User `~/.jeopi/agent/settings.json#extensions`
|
|
127
127
|
* 4. Enabled npm/link plugins installed under `<plugins>/node_modules/` (for
|
|
128
128
|
* `jeopi install <pkg>` / `jeopi plugin install` / `jeopi plugin link`). Marketplace
|
|
129
129
|
* installs are loaded by the `claude-plugins` provider and are excluded here.
|
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
* sibling directories — `skills/`, `hooks/pre|post/`, `tools/`, `commands/`,
|
|
7
7
|
* `rules/`, `prompts/`, and `.mcp.json` — are picked up by omp's standard
|
|
8
8
|
* discovery surfaces. The native `jeopi` provider in `builtin.ts` only walks
|
|
9
|
-
* `.
|
|
9
|
+
* `.jeopi/` and `~/.jeopi/agent/`, so without this provider those sub-trees are
|
|
10
10
|
* silently ignored.
|
|
11
11
|
*
|
|
12
12
|
* Provider priority is set below the native `jeopi` provider (100) so an
|
|
13
|
-
* extension package never shadows the user's own `.
|
|
13
|
+
* extension package never shadows the user's own `.jeopi/` configuration on
|
|
14
14
|
* dedup.
|
|
15
15
|
*
|
|
16
16
|
* @see ./omp-extension-roots.ts
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Recursively substitute ${CLAUDE_PLUGIN_ROOT} and ${
|
|
2
|
+
* Recursively substitute ${CLAUDE_PLUGIN_ROOT} and ${JEOPI_PLUGIN_ROOT}
|
|
3
3
|
* with the actual plugin root path in strings, arrays, and plain objects.
|
|
4
4
|
*/
|
|
5
5
|
// Use concatenation to avoid noTemplateCurlyInString lint rule on literal placeholder names
|
|
6
6
|
const CLAUDE_VAR = "$" + "{CLAUDE_PLUGIN_ROOT}";
|
|
7
|
-
const
|
|
7
|
+
const JEOPI_VAR = "$" + "{JEOPI_PLUGIN_ROOT}";
|
|
8
8
|
|
|
9
9
|
export function substitutePluginRoot<T>(value: T, rootPath: string): T {
|
|
10
10
|
if (typeof value === "string") {
|
|
11
|
-
return value.replaceAll(CLAUDE_VAR, rootPath).replaceAll(
|
|
11
|
+
return value.replaceAll(CLAUDE_VAR, rootPath).replaceAll(JEOPI_VAR, rootPath) as T;
|
|
12
12
|
}
|
|
13
13
|
if (Array.isArray(value)) {
|
|
14
14
|
return value.map(v => substitutePluginRoot(v, rootPath)) as T;
|
package/src/eval/py/runtime.ts
CHANGED
|
@@ -221,7 +221,7 @@ export function resolveExplicitPythonRuntime(
|
|
|
221
221
|
|
|
222
222
|
/**
|
|
223
223
|
* Enumerate candidate Python runtimes in priority order: an active/project venv,
|
|
224
|
-
* the managed `~/.
|
|
224
|
+
* the managed `~/.jeopi/python-env`, then the system interpreter on PATH. Every
|
|
225
225
|
* candidate that physically exists is returned so callers can probe each in turn
|
|
226
226
|
* rather than committing to the first — a managed env left behind by a removed
|
|
227
227
|
* `uv` install no longer shadows a working system Python.
|
package/src/eval/rb/runner.rb
CHANGED
|
@@ -129,7 +129,7 @@ def __omp_emit_status(op, data = {})
|
|
|
129
129
|
__omp_emit_display({ "application/x-omp-status" => status }, "display")
|
|
130
130
|
end
|
|
131
131
|
|
|
132
|
-
|
|
132
|
+
JEOPI_IMAGE_MIMES = %w[image/png image/jpeg].freeze
|
|
133
133
|
|
|
134
134
|
# True when `str` already looks like base64 text (ASCII, base64 alphabet, length
|
|
135
135
|
# a multiple of 4). Raw image blobs (PNG/JPEG bytes) contain high bytes, so they
|
|
@@ -171,7 +171,7 @@ def __omp_normalize_bundle(hash)
|
|
|
171
171
|
hash.each do |key, val|
|
|
172
172
|
k = key.to_s
|
|
173
173
|
bundle[k] =
|
|
174
|
-
if
|
|
174
|
+
if JEOPI_IMAGE_MIMES.include?(k)
|
|
175
175
|
__omp_image_payload(val)
|
|
176
176
|
elsif val.is_a?(String)
|
|
177
177
|
__omp_scrub(val)
|
|
@@ -412,7 +412,7 @@ end
|
|
|
412
412
|
# Per-request runtime (cwd + managed env) + auto-result suppression
|
|
413
413
|
# ---------------------------------------------------------------------------
|
|
414
414
|
|
|
415
|
-
|
|
415
|
+
JEOPI_MANAGED_ENV_KEYS = %w[
|
|
416
416
|
PI_SESSION_FILE
|
|
417
417
|
PI_ARTIFACTS_DIR
|
|
418
418
|
PI_TOOL_BRIDGE_URL
|
|
@@ -430,7 +430,7 @@ def __omp_apply_request_runtime(req)
|
|
|
430
430
|
end
|
|
431
431
|
env = req["env"]
|
|
432
432
|
if env.is_a?(Hash)
|
|
433
|
-
|
|
433
|
+
JEOPI_MANAGED_ENV_KEYS.each do |key|
|
|
434
434
|
next unless env.key?(key)
|
|
435
435
|
value = env[key]
|
|
436
436
|
if value.is_a?(String)
|
|
@@ -445,7 +445,7 @@ end
|
|
|
445
445
|
# Last value-bearing AST node types we should NOT auto-display (statements /
|
|
446
446
|
# definitions, mirroring IPython's "only display a trailing expression"). Falls
|
|
447
447
|
# back to displaying any non-nil value when the AST is unavailable.
|
|
448
|
-
|
|
448
|
+
JEOPI_NON_DISPLAY_NODES = %i[
|
|
449
449
|
LASGN IASGN GASGN CVASGN DASGN OP_ASGN OP_CDECL CDECL MASGN CASGN
|
|
450
450
|
DEFN DEFS CLASS MODULE SCLASS ALIAS UNDEF
|
|
451
451
|
].freeze
|
|
@@ -473,7 +473,7 @@ def __omp_should_display_result?(src)
|
|
|
473
473
|
end
|
|
474
474
|
last = __omp_ast_last(node)
|
|
475
475
|
return true if last.nil?
|
|
476
|
-
!
|
|
476
|
+
!JEOPI_NON_DISPLAY_NODES.include?(last.type)
|
|
477
477
|
end
|
|
478
478
|
|
|
479
479
|
# ---------------------------------------------------------------------------
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Custom share script loader.
|
|
3
3
|
*
|
|
4
|
-
* Allows users to define a custom share handler at ~/.
|
|
4
|
+
* Allows users to define a custom share handler at ~/.jeopi/agent/share.ts
|
|
5
5
|
* that will be used instead of the default GitHub Gist sharing.
|
|
6
6
|
*/
|
|
7
7
|
import * as fs from "node:fs";
|
|
@@ -192,7 +192,7 @@ export async function loadCustomTools(
|
|
|
192
192
|
/**
|
|
193
193
|
* Collect the absolute tool-source paths to load, without importing or
|
|
194
194
|
* binding factories. Hot path on session startup — the scan walks
|
|
195
|
-
* `.
|
|
195
|
+
* `.jeopi/tools/`, `.claude/tools/`, the plugin tree, and any configured paths.
|
|
196
196
|
*
|
|
197
197
|
* Subagents reuse the parent's collected paths via the SDK's
|
|
198
198
|
* `preloadedCustomToolPaths` option, then call `loadCustomTools` themselves
|
|
@@ -225,7 +225,7 @@ export async function discoverCustomToolPaths(configuredPaths: string[], cwd: st
|
|
|
225
225
|
});
|
|
226
226
|
}
|
|
227
227
|
|
|
228
|
-
// 2. Plugin tools: ~/.
|
|
228
|
+
// 2. Plugin tools: ~/.jeopi/plugins/node_modules/*/
|
|
229
229
|
for (const pluginPath of await getAllPluginToolPaths(cwd)) {
|
|
230
230
|
addPath(pluginPath, { provider: "plugin", providerName: "Plugin", level: "user" });
|
|
231
231
|
}
|
|
@@ -241,7 +241,7 @@ export async function discoverCustomToolPaths(configuredPaths: string[], cwd: st
|
|
|
241
241
|
/**
|
|
242
242
|
* Discover and load tools from standard locations via capability system:
|
|
243
243
|
* 1. User and project tools discovered by capability providers
|
|
244
|
-
* 2. Installed plugins (~/.
|
|
244
|
+
* 2. Installed plugins (~/.jeopi/plugins/node_modules/*)
|
|
245
245
|
* 3. Explicitly configured paths from settings or CLI
|
|
246
246
|
*
|
|
247
247
|
* Composed of {@link discoverCustomToolPaths} (FS scan) + {@link loadCustomTools}
|
|
@@ -366,8 +366,8 @@ interface ExtensionManifest {
|
|
|
366
366
|
|
|
367
367
|
async function readExtensionManifest(packageJsonPath: string): Promise<ExtensionManifest | null> {
|
|
368
368
|
try {
|
|
369
|
-
const pkg = (await Bun.file(packageJsonPath).json()) as {
|
|
370
|
-
const manifest = pkg.
|
|
369
|
+
const pkg = (await Bun.file(packageJsonPath).json()) as { jeopi?: ExtensionManifest; pi?: ExtensionManifest };
|
|
370
|
+
const manifest = pkg.jeopi ?? pkg.pi;
|
|
371
371
|
if (manifest && typeof manifest === "object") {
|
|
372
372
|
return manifest;
|
|
373
373
|
}
|
|
@@ -484,7 +484,7 @@ async function discoverExtensionsInDir(dir: string): Promise<string[]> {
|
|
|
484
484
|
/**
|
|
485
485
|
* Discover absolute paths of extensions to load, without importing or
|
|
486
486
|
* binding factories. Hot path on session startup — the scan walks native
|
|
487
|
-
* `.
|
|
487
|
+
* `.jeopi`/`.pi` extension capabilities, JS/TS hook factories, the
|
|
488
488
|
* installed-plugin tree, and any configured paths.
|
|
489
489
|
*
|
|
490
490
|
* Subagents reuse the parent's collected paths via the SDK's
|
|
@@ -521,7 +521,7 @@ export async function discoverExtensionPaths(
|
|
|
521
521
|
}
|
|
522
522
|
};
|
|
523
523
|
|
|
524
|
-
// 1. Discover extension modules via capability API (native .
|
|
524
|
+
// 1. Discover extension modules via capability API (native .jeopi/.pi only)
|
|
525
525
|
const discovered = await loadCapability<ExtensionModule>(extensionModuleCapability.id, loadOptions);
|
|
526
526
|
for (const ext of discovered.items) {
|
|
527
527
|
if (ext._source.provider !== "native") continue;
|
|
@@ -212,7 +212,7 @@ export async function loadHooks(paths: string[], cwd: string): Promise<LoadHooks
|
|
|
212
212
|
/**
|
|
213
213
|
* Discover and load hooks from all registered providers.
|
|
214
214
|
* Uses the capability API to discover hook paths from:
|
|
215
|
-
* 1. OMP native configs (.
|
|
215
|
+
* 1. OMP native configs (.jeopi/.pi hooks/)
|
|
216
216
|
* 2. Installed plugins
|
|
217
217
|
* 3. Other editor/IDE configurations
|
|
218
218
|
*
|
|
@@ -11,7 +11,13 @@ import { getConfigDirPaths } from "../../config";
|
|
|
11
11
|
import { resolveActiveProjectRegistryPath } from "../../discovery/helpers";
|
|
12
12
|
import { installLegacyPiSpecifierShim } from "./legacy-pi-compat";
|
|
13
13
|
import { normalizePluginRuntimeConfig } from "./runtime-config";
|
|
14
|
-
import type {
|
|
14
|
+
import type {
|
|
15
|
+
InstalledPlugin,
|
|
16
|
+
PluginManifest,
|
|
17
|
+
PluginPackageJson,
|
|
18
|
+
PluginRuntimeConfig,
|
|
19
|
+
ProjectPluginOverrides,
|
|
20
|
+
} from "./types";
|
|
15
21
|
|
|
16
22
|
/** Installed plugin plus the root scope that supplied its runtime metadata. */
|
|
17
23
|
export interface ScopedInstalledPlugin extends InstalledPlugin {
|
|
@@ -43,7 +49,7 @@ async function loadRuntimeConfig(home?: string): Promise<PluginRuntimeConfig> {
|
|
|
43
49
|
}
|
|
44
50
|
|
|
45
51
|
/**
|
|
46
|
-
* Load project-local plugin overrides (checks .
|
|
52
|
+
* Load project-local plugin overrides (checks .jeopi and .pi directories).
|
|
47
53
|
*/
|
|
48
54
|
async function loadProjectOverrides(cwd: string): Promise<ProjectPluginOverrides> {
|
|
49
55
|
for (const overridesPath of getConfigDirPaths("plugin-overrides.json", { user: false, cwd })) {
|
|
@@ -101,7 +107,7 @@ async function collectPluginsAtRoot(
|
|
|
101
107
|
const plugins: ScopedInstalledPlugin[] = [];
|
|
102
108
|
for (const name of names) {
|
|
103
109
|
const pluginPkgPath = path.join(nodeModulesPath, name, "package.json");
|
|
104
|
-
let pluginPkg:
|
|
110
|
+
let pluginPkg: PluginPackageJson;
|
|
105
111
|
try {
|
|
106
112
|
pluginPkg = await Bun.file(pluginPkgPath).json();
|
|
107
113
|
} catch (err) {
|
|
@@ -111,9 +117,9 @@ async function collectPluginsAtRoot(
|
|
|
111
117
|
throw err;
|
|
112
118
|
}
|
|
113
119
|
|
|
114
|
-
const manifest: PluginManifest | undefined = pluginPkg.
|
|
120
|
+
const manifest: PluginManifest | undefined = pluginPkg.jeopi || pluginPkg.pi;
|
|
115
121
|
if (!manifest) {
|
|
116
|
-
// No
|
|
122
|
+
// No jeopi/pi plugin manifest, skip
|
|
117
123
|
continue;
|
|
118
124
|
}
|
|
119
125
|
manifest.version = pluginPkg.version;
|
|
@@ -150,9 +156,9 @@ async function collectPluginsAtRoot(
|
|
|
150
156
|
* Get list of enabled plugins with their resolved configurations.
|
|
151
157
|
*
|
|
152
158
|
* Enumerates two plugin roots in order: the user root
|
|
153
|
-
* (`getPluginsDir(home)`) and, when a project anchor (`.
|
|
159
|
+
* (`getPluginsDir(home)`) and, when a project anchor (`.jeopi/` or `.git/`)
|
|
154
160
|
* exists at or above `cwd`, the project root
|
|
155
|
-
* (`<projectAnchor>/.
|
|
161
|
+
* (`<projectAnchor>/.jeopi/plugins`). Each root contributes the union of its
|
|
156
162
|
* `package.json#dependencies` and `omp-plugins.lock.json#plugins`. Project
|
|
157
163
|
* entries shadow user entries with the same package name, matching the
|
|
158
164
|
* shadow semantics of `MarketplaceManager.listInstalledPlugins`.
|
|
@@ -235,13 +241,13 @@ function readDeclaredManifestEntries(dir: string): DeclaredManifestEntries {
|
|
|
235
241
|
} catch {
|
|
236
242
|
return { declared: false, files: [] };
|
|
237
243
|
}
|
|
238
|
-
let pkg: {
|
|
244
|
+
let pkg: { jeopi?: { extensions?: unknown }; pi?: { extensions?: unknown } };
|
|
239
245
|
try {
|
|
240
|
-
pkg = JSON.parse(raw) as {
|
|
246
|
+
pkg = JSON.parse(raw) as { jeopi?: { extensions?: unknown }; pi?: { extensions?: unknown } };
|
|
241
247
|
} catch {
|
|
242
248
|
return { declared: false, files: [] };
|
|
243
249
|
}
|
|
244
|
-
const declared = (pkg.
|
|
250
|
+
const declared = (pkg.jeopi ?? pkg.pi)?.extensions;
|
|
245
251
|
if (!Array.isArray(declared) || declared.length === 0) {
|
|
246
252
|
return { declared: false, files: [] };
|
|
247
253
|
}
|
|
@@ -25,6 +25,7 @@ import type {
|
|
|
25
25
|
InstalledPlugin,
|
|
26
26
|
InstallOptions,
|
|
27
27
|
PluginManifest,
|
|
28
|
+
PluginPackageJson,
|
|
28
29
|
PluginRuntimeConfig,
|
|
29
30
|
PluginSettingSchema,
|
|
30
31
|
ProjectPluginOverrides,
|
|
@@ -516,7 +517,7 @@ export class PluginManager {
|
|
|
516
517
|
}
|
|
517
518
|
|
|
518
519
|
const pkgPath = path.join(getPluginsNodeModules(), actualName, "package.json");
|
|
519
|
-
let pkg: { name: string
|
|
520
|
+
let pkg: PluginPackageJson & { name: string };
|
|
520
521
|
try {
|
|
521
522
|
pkg = await Bun.file(pkgPath).json();
|
|
522
523
|
} catch (err) {
|
|
@@ -525,7 +526,7 @@ export class PluginManager {
|
|
|
525
526
|
}
|
|
526
527
|
throw err;
|
|
527
528
|
}
|
|
528
|
-
const manifest: PluginManifest = pkg.
|
|
529
|
+
const manifest: PluginManifest = pkg.jeopi || pkg.pi || { version: pkg.version };
|
|
529
530
|
manifest.version = pkg.version;
|
|
530
531
|
|
|
531
532
|
// Resolve enabled features
|
|
@@ -644,14 +645,14 @@ export class PluginManager {
|
|
|
644
645
|
const pluginPath = path.join(getPluginsNodeModules(), name);
|
|
645
646
|
if (await this.#isMarketplaceRuntimeLink(name, deps, marketplaceRuntimeRealpaths, pluginPath)) continue;
|
|
646
647
|
const pluginPkgPath = path.join(pluginPath, "package.json");
|
|
647
|
-
let pluginPkg:
|
|
648
|
+
let pluginPkg: PluginPackageJson;
|
|
648
649
|
try {
|
|
649
650
|
pluginPkg = await Bun.file(pluginPkgPath).json();
|
|
650
651
|
} catch (err) {
|
|
651
652
|
if (isEnoent(err)) continue;
|
|
652
653
|
throw err;
|
|
653
654
|
}
|
|
654
|
-
const manifest: PluginManifest = pluginPkg.
|
|
655
|
+
const manifest: PluginManifest = pluginPkg.jeopi || pluginPkg.pi || { version: pluginPkg.version };
|
|
655
656
|
manifest.version = pluginPkg.version;
|
|
656
657
|
|
|
657
658
|
const runtimeState = config.plugins[name] || {
|
|
@@ -683,7 +684,7 @@ export class PluginManager {
|
|
|
683
684
|
const absolutePath = path.resolve(this.#cwd, localPath);
|
|
684
685
|
|
|
685
686
|
const pkgFilePath = path.join(absolutePath, "package.json");
|
|
686
|
-
let pkg:
|
|
687
|
+
let pkg: PluginPackageJson;
|
|
687
688
|
try {
|
|
688
689
|
pkg = await Bun.file(pkgFilePath).json();
|
|
689
690
|
} catch (err) {
|
|
@@ -716,7 +717,7 @@ export class PluginManager {
|
|
|
716
717
|
|
|
717
718
|
await fs.promises.symlink(absolutePath, linkPath);
|
|
718
719
|
|
|
719
|
-
const manifest: PluginManifest = pkg.
|
|
720
|
+
const manifest: PluginManifest = pkg.jeopi || pkg.pi || { version: pkg.version };
|
|
720
721
|
manifest.version = pkg.version;
|
|
721
722
|
|
|
722
723
|
// Add to runtime config
|
|
@@ -895,7 +896,7 @@ export class PluginManager {
|
|
|
895
896
|
const pluginPkgPath = path.join(pluginPath, "package.json");
|
|
896
897
|
const fromDependencies = name in deps;
|
|
897
898
|
|
|
898
|
-
let pluginPkg:
|
|
899
|
+
let pluginPkg: PluginPackageJson;
|
|
899
900
|
try {
|
|
900
901
|
pluginPkg = await Bun.file(pluginPkgPath).json();
|
|
901
902
|
} catch (err) {
|
|
@@ -929,8 +930,8 @@ export class PluginManager {
|
|
|
929
930
|
}
|
|
930
931
|
throw err;
|
|
931
932
|
}
|
|
932
|
-
const hasManifest = !!(pluginPkg.
|
|
933
|
-
const manifest: PluginManifest | undefined = pluginPkg.
|
|
933
|
+
const hasManifest = !!(pluginPkg.jeopi || pluginPkg.pi);
|
|
934
|
+
const manifest: PluginManifest | undefined = pluginPkg.jeopi || pluginPkg.pi;
|
|
934
935
|
|
|
935
936
|
checks.push({
|
|
936
937
|
name: `plugin:${name}`,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// =============================================================================
|
|
2
|
-
// Plugin Manifest Types (from package.json
|
|
2
|
+
// Plugin Manifest Types (from package.json jeopi/pi field)
|
|
3
3
|
// =============================================================================
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -22,7 +22,7 @@ export interface PluginFeature {
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
|
-
* Plugin manifest from package.json
|
|
25
|
+
* Plugin manifest from package.json jeopi or pi field.
|
|
26
26
|
*/
|
|
27
27
|
export interface PluginManifest {
|
|
28
28
|
/** Plugin display name (defaults to package name) */
|
|
@@ -48,6 +48,17 @@ export interface PluginManifest {
|
|
|
48
48
|
settings?: Record<string, PluginSettingSchema>;
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
+
/**
|
|
52
|
+
* Minimal package.json shape needed when discovering plugin manifests.
|
|
53
|
+
*/
|
|
54
|
+
export interface PluginPackageJson {
|
|
55
|
+
name?: string;
|
|
56
|
+
version: string;
|
|
57
|
+
description?: string;
|
|
58
|
+
jeopi?: PluginManifest;
|
|
59
|
+
pi?: PluginManifest;
|
|
60
|
+
}
|
|
61
|
+
|
|
51
62
|
// =============================================================================
|
|
52
63
|
// Plugin Settings Schema Types
|
|
53
64
|
// =============================================================================
|
|
@@ -106,7 +117,7 @@ export interface InstalledPlugin {
|
|
|
106
117
|
version: string;
|
|
107
118
|
/** Absolute path to package directory */
|
|
108
119
|
path: string;
|
|
109
|
-
/** Parsed
|
|
120
|
+
/** Parsed jeopi/pi manifest */
|
|
110
121
|
manifest: PluginManifest;
|
|
111
122
|
/**
|
|
112
123
|
* Enabled features:
|
|
@@ -150,7 +161,7 @@ export interface PluginRuntimeConfig {
|
|
|
150
161
|
// =============================================================================
|
|
151
162
|
|
|
152
163
|
/**
|
|
153
|
-
* Project-local plugin overrides (stored in .
|
|
164
|
+
* Project-local plugin overrides (stored in .jeopi/plugin-overrides.json).
|
|
154
165
|
* Allows per-project plugin configuration without modifying global state.
|
|
155
166
|
*/
|
|
156
167
|
export interface ProjectPluginOverrides {
|