@stigmer/cli 3.15.3-dev.20260916211208 → 3.16.1-dev.20260917224426
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/commands/agent-exec-flags.d.ts +2 -5
- package/commands/agent-exec-flags.d.ts.map +1 -1
- package/commands/agent-exec-flags.js +6 -13
- package/commands/agent-exec-flags.js.map +1 -1
- package/commands/connect.js +1 -1
- package/commands/connect.js.map +1 -1
- package/commands/install.d.ts +3 -0
- package/commands/install.d.ts.map +1 -0
- package/commands/install.js +68 -0
- package/commands/install.js.map +1 -0
- package/commands/marketplace.d.ts +3 -0
- package/commands/marketplace.d.ts.map +1 -0
- package/commands/marketplace.js +94 -0
- package/commands/marketplace.js.map +1 -0
- package/commands/push.js +2 -7
- package/commands/push.js.map +1 -1
- package/commands/run.js +0 -3
- package/commands/run.js.map +1 -1
- package/config/config.d.ts +19 -0
- package/config/config.d.ts.map +1 -1
- package/config/config.js +15 -0
- package/config/config.js.map +1 -1
- package/config/index.d.ts +1 -1
- package/config/index.d.ts.map +1 -1
- package/config/index.js.map +1 -1
- package/local/bootstrap.d.ts +21 -0
- package/local/bootstrap.d.ts.map +1 -0
- package/local/bootstrap.js +88 -0
- package/local/bootstrap.js.map +1 -0
- package/local/daemon/launch.d.ts +2 -2
- package/local/daemon/launch.d.ts.map +1 -1
- package/local/daemon/launch.js +4 -34
- package/local/daemon/launch.js.map +1 -1
- package/local/daemon/process.d.ts +1 -1
- package/local/plugins/defaults.d.ts +35 -0
- package/local/plugins/defaults.d.ts.map +1 -0
- package/local/plugins/defaults.js +83 -0
- package/local/plugins/defaults.js.map +1 -0
- package/local/seedpack/content.d.ts +2 -1
- package/local/seedpack/content.d.ts.map +1 -1
- package/local/seedpack/content.js +5 -34
- package/local/seedpack/content.js.map +1 -1
- package/marketplace/config.d.ts +59 -0
- package/marketplace/config.d.ts.map +1 -0
- package/marketplace/config.js +162 -0
- package/marketplace/config.js.map +1 -0
- package/marketplace/github.d.ts +31 -0
- package/marketplace/github.d.ts.map +1 -0
- package/marketplace/github.js +203 -0
- package/marketplace/github.js.map +1 -0
- package/marketplace/index.d.ts +8 -0
- package/marketplace/index.d.ts.map +1 -0
- package/marketplace/index.js +12 -0
- package/marketplace/index.js.map +1 -0
- package/marketplace/install.d.ts +28 -0
- package/marketplace/install.d.ts.map +1 -0
- package/marketplace/install.js +109 -0
- package/marketplace/install.js.map +1 -0
- package/marketplace/materialize.d.ts +19 -0
- package/marketplace/materialize.d.ts.map +1 -0
- package/marketplace/materialize.js +53 -0
- package/marketplace/materialize.js.map +1 -0
- package/marketplace/official.d.ts +28 -0
- package/marketplace/official.d.ts.map +1 -0
- package/marketplace/official.js +86 -0
- package/marketplace/official.js.map +1 -0
- package/marketplace/read.d.ts +17 -0
- package/marketplace/read.d.ts.map +1 -0
- package/marketplace/read.js +44 -0
- package/marketplace/read.js.map +1 -0
- package/marketplace/ref.d.ts +13 -0
- package/marketplace/ref.d.ts.map +1 -0
- package/marketplace/ref.js +54 -0
- package/marketplace/ref.js.map +1 -0
- package/marketplace/render.d.ts +22 -0
- package/marketplace/render.d.ts.map +1 -0
- package/marketplace/render.js +118 -0
- package/marketplace/render.js.map +1 -0
- package/output/ndjson.js +1 -1
- package/output/ndjson.js.map +1 -1
- package/package.json +7 -6
- package/program.d.ts.map +1 -1
- package/program.js +4 -2
- package/program.js.map +1 -1
- package/resources/ignore/index.d.ts +2 -4
- package/resources/ignore/index.d.ts.map +1 -1
- package/resources/ignore/index.js +5 -5
- package/resources/ignore/index.js.map +1 -1
- package/resources/ignore/matcher.d.ts +2 -35
- package/resources/ignore/matcher.d.ts.map +1 -1
- package/resources/ignore/matcher.js +25 -109
- package/resources/ignore/matcher.js.map +1 -1
- package/resources/plugin.d.ts +50 -18
- package/resources/plugin.d.ts.map +1 -1
- package/resources/plugin.js +73 -74
- package/resources/plugin.js.map +1 -1
- package/resources/run/agent-exec.js +1 -1
- package/resources/run/agent-exec.js.map +1 -1
- package/resources/run/prepare.d.ts +8 -19
- package/resources/run/prepare.d.ts.map +1 -1
- package/resources/run/prepare.js +4 -4
- package/resources/run/prepare.js.map +1 -1
- package/resources/skill.d.ts +2 -2
- package/resources/skill.d.ts.map +1 -1
- package/resources/skill.js +6 -10
- package/resources/skill.js.map +1 -1
- package/src/commands/agent-exec-flags.ts +6 -12
- package/src/commands/connect.ts +1 -1
- package/src/commands/install.test.ts +289 -0
- package/src/commands/install.ts +108 -0
- package/src/commands/marketplace.test.ts +200 -0
- package/src/commands/marketplace.ts +131 -0
- package/src/commands/push.ts +5 -10
- package/src/commands/run.ts +0 -3
- package/src/config/config.ts +37 -0
- package/src/config/index.ts +1 -0
- package/src/local/bootstrap.test.ts +71 -0
- package/src/local/bootstrap.ts +133 -0
- package/src/local/daemon/launch.ts +5 -40
- package/src/local/daemon/process.ts +1 -1
- package/src/local/plugins/defaults.test.ts +238 -0
- package/src/local/plugins/defaults.ts +135 -0
- package/src/local/seedpack/content.ts +11 -42
- package/src/marketplace/__fixtures__/cursor-marketplace.ts +62 -0
- package/src/marketplace/config.test.ts +245 -0
- package/src/marketplace/config.ts +236 -0
- package/src/marketplace/github.test.ts +318 -0
- package/src/marketplace/github.ts +296 -0
- package/src/marketplace/index.ts +54 -0
- package/src/marketplace/install.test.ts +194 -0
- package/src/marketplace/install.ts +159 -0
- package/src/marketplace/materialize.ts +80 -0
- package/src/marketplace/official.test.ts +107 -0
- package/src/marketplace/official.ts +125 -0
- package/src/marketplace/read.test.ts +94 -0
- package/src/marketplace/read.ts +76 -0
- package/src/marketplace/ref.test.ts +179 -0
- package/src/marketplace/ref.ts +74 -0
- package/src/marketplace/render.ts +154 -0
- package/src/output/ndjson.ts +1 -1
- package/src/program.test.ts +4 -13
- package/src/program.ts +4 -2
- package/src/resources/ignore/ignore.test.ts +23 -100
- package/src/resources/ignore/index.ts +11 -8
- package/src/resources/ignore/matcher.ts +33 -136
- package/src/resources/plugin.test.ts +35 -6
- package/src/resources/plugin.ts +132 -85
- package/src/resources/run/agent-exec.ts +1 -1
- package/src/resources/run/prepare.test.ts +4 -18
- package/src/resources/run/prepare.ts +12 -24
- package/src/resources/skill.ts +6 -10
- package/commands/draft.d.ts +0 -3
- package/commands/draft.d.ts.map +0 -1
- package/commands/draft.js +0 -115
- package/commands/draft.js.map +0 -1
- package/resources/ignore/defaults.d.ts +0 -2
- package/resources/ignore/defaults.d.ts.map +0 -1
- package/resources/ignore/defaults.js +0 -140
- package/resources/ignore/defaults.js.map +0 -1
- package/resources/ignore/match.d.ts +0 -3
- package/resources/ignore/match.d.ts.map +0 -1
- package/resources/ignore/match.js +0 -166
- package/resources/ignore/match.js.map +0 -1
- package/resources/ignore/pattern.d.ts +0 -13
- package/resources/ignore/pattern.d.ts.map +0 -1
- package/resources/ignore/pattern.js +0 -118
- package/resources/ignore/pattern.js.map +0 -1
- package/src/commands/draft.ts +0 -189
- package/src/resources/ignore/defaults.ts +0 -155
- package/src/resources/ignore/match.ts +0 -158
- package/src/resources/ignore/pattern.ts +0 -131
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
// Every marketplace source becomes a directory, and every directory is read by
|
|
2
|
+
// the one plugin walker. This module is where a source turns into that
|
|
3
|
+
// directory and where the directory's lifetime is owned: a local path is used
|
|
4
|
+
// where it is; the official tree is resolved or acquired; a GitHub zipball is
|
|
5
|
+
// extracted under a temp directory that `dispose` removes. One owner for the
|
|
6
|
+
// lifetime means `add`, `show` and `install` cannot leak a temp tree between
|
|
7
|
+
// them, whatever path an error takes.
|
|
8
|
+
import { mkdtempSync, rmSync } from "node:fs";
|
|
9
|
+
import { tmpdir } from "node:os";
|
|
10
|
+
import { join } from "node:path";
|
|
11
|
+
import { fetchGitHubTree } from "./github.js";
|
|
12
|
+
import { resolveOfficialMarketplace, } from "./official.js";
|
|
13
|
+
export async function openMarketplace(source, options = {}) {
|
|
14
|
+
switch (source.type) {
|
|
15
|
+
case "local":
|
|
16
|
+
return { root: source.path, dispose: () => { } };
|
|
17
|
+
case "official":
|
|
18
|
+
return {
|
|
19
|
+
root: resolveOfficialMarketplace(options.official).dir,
|
|
20
|
+
dispose: () => { },
|
|
21
|
+
};
|
|
22
|
+
case "github": {
|
|
23
|
+
const root = mkdtempSync(join(tmpdir(), "stigmer-marketplace-"));
|
|
24
|
+
const dispose = () => rmSync(root, { recursive: true, force: true });
|
|
25
|
+
try {
|
|
26
|
+
await fetchGitHubTree(source, {
|
|
27
|
+
destDir: root,
|
|
28
|
+
fetchImpl: options.fetchImpl,
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
catch (error) {
|
|
32
|
+
dispose();
|
|
33
|
+
throw error;
|
|
34
|
+
}
|
|
35
|
+
return { root, dispose };
|
|
36
|
+
}
|
|
37
|
+
default: {
|
|
38
|
+
const exhaustive = source;
|
|
39
|
+
return exhaustive;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
/** Open, hand the tree to `use`, and dispose whatever the outcome. */
|
|
44
|
+
export async function withMarketplace(source, use, options = {}) {
|
|
45
|
+
const open = await openMarketplace(source, options);
|
|
46
|
+
try {
|
|
47
|
+
return await use(open);
|
|
48
|
+
}
|
|
49
|
+
finally {
|
|
50
|
+
open.dispose();
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=materialize.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"materialize.js","sourceRoot":"","sources":["../../src/marketplace/materialize.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,uEAAuE;AACvE,8EAA8E;AAC9E,8EAA8E;AAC9E,6EAA6E;AAC7E,6EAA6E;AAC7E,sCAAsC;AAEtC,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,eAAe,EAAE,MAAM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AEpC,MAAM,IAAI,GAAG,MAAM,eAAe,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACpD,IAAI,CAAC;QACH,OAAO,MAAM,GAAG,CAAC,IAAI,CAAC,CAAC;IACzB,CAAC;YAAS,CAAC;QACT,IAAI,CAAC,OAAO,EAAE,CAAC;IACjB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { type NpmInstall } from "../local/runtime/runtimes-install.js";
|
|
2
|
+
export interface OfficialMarketplaceDir {
|
|
3
|
+
/** Absolute path to the tree root (holds `marketplace.json`). */
|
|
4
|
+
readonly dir: string;
|
|
5
|
+
/** Where the tree came from, for diagnostics. */
|
|
6
|
+
readonly source: "repo" | "package";
|
|
7
|
+
}
|
|
8
|
+
export interface ResolveOfficialOptions {
|
|
9
|
+
home?: string;
|
|
10
|
+
/** Release version of `@stigmer/plugins` to acquire (defaults to the CLI version). */
|
|
11
|
+
version?: string;
|
|
12
|
+
/** npm install implementation (injectable for tests). */
|
|
13
|
+
install?: NpmInstall;
|
|
14
|
+
/** The repo-tree probe (injectable for tests; the default walks up from this module). */
|
|
15
|
+
repoDir?: () => string | null;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* The official marketplace's directory: a repo-tree checkout in dev, else the
|
|
19
|
+
* on-demand-acquired package. Throws actionable guidance when acquisition is
|
|
20
|
+
* not possible (a non-release build with no checkout, a failed install).
|
|
21
|
+
*/
|
|
22
|
+
export declare function resolveOfficialMarketplace(opts?: ResolveOfficialOptions): OfficialMarketplaceDir;
|
|
23
|
+
/**
|
|
24
|
+
* Acquire `@stigmer/plugins@<version>` into ~/.stigmer/runtimes/<version>/
|
|
25
|
+
* (idempotent) and return the package directory, which is the tree root.
|
|
26
|
+
*/
|
|
27
|
+
export declare function acquireOfficialMarketplace(opts?: ResolveOfficialOptions): string;
|
|
28
|
+
//# sourceMappingURL=official.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"official.d.ts","sourceRoot":"","sources":["../../src/marketplace/official.ts"],"names":[],"mappings":"AA6BA,OAAO,EAIL,KAAK,UAAU,EAChB,MAAM,sCAAsC,CAAC;AAQ9C,MAAM,WAAW,sBAAsB;IACrC,iEAAiE;IACjE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,iDAAiD;IACjD,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;CACrC;AAED,MAAM,WAAW,sBAAsB;IACrC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,sFAAsF;IACtF,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,yDAAyD;IACzD,OAAO,CAAC,EAAE,UAAU,CAAC;IACrB,yFAAyF;IACzF,OAAO,CAAC,EAAE,MAAM,MAAM,GAAG,IAAI,CAAC;CAC/B;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CACxC,IAAI,GAAE,sBAA2B,GAChC,sBAAsB,CAIxB;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,CACxC,IAAI,GAAE,sBAA2B,GAChC,MAAM,CAiCR"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
// Resolution and on-demand acquisition of the official marketplace.
|
|
2
|
+
//
|
|
3
|
+
// The official catalogue (`plugins/` in the OSS repository, published as
|
|
4
|
+
// `@stigmer/plugins`) is the content `stigmer up` bootstraps a backend with,
|
|
5
|
+
// so it follows the seedpack's rule: acquired at the CLI's OWN version, so
|
|
6
|
+
// the plugins a fresh install gets match the control plane that installs
|
|
7
|
+
// them. A lean `npx @stigmer/cli` does not carry the content; it is fetched
|
|
8
|
+
// once into ~/.stigmer/runtimes/<version>/ like the server and the runner.
|
|
9
|
+
//
|
|
10
|
+
// Two sources, tried in order (mirrors runtime/server.ts and the seedpack):
|
|
11
|
+
// 1. A repo-tree checkout (dev): `<repo>/plugins`, the tree itself.
|
|
12
|
+
// 2. The published `@stigmer/plugins@<cli-version>`, whose package root IS
|
|
13
|
+
// the marketplace tree (`publish-libs.mjs` publishes from `dist/`, where
|
|
14
|
+
// `stage-content.mjs` placed `marketplace.json` and every listed plugin).
|
|
15
|
+
//
|
|
16
|
+
// Presence beats acquirability (the server acquirer's rule): installed content
|
|
17
|
+
// is used whatever its version string; only an install we would have to
|
|
18
|
+
// perform is refused for a non-release build. The all-in-one image relies on
|
|
19
|
+
// this: it bakes the package at a dev-stamped version npm never published.
|
|
20
|
+
import { existsSync } from "node:fs";
|
|
21
|
+
import { homedir } from "node:os";
|
|
22
|
+
import { dirname, join } from "node:path";
|
|
23
|
+
import { fileURLToPath } from "node:url";
|
|
24
|
+
import { MARKETPLACE_LOCATIONS } from "@stigmer/plugin-package";
|
|
25
|
+
import { CliExitError } from "../errors/cli-exit-error.js";
|
|
26
|
+
import { ExitCode } from "../errors/exit-codes.js";
|
|
27
|
+
import { log } from "../logger.js";
|
|
28
|
+
import { runtimesDir } from "../local/paths.js";
|
|
29
|
+
import { ensureRuntimesRoot, isAcquirableRelease, npmInstallIntoRuntimes, } from "../local/runtime/runtimes-install.js";
|
|
30
|
+
import { VERSION } from "../version.js";
|
|
31
|
+
const PLUGINS_PACKAGE = "@stigmer/plugins";
|
|
32
|
+
/** The file that makes a directory the official tree: Stigmer's own marketplace dialect at the root. */
|
|
33
|
+
const OFFICIAL_MARKER = MARKETPLACE_LOCATIONS.stigmer;
|
|
34
|
+
/**
|
|
35
|
+
* The official marketplace's directory: a repo-tree checkout in dev, else the
|
|
36
|
+
* on-demand-acquired package. Throws actionable guidance when acquisition is
|
|
37
|
+
* not possible (a non-release build with no checkout, a failed install).
|
|
38
|
+
*/
|
|
39
|
+
export function resolveOfficialMarketplace(opts = {}) {
|
|
40
|
+
const repo = (opts.repoDir ?? repoPluginsDir)();
|
|
41
|
+
if (repo !== null)
|
|
42
|
+
return { dir: repo, source: "repo" };
|
|
43
|
+
return { dir: acquireOfficialMarketplace(opts), source: "package" };
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Acquire `@stigmer/plugins@<version>` into ~/.stigmer/runtimes/<version>/
|
|
47
|
+
* (idempotent) and return the package directory, which is the tree root.
|
|
48
|
+
*/
|
|
49
|
+
export function acquireOfficialMarketplace(opts = {}) {
|
|
50
|
+
const home = opts.home ?? homedir();
|
|
51
|
+
const version = opts.version ?? VERSION;
|
|
52
|
+
const installDir = join(runtimesDir(home), version);
|
|
53
|
+
const pkgDir = join(installDir, "node_modules", "@stigmer", "plugins");
|
|
54
|
+
const marker = join(pkgDir, OFFICIAL_MARKER);
|
|
55
|
+
if (!existsSync(marker)) {
|
|
56
|
+
if (!isAcquirableRelease(version)) {
|
|
57
|
+
throw new CliExitError(`cannot acquire ${PLUGINS_PACKAGE} for a non-release build (${version})`, ExitCode.General, [
|
|
58
|
+
"Run from the repo (the plugins/ tree is used directly in dev).",
|
|
59
|
+
"On-demand acquisition is only available for published releases.",
|
|
60
|
+
]);
|
|
61
|
+
}
|
|
62
|
+
log.info(`acquiring ${PLUGINS_PACKAGE}`, { version, dir: installDir });
|
|
63
|
+
ensureRuntimesRoot(installDir);
|
|
64
|
+
const install = opts.install ?? npmInstallIntoRuntimes;
|
|
65
|
+
install(installDir, `${PLUGINS_PACKAGE}@${version}`);
|
|
66
|
+
}
|
|
67
|
+
if (!existsSync(marker)) {
|
|
68
|
+
throw new CliExitError(`${PLUGINS_PACKAGE} install did not produce ${marker}`, ExitCode.General, [`Remove ${installDir} and retry.`]);
|
|
69
|
+
}
|
|
70
|
+
return pkgDir;
|
|
71
|
+
}
|
|
72
|
+
// Walk up from this module to a repo root whose plugins/ holds the marker.
|
|
73
|
+
function repoPluginsDir() {
|
|
74
|
+
let dir = dirname(fileURLToPath(import.meta.url));
|
|
75
|
+
for (let i = 0; i < 10; i += 1) {
|
|
76
|
+
const candidate = join(dir, "plugins");
|
|
77
|
+
if (existsSync(join(candidate, OFFICIAL_MARKER)))
|
|
78
|
+
return candidate;
|
|
79
|
+
const parent = dirname(dir);
|
|
80
|
+
if (parent === dir)
|
|
81
|
+
break;
|
|
82
|
+
dir = parent;
|
|
83
|
+
}
|
|
84
|
+
return null;
|
|
85
|
+
}
|
|
86
|
+
//# sourceMappingURL=official.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"official.js","sourceRoot":"","sources":["../../src/marketplace/official.ts"],"names":[],"mappings":"AAAA,oEAAoE;AACpE,EAAE;AACF,yEAAyE;AACzE,6EAA6E;AAC7E,2EAA2E;AAC3E,yEAAyE;AACzE,4EAA4E;AAC5E,2EAA2E;AAC3E,EAAE;AACF,4EAA4E;AAC5E,sEAAsE;AACtE,6EAA6E;AAC7E,8EAA8E;AAC9E,+EAA+E;AAC/E,EAAE;AACF,+EAA+E;AAC/E,wEAAwE;AACxE,6EAA6E;AAC7E,2EAA2E;AAE3E,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,sBAAsB,GAEvB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,MAAM,eAAe,GAAG,kBAAkB,CAAC;AAE3C,wGAAwG;AACxG,MAAM,eAAe,GAAG,qBAAqB,CAAC,OAAO,CAAC;AAmBtD;;;;GAIG;AACH,MAAM,UAAU,0BAA0B,CACxC,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GAAG,eAAe,IAAI,OAAO,EAAE,CAAC,CAAC;IACvD,CAAC;IAED,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC;QACxB,MAAM,IAAI,YAAY,CACpB,GAAG,eAAe,4BAA4B,MAAM,EAAE,EACtD,QAAQ,CAAC,OAAO,EAChB,CAAC,UAAU,UAAU,aAAa,CAAC,CACpC,CAAC;IACJ,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,2EAA2E;AAC3E,SAAS,cAAc;IACrB,IAAI,GAAG,GAAG,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;IAClD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;QAC/B,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;QACvC,IAAI,UAAU,CAAC,IAAI,CAAC,SAAS,EAAE,eAAe,CAAC,CAAC;YAAE,OAAO,SAAS,CAAC;QACnE,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;QAC5B,IAAI,MAAM,KAAK,GAAG;YAAE,MAAM;QAC1B,GAAG,GAAG,MAAM,CAAC;IACf,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type Marketplace, type MarketplaceEntry, type MarketplaceFinding } from "@stigmer/plugin-package";
|
|
2
|
+
import { UsageError } from "../errors/index.js";
|
|
3
|
+
export interface ReadMarketplaceTree {
|
|
4
|
+
readonly root: string;
|
|
5
|
+
readonly marketplace: Marketplace;
|
|
6
|
+
/** The library's warnings: entries dropped, each with its own sentence. */
|
|
7
|
+
readonly warnings: readonly MarketplaceFinding[];
|
|
8
|
+
}
|
|
9
|
+
/** Read the tree at `root`; a marketplace the library refuses throws with every problem named. */
|
|
10
|
+
export declare function readMarketplaceTree(root: string, describe?: string): ReadMarketplaceTree;
|
|
11
|
+
/** The library's refusal as the CLI's one UsageError: every problem, then every warning. */
|
|
12
|
+
export declare function marketplaceRefusal(describe: string, errors: readonly MarketplaceFinding[], warnings: readonly MarketplaceFinding[]): UsageError;
|
|
13
|
+
/** The offered entry called `name`, or `undefined`. */
|
|
14
|
+
export declare function findEntry(marketplace: Marketplace, name: string): MarketplaceEntry | undefined;
|
|
15
|
+
/** The absolute directory of an offered entry: what the plugin walker reads next. */
|
|
16
|
+
export declare function entryDirectory(tree: ReadMarketplaceTree, entry: MarketplaceEntry): string;
|
|
17
|
+
//# sourceMappingURL=read.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"read.d.ts","sourceRoot":"","sources":["../../src/marketplace/read.ts"],"names":[],"mappings":"AAYA,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EAExB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAGhD,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC;IAClC,2EAA2E;IAC3E,QAAQ,CAAC,QAAQ,EAAE,SAAS,kBAAkB,EAAE,CAAC;CAClD;AAED,kGAAkG;AAClG,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,MAAM,EACZ,QAAQ,GAAE,MAAa,GACtB,mBAAmB,CAMrB;AAED,4FAA4F;AAC5F,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,SAAS,kBAAkB,EAAE,EACrC,QAAQ,EAAE,SAAS,kBAAkB,EAAE,GACtC,UAAU,CAYZ;AAED,uDAAuD;AACvD,wBAAgB,SAAS,CACvB,WAAW,EAAE,WAAW,EACxB,IAAI,EAAE,MAAM,GACX,gBAAgB,GAAG,SAAS,CAE9B;AAED,qFAAqF;AACrF,wBAAgB,cAAc,CAC5B,IAAI,EAAE,mBAAmB,EACzB,KAAK,EAAE,gBAAgB,GACtB,MAAM,CAIR"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
// A marketplace tree on disk, read into the library's one shape.
|
|
2
|
+
//
|
|
3
|
+
// `@stigmer/plugin-package` is pure over a `PluginFiles`; the CLI feeds it
|
|
4
|
+
// the same gitignore-aware walk `push plugin` uses (`readPluginDirectory`),
|
|
5
|
+
// rooted at the marketplace tree, so what `show` lists is what the tree
|
|
6
|
+
// holds after the ignore rules that would apply to a push from it. The
|
|
7
|
+
// library's refusal (a broken marketplace FILE) becomes one `UsageError`
|
|
8
|
+
// with every sentence, the shape `pluginRefusal` prints for a plugin; its
|
|
9
|
+
// warnings (entries the tree cannot offer) travel with the marketplace so
|
|
10
|
+
// `show` can say why an entry is missing.
|
|
11
|
+
import { join } from "node:path";
|
|
12
|
+
import { readMarketplace, } from "@stigmer/plugin-package";
|
|
13
|
+
import { UsageError } from "../errors/index.js";
|
|
14
|
+
import { count, readPluginDirectory } from "../resources/plugin.js";
|
|
15
|
+
/** Read the tree at `root`; a marketplace the library refuses throws with every problem named. */
|
|
16
|
+
export function readMarketplaceTree(root, describe = root) {
|
|
17
|
+
const directory = readPluginDirectory(root);
|
|
18
|
+
const outcome = readMarketplace(directory.files);
|
|
19
|
+
if (!outcome.ok)
|
|
20
|
+
throw marketplaceRefusal(describe, outcome.errors, outcome.warnings);
|
|
21
|
+
return { root, marketplace: outcome.marketplace, warnings: outcome.warnings };
|
|
22
|
+
}
|
|
23
|
+
/** The library's refusal as the CLI's one UsageError: every problem, then every warning. */
|
|
24
|
+
export function marketplaceRefusal(describe, errors, warnings) {
|
|
25
|
+
const lines = [
|
|
26
|
+
`${describe}: not a marketplace this CLI can read, ${count(errors.length, "problem")} found:`,
|
|
27
|
+
...errors.map((finding) => ` - ${finding.message}`),
|
|
28
|
+
];
|
|
29
|
+
if (warnings.length > 0) {
|
|
30
|
+
lines.push(`and ${count(warnings.length, "warning")}:`, ...warnings.map((finding) => ` - ${finding.message}`));
|
|
31
|
+
}
|
|
32
|
+
return new UsageError(lines.join("\n"));
|
|
33
|
+
}
|
|
34
|
+
/** The offered entry called `name`, or `undefined`. */
|
|
35
|
+
export function findEntry(marketplace, name) {
|
|
36
|
+
return marketplace.plugins.find((entry) => entry.name === name);
|
|
37
|
+
}
|
|
38
|
+
/** The absolute directory of an offered entry: what the plugin walker reads next. */
|
|
39
|
+
export function entryDirectory(tree, entry) {
|
|
40
|
+
return entry.dir === ""
|
|
41
|
+
? tree.root
|
|
42
|
+
: join(tree.root, ...entry.dir.split("/"));
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=read.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"read.js","sourceRoot":"","sources":["../../src/marketplace/read.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,EAAE;AACF,2EAA2E;AAC3E,4EAA4E;AAC5E,wEAAwE;AACxE,uEAAuE;AACvE,yEAAyE;AACzE,0EAA0E;AAC1E,0EAA0E;AAC1E,0CAA0C;AAE1C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAIL,eAAe,GAChB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,KAAK,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AASpE,kGAAkG;AAClG,MAAM,UAAU,mBAAmB,CACjC,IAAY,EACZ,WAAmB,IAAI;IAEvB,MAAM,SAAS,GAAG,mBAAmB,CAAC,IAAI,CAAC,CAAC;IAC5C,MAAM,OAAO,GAAG,eAAe,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IACjD,IAAI,CAAC,OAAO,CAAC,EAAE;QACb,MAAM,kBAAkB,CAAC,QAAQ,EAAE,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,QA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AK,CAAC,GAAG,CAAC,CAAC,CAAC;AAC/C,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type InstallRef, formatInstallRef } from "@stigmer/plugin-package/client";
|
|
2
|
+
import { type MarketplaceSource } from "./config.js";
|
|
3
|
+
export { type InstallRef, formatInstallRef };
|
|
4
|
+
export declare function parseInstallRef(text: string): InstallRef;
|
|
5
|
+
/**
|
|
6
|
+
* What `marketplace add <source>` was given, as a source. An existing
|
|
7
|
+
* directory wins over every other reading; otherwise the shared GitHub
|
|
8
|
+
* grammar decides, and what it refuses is refused here with the shape.
|
|
9
|
+
*/
|
|
10
|
+
export declare function parseAddSource(text: string, cwd?: string): Exclude<MarketplaceSource, {
|
|
11
|
+
type: "official";
|
|
12
|
+
}>;
|
|
13
|
+
//# sourceMappingURL=ref.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ref.d.ts","sourceRoot":"","sources":["../../src/marketplace/ref.ts"],"names":[],"mappings":"AAcA,OAAO,EAGL,KAAK,UAAU,EACf,gBAAgB,EAIjB,MAAM,gCAAgC,CAAC;AAExC,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAErD,OAAO,EAAE,KAAK,UAAU,EAAE,gBAAgB,EAAE,CAAC;AAE7C,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,CASxD;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAC5B,IAAI,EAAE,MAAM,EACZ,GAAG,GAAE,MAAsB,GAC1B,OAAO,CAAC,iBAAiB,EAAE;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE,CAAC,CAgBlD"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
// The two grammars a user types at the marketplace surface, as the CLI's
|
|
2
|
+
// errors.
|
|
3
|
+
//
|
|
4
|
+
// The grammars themselves (`[marketplace/]name[@version]` and the GitHub
|
|
5
|
+
// `owner/repo[@ref]` or URL forms) live in `@stigmer/plugin-package/client`,
|
|
6
|
+
// where the console parses the same text and gets the same sentence. This
|
|
7
|
+
// module adds what only the CLI has: a `UsageError` carrying the sentence
|
|
8
|
+
// plus the paragraph naming the CLI command to run instead, and the reading
|
|
9
|
+
// of `marketplace add <source>` as a directory on this machine, which wins
|
|
10
|
+
// over every other reading (`add plugins` in a checkout means the folder,
|
|
11
|
+
// not a GitHub owner).
|
|
12
|
+
import { statSync } from "node:fs";
|
|
13
|
+
import { resolve } from "node:path";
|
|
14
|
+
import { GITHUB_SOURCE_SHAPE, INSTALL_REF_SHAPE, formatInstallRef, looksLikePath, parseGitHubSource, parseInstallRef as parseInstallRefText, } from "@stigmer/plugin-package/client";
|
|
15
|
+
import { UsageError } from "../errors/index.js";
|
|
16
|
+
export { formatInstallRef };
|
|
17
|
+
export function parseInstallRef(text) {
|
|
18
|
+
const outcome = parseInstallRefText(text);
|
|
19
|
+
if (outcome.ok)
|
|
20
|
+
return outcome.ref;
|
|
21
|
+
if (outcome.kind === "path") {
|
|
22
|
+
throw new UsageError(`${outcome.message}\n\nTo install a plugin from a folder, run: stigmer push plugin ${text}`);
|
|
23
|
+
}
|
|
24
|
+
throw new UsageError(`${outcome.message}\n\nA ref is ${INSTALL_REF_SHAPE}.`);
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* What `marketplace add <source>` was given, as a source. An existing
|
|
28
|
+
* directory wins over every other reading; otherwise the shared GitHub
|
|
29
|
+
* grammar decides, and what it refuses is refused here with the shape.
|
|
30
|
+
*/
|
|
31
|
+
export function parseAddSource(text, cwd = process.cwd()) {
|
|
32
|
+
if (text === "")
|
|
33
|
+
throw new UsageError(`a marketplace source is required\n\n${ADD_SHAPE}`);
|
|
34
|
+
const asDirectory = resolve(cwd, text);
|
|
35
|
+
if (isDirectory(asDirectory))
|
|
36
|
+
return { type: "local", path: asDirectory };
|
|
37
|
+
const github = parseGitHubSource(text);
|
|
38
|
+
if (github.ok)
|
|
39
|
+
return github.source;
|
|
40
|
+
if (looksLikePath(text) || text.includes("/")) {
|
|
41
|
+
throw new UsageError(`'${text}' is not a directory on this machine and not a GitHub 'owner/repo'\n\n${ADD_SHAPE}`);
|
|
42
|
+
}
|
|
43
|
+
throw new UsageError(`'${text}' is not a marketplace source\n\n${ADD_SHAPE}`);
|
|
44
|
+
}
|
|
45
|
+
const ADD_SHAPE = `A source is a directory holding a marketplace file, or ${GITHUB_SOURCE_SHAPE}.`;
|
|
46
|
+
function isDirectory(path) {
|
|
47
|
+
try {
|
|
48
|
+
return statSync(path).isDirectory();
|
|
49
|
+
}
|
|
50
|
+
catch {
|
|
51
|
+
return false;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=ref.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ref.js","sourceRoot":"","sources":["../../src/marketplace/ref.ts"],"names":[],"mappings":"AAAA,yEAAyE;AACzE,UAAU;AACV,EAAE;AACF,yEAAyE;AACzE,6EAA6E;AAC7E,0EAA0E;AAC1E,0EAA0E;AAC1E,4EAA4E;AAC5E,2EAA2E;AAC3E,0EAA0E;AAC1E,uBAAuB;AAEvB,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EAEjB,gBAAgB,EAChB,aAAa,EACb,iBAAiB,EACjB,eAAe,IAAI,mBAAmB,GACvC,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAGhD,OAAO,EAAmB,gBAAgB,EAAE,CAAC;AAE7C,MAAM,UAAU,eAAe,CAAC,IAAY;IAC1C,MAAM,OAAO,GAAG,mBAAmB,CAAC,IAAI,CAAC,CAAC;IAC1C,IAAI,OAAO,CAAC,EAAE;QAAE,OAAO,OAAO,CAAC,GAAG,CAAC;IACnC,IAAI,OAAO,CAAC,IAAI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 @@
|
|
|
1
|
+
import { CommandResult } from "../output/index.js";
|
|
2
|
+
import { type KnownMarketplace, type MarketplaceListing } from "./config.js";
|
|
3
|
+
import { type ReadMarketplaceTree } from "./read.js";
|
|
4
|
+
export declare function renderMarketplaceList(listing: MarketplaceListing): CommandResult;
|
|
5
|
+
/** One offered entry as `show` reports it, after its own manifest has been read. */
|
|
6
|
+
export interface ShownEntry {
|
|
7
|
+
readonly name: string;
|
|
8
|
+
readonly dir: string;
|
|
9
|
+
readonly version?: string;
|
|
10
|
+
readonly description?: string;
|
|
11
|
+
/** Set when the entry's own package refuses to read; `show` still lists it so the gap is visible. */
|
|
12
|
+
readonly problems?: number;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Read each offered entry's own package for its version and description.
|
|
16
|
+
* The marketplace file's description is a fallback (Stigmer's own catalogue
|
|
17
|
+
* carries none, so nothing is written twice); the plugin's manifest is the
|
|
18
|
+
* truth a user installs.
|
|
19
|
+
*/
|
|
20
|
+
export declare function inspectEntries(tree: ReadMarketplaceTree): ShownEntry[];
|
|
21
|
+
export declare function renderMarketplaceShow(marketplace: KnownMarketplace, tree: ReadMarketplaceTree, entries: readonly ShownEntry[]): CommandResult;
|
|
22
|
+
//# sourceMappingURL=render.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../src/marketplace/render.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EAExB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,KAAK,mBAAmB,EAAkB,MAAM,WAAW,CAAC;AAErE,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,kBAAkB,GAC1B,aAAa,CA6Bf;AAED,oFAAoF;AACpF,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,qGAAqG;IACrG,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,mBAAmB,GAAG,UAAU,EAAE,CAyBtE;AAED,wBAAgB,qBAAqB,CACnC,WAAW,EAAE,gBAAgB,EAC7B,IAAI,EAAE,mBAAmB,EACzB,OAAO,EAAE,SAAS,UAAU,EAAE,GAC7B,aAAa,CAyDf"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
// What `stigmer marketplace list` and `show` print, as `CommandResult`s: the
|
|
2
|
+
// human form on stderr, the same facts as `data` on stdout under `--json`.
|
|
3
|
+
// The marketplace group renders the way `config backend list` does (a
|
|
4
|
+
// mutating-class result rather than a read-verb table) because it is the
|
|
5
|
+
// same kind of thing: client-side configuration, not a server collection.
|
|
6
|
+
import { readPluginPackage } from "@stigmer/plugin-package";
|
|
7
|
+
import { CommandResult } from "../output/index.js";
|
|
8
|
+
import { count, readPluginDirectory } from "../resources/plugin.js";
|
|
9
|
+
import { describeSource, } from "./config.js";
|
|
10
|
+
import { entryDirectory } from "./read.js";
|
|
11
|
+
export function renderMarketplaceList(listing) {
|
|
12
|
+
const total = listing.known.length + listing.unreadable.length;
|
|
13
|
+
const result = listing.unreadable.length === 0
|
|
14
|
+
? CommandResult.success(`${count(total, "marketplace")} configured`)
|
|
15
|
+
: CommandResult.warning(`${count(total, "marketplace")} configured, ${count(listing.unreadable.length, "entry")} this CLI cannot read`);
|
|
16
|
+
const section = result.addSection("Marketplaces");
|
|
17
|
+
for (const marketplace of listing.known) {
|
|
18
|
+
section.field(marketplace.name, describeSource(marketplace.source));
|
|
19
|
+
}
|
|
20
|
+
for (const marketplace of listing.unreadable) {
|
|
21
|
+
section.field(marketplace.name, `cannot be read: ${marketplace.reason}`);
|
|
22
|
+
}
|
|
23
|
+
result.hint("Show what one offers with: stigmer marketplace show <name>");
|
|
24
|
+
result.hint("Install from one with: stigmer install [<name>/]<plugin>");
|
|
25
|
+
return result.withData({
|
|
26
|
+
marketplaces: [
|
|
27
|
+
...listing.known.map((marketplace) => ({
|
|
28
|
+
name: marketplace.name,
|
|
29
|
+
source: marketplace.source,
|
|
30
|
+
})),
|
|
31
|
+
...listing.unreadable.map((marketplace) => ({
|
|
32
|
+
name: marketplace.name,
|
|
33
|
+
unreadable: marketplace.reason,
|
|
34
|
+
})),
|
|
35
|
+
],
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Read each offered entry's own package for its version and description.
|
|
40
|
+
* The marketplace file's description is a fallback (Stigmer's own catalogue
|
|
41
|
+
* carries none, so nothing is written twice); the plugin's manifest is the
|
|
42
|
+
* truth a user installs.
|
|
43
|
+
*/
|
|
44
|
+
export function inspectEntries(tree) {
|
|
45
|
+
return tree.marketplace.plugins.map((entry) => {
|
|
46
|
+
const outcome = readPluginPackage(readPluginDirectory(entryDirectory(tree, entry)).files);
|
|
47
|
+
if (!outcome.ok) {
|
|
48
|
+
return {
|
|
49
|
+
name: entry.name,
|
|
50
|
+
dir: entry.dir,
|
|
51
|
+
...(entry.description !== undefined && {
|
|
52
|
+
description: entry.description,
|
|
53
|
+
}),
|
|
54
|
+
problems: outcome.errors.length,
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
const description = outcome.plugin.description ?? entry.description;
|
|
58
|
+
return {
|
|
59
|
+
name: entry.name,
|
|
60
|
+
dir: entry.dir,
|
|
61
|
+
...(outcome.plugin.version !== undefined && {
|
|
62
|
+
version: outcome.plugin.version,
|
|
63
|
+
}),
|
|
64
|
+
...(description !== undefined && { description }),
|
|
65
|
+
};
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
export function renderMarketplaceShow(marketplace, tree, entries) {
|
|
69
|
+
const installable = entries.filter((entry) => entry.problems === undefined).length;
|
|
70
|
+
const headline = `Marketplace '${marketplace.name}' offers ${count(installable, "plugin")}`;
|
|
71
|
+
const result = tree.warnings.length === 0 && installable === entries.length
|
|
72
|
+
? CommandResult.success(headline)
|
|
73
|
+
: CommandResult.warning(`${headline}, with ${count(tree.warnings.length + (entries.length - installable), "warning")}`);
|
|
74
|
+
const about = result.addSection("Marketplace");
|
|
75
|
+
about.field("Name", tree.marketplace.name);
|
|
76
|
+
about.field("Source", describeSource(marketplace.source));
|
|
77
|
+
if (tree.marketplace.description !== undefined)
|
|
78
|
+
about.field("Description", tree.marketplace.description);
|
|
79
|
+
if (tree.marketplace.owner?.name !== undefined)
|
|
80
|
+
about.field("Owner", tree.marketplace.owner.name);
|
|
81
|
+
about.field("Format", tree.marketplace.path);
|
|
82
|
+
if (tree.marketplace.defaults.length > 0)
|
|
83
|
+
about.field("Defaults", tree.marketplace.defaults.join(", "));
|
|
84
|
+
const plugins = result.addSection("Plugins");
|
|
85
|
+
for (const entry of entries) {
|
|
86
|
+
const version = entry.version === undefined ? "" : `@${entry.version}`;
|
|
87
|
+
const tail = entry.problems !== undefined
|
|
88
|
+
? ` (not installable: ${count(entry.problems, "problem")}; run 'stigmer validate -f' on it)`
|
|
89
|
+
: entry.description === undefined
|
|
90
|
+
? ""
|
|
91
|
+
: ` ${entry.description}`;
|
|
92
|
+
plugins.item(`${entry.name}${version}${tail}`);
|
|
93
|
+
}
|
|
94
|
+
if (tree.warnings.length > 0) {
|
|
95
|
+
const section = result.addSection("Not offered");
|
|
96
|
+
for (const warning of tree.warnings)
|
|
97
|
+
section.item(warning.message);
|
|
98
|
+
}
|
|
99
|
+
result.hint(`Install one with: stigmer install ${marketplace.name}/<plugin>`);
|
|
100
|
+
return result.withData({
|
|
101
|
+
marketplace: {
|
|
102
|
+
name: tree.marketplace.name,
|
|
103
|
+
source: marketplace.source,
|
|
104
|
+
dialect: tree.marketplace.dialect,
|
|
105
|
+
path: tree.marketplace.path,
|
|
106
|
+
...(tree.marketplace.description !== undefined && {
|
|
107
|
+
description: tree.marketplace.description,
|
|
108
|
+
}),
|
|
109
|
+
...(tree.marketplace.owner !== undefined && {
|
|
110
|
+
owner: tree.marketplace.owner,
|
|
111
|
+
}),
|
|
112
|
+
defaults: tree.marketplace.defaults,
|
|
113
|
+
},
|
|
114
|
+
plugins: entries,
|
|
115
|
+
warnings: tree.warnings,
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
//# sourceMappingURL=render.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"render.js","sourceRoot":"","sources":["../../src/marketplace/render.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,2EAA2E;AAC3E,sEAAsE;AACtE,yEAAyE;AACzE,0EAA0E;AAE1E,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,KAAK,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AACpE,OAAO,EAGL,cAAc,GACf,MAAM,aAAa,CAAC;AACrB,OAAO,EAA4B,cAAc,EAAE,MAAM,WAAW,CAAC;AAErE,MAAM,UAAU,qBAAqB,CACnC,OAA2B;IAE3B,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC;IAC/D,MAAM,MAAM,GACV,OAAO,CAAC,UAAU,CAAC,MAAM,KAAK,CAAC;QAC7B,CAAC,CAAC,aAAa,CAAC,OAAO,CAAC,GAAG,KAAK,CAAC,KAAK,EAAE,aAAa,CAAC,aAAa,CAAC;QACpE,CAAC,CAAC,aAAa,CAAC,OAAO,CACnB,GAAG,KAAK,CAAC,KAAK,EAAE,aAAa,CAAC,gBAAgB,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,MAAM,EAAE,OAAO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,CAAC,QAAQ;SACpC;QACD,OAAO,EAAE,OAAO;QAChB,QAAQ,EAAE,IAAI,CAAC,QAAQ;KACxB,CAAC,CAAC;AACL,CAAC"}
|
package/output/ndjson.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// NDJSON envelope + writer for streaming commands (run/resume
|
|
1
|
+
// NDJSON envelope + writer for streaming commands (run/resume).
|
|
2
2
|
//
|
|
3
3
|
// The wire shape mirrors the Go CLI's run --json output (run_stream_json.go):
|
|
4
4
|
// every line is a `{type, ts, payload}` object, and the payload is cleaned of
|
package/output/ndjson.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ndjson.js","sourceRoot":"","sources":["../../src/output/ndjson.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"ndjson.js","sourceRoot":"","sources":["../../src/output/ndjson.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,EAAE;AACF,8EAA8E;AAC9E,8EAA8E;AAC9E,8EAA8E;AAC9E,gFAAgF;AAahF,2EAA2E;AAC3E,MAAM,UAAU,UAAU,CAAC,KAAkB;IAC3C,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC;AACtC,CAAC;AAED,uDAAuD;AACvD,MAAM,UAAU,WAAW,CAAC,GAAsC,EAAE,KAAkB;IACpF,GAAG,CAAC,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC;AAC/B,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAC5B,IAAY,EACZ,OAAgC,EAChC,MAAoB,gBAAgB;IAEpC,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,OAAO,EAAE,kBAAkB,CAAC,OAAO,CAAC,EAAE,CAAC;AACnE,CAAC;AAED,mFAAmF;AACnF,MAAM,UAAU,kBAAkB,CAAC,OAAgC;IACjE,MAAM,GAAG,GAA4B,EAAE,CAAC;IACxC,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;QACnD,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI;YAAE,SAAS;QACpD,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,EAAE;YAAE,SAAS;QACxD,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;IACnB,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED,SAAS,gBAAgB;IACvB,OAAO,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;AAClC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stigmer/cli",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.16.1-dev.20260917224426",
|
|
4
4
|
"description": "Stigmer command-line interface — manage agents, workflows, MCP servers, skills, and executions from the terminal",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -35,11 +35,12 @@
|
|
|
35
35
|
"@connectrpc/connect": "^2.0.0",
|
|
36
36
|
"@connectrpc/connect-node": "^2.1.1",
|
|
37
37
|
"@modelcontextprotocol/sdk": "^1.26.0",
|
|
38
|
-
"@stigmer/ink": "3.
|
|
39
|
-
"@stigmer/mcp-server": "3.
|
|
40
|
-
"@stigmer/plugin-package": "3.
|
|
41
|
-
"@stigmer/protos": "3.
|
|
42
|
-
"@stigmer/sdk": "3.
|
|
38
|
+
"@stigmer/ink": "3.16.1-dev.20260917224426",
|
|
39
|
+
"@stigmer/mcp-server": "3.16.1-dev.20260917224426",
|
|
40
|
+
"@stigmer/plugin-package": "3.16.1-dev.20260917224426",
|
|
41
|
+
"@stigmer/protos": "3.16.1-dev.20260917224426",
|
|
42
|
+
"@stigmer/sdk": "3.16.1-dev.20260917224426",
|
|
43
|
+
"@stigmer/zip-structure": "3.16.1-dev.20260917224426",
|
|
43
44
|
"commander": "^12.1.0",
|
|
44
45
|
"fflate": "^0.8.3",
|
|
45
46
|
"ink": "^7.0.0",
|
package/program.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"program.d.ts","sourceRoot":"","sources":["../src/program.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"program.d.ts","sourceRoot":"","sources":["../src/program.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAqCpC,wBAAgB,YAAY,IAAI,OAAO,CA4DtC"}
|
package/program.js
CHANGED
|
@@ -16,12 +16,13 @@ import { registerDelete } from "./commands/delete.js";
|
|
|
16
16
|
import { registerDiff } from "./commands/diff.js";
|
|
17
17
|
import { registerDown } from "./commands/down.js";
|
|
18
18
|
import { registerDownload } from "./commands/download.js";
|
|
19
|
-
import { registerDraft } from "./commands/draft.js";
|
|
20
19
|
import { registerExecution } from "./commands/execution/index.js";
|
|
21
20
|
import { registerGet } from "./commands/get.js";
|
|
21
|
+
import { registerInstall } from "./commands/install.js";
|
|
22
22
|
import { registerInternalDaemon } from "./commands/internal-daemon.js";
|
|
23
23
|
import { registerList } from "./commands/list.js";
|
|
24
24
|
import { registerLogs } from "./commands/logs.js";
|
|
25
|
+
import { registerMarketplace } from "./commands/marketplace.js";
|
|
25
26
|
import { registerMcpServer } from "./commands/mcp-server.js";
|
|
26
27
|
import { registerPush } from "./commands/push.js";
|
|
27
28
|
import { registerReset } from "./commands/reset.js";
|
|
@@ -78,11 +79,12 @@ export function buildProgram() {
|
|
|
78
79
|
registerDiff(program);
|
|
79
80
|
registerUsage(program);
|
|
80
81
|
registerPush(program);
|
|
82
|
+
registerInstall(program);
|
|
83
|
+
registerMarketplace(program);
|
|
81
84
|
registerDownload(program);
|
|
82
85
|
registerApply(program);
|
|
83
86
|
registerRun(program);
|
|
84
87
|
registerResume(program);
|
|
85
|
-
registerDraft(program);
|
|
86
88
|
registerExecution(program);
|
|
87
89
|
registerConnect(program);
|
|
88
90
|
registerMcpServer(program);
|
package/program.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"program.js","sourceRoot":"","sources":["../src/program.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,6EAA6E;AAC7E,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,4EAA4E;AAC5E,yEAAyE;AAEzE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"program.js","sourceRoot":"","sources":["../src/program.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,6EAA6E;AAC7E,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,4EAA4E;AAC5E,yEAAyE;AAEzE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACp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B,CAAC,OAAO,CAAC,CAAC;IAC1B,aAAa,CAAC,OAAO,CAAC,CAAC;IACvB,aAAa,CAAC,OAAO,CAAC,CAAC;IACvB,sBAAsB,CAAC,OAAO,CAAC,CAAC;IAEhC,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
export { DEFAULT_PATTERNS } from "
|
|
2
|
-
export {
|
|
3
|
-
export { createMatcher, type MatcherOptions, type MatchReason, Matcher, Reason, REASON_TEXT, SOURCE_CLI, SOURCE_DEFAULTS, SOURCE_GITIGNORE, SOURCE_STIGMERIGNORE, } from "./matcher.js";
|
|
4
|
-
export { MatchResult, type Pattern, parsePattern } from "./pattern.js";
|
|
1
|
+
export { DEFAULT_PATTERNS, type MatchReason, MatchResult, Matcher, type Pattern, REASON_TEXT, Reason, SOURCE_CLI, SOURCE_DEFAULTS, SOURCE_GITIGNORE, SOURCE_STIGMERIGNORE, matchName, parsePattern, } from "@stigmer/plugin-package/client";
|
|
2
|
+
export { createMatcher, type MatcherOptions } from "./matcher.js";
|
|
5
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/resources/ignore/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/resources/ignore/index.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,gBAAgB,EAChB,KAAK,WAAW,EAChB,WAAW,EACX,OAAO,EACP,KAAK,OAAO,EACZ,WAAW,EACX,MAAM,EACN,UAAU,EACV,eAAe,EACf,gBAAgB,EAChB,oBAAoB,EACpB,SAAS,EACT,YAAY,GACb,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC"}
|