@codeworksh/cli 0.0.1-canary.10.1.g65d5c167
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/LICENSE +21 -0
- package/README.md +226 -0
- package/acp-P_1Wqd-Z.mjs +494 -0
- package/acp-P_1Wqd-Z.mjs.map +1 -0
- package/add-DjJjtu0E.mjs +82 -0
- package/add-DjJjtu0E.mjs.map +1 -0
- package/catalog-BeNHJEEM.mjs +17 -0
- package/catalog-BeNHJEEM.mjs.map +1 -0
- package/check-CJtU790x.mjs +54 -0
- package/check-CJtU790x.mjs.map +1 -0
- package/entries-BXBULTVt.mjs +90 -0
- package/entries-BXBULTVt.mjs.map +1 -0
- package/error-CxoEKg-4.mjs +610 -0
- package/error-CxoEKg-4.mjs.map +1 -0
- package/harness-6d8TlAVk.mjs +19 -0
- package/harness-6d8TlAVk.mjs.map +1 -0
- package/index.mjs +39 -0
- package/index.mjs.map +1 -0
- package/install-CRsM-5h3.mjs +54 -0
- package/install-CRsM-5h3.mjs.map +1 -0
- package/link-orVe7_W5.mjs +41 -0
- package/link-orVe7_W5.mjs.map +1 -0
- package/list-B9t_qFIQ.mjs +77 -0
- package/list-B9t_qFIQ.mjs.map +1 -0
- package/list-C7YdESnc.mjs +30 -0
- package/list-C7YdESnc.mjs.map +1 -0
- package/login-zuKhmbS5.mjs +45 -0
- package/login-zuKhmbS5.mjs.map +1 -0
- package/logout-B0lXwmvv.mjs +29 -0
- package/logout-B0lXwmvv.mjs.map +1 -0
- package/package-KrQWL_Rw.mjs +6 -0
- package/package-KrQWL_Rw.mjs.map +1 -0
- package/package.json +54 -0
- package/providers-PNt4dpfv.mjs +17 -0
- package/providers-PNt4dpfv.mjs.map +1 -0
- package/refresh-FjH0oHND.mjs +17 -0
- package/refresh-FjH0oHND.mjs.map +1 -0
- package/refresh-xxKXjcRX.mjs +35 -0
- package/refresh-xxKXjcRX.mjs.map +1 -0
- package/reload-B2PxpO2s.mjs +26 -0
- package/reload-B2PxpO2s.mjs.map +1 -0
- package/remove-Deowzmc7.mjs +37 -0
- package/remove-Deowzmc7.mjs.map +1 -0
- package/run-DNRnGHYa.mjs +146 -0
- package/run-DNRnGHYa.mjs.map +1 -0
- package/runtime-BuFe9cOc.mjs +358 -0
- package/runtime-BuFe9cOc.mjs.map +1 -0
- package/serve-DfW0O2tr.mjs +300 -0
- package/serve-DfW0O2tr.mjs.map +1 -0
- package/settings-aqM_b9UE.mjs +221 -0
- package/settings-aqM_b9UE.mjs.map +1 -0
- package/shared-DN18qxOE.mjs +116 -0
- package/shared-DN18qxOE.mjs.map +1 -0
- package/status-Br21KEeh.mjs +31 -0
- package/status-Br21KEeh.mjs.map +1 -0
- package/update-qrQr-mJT.mjs +51 -0
- package/update-qrQr-mJT.mjs.map +1 -0
package/add-DjJjtu0E.mjs
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { i as Cmd, t as handler } from "./runtime-BuFe9cOc.mjs";
|
|
2
|
+
import { d as writeOut, i as reportFailure } from "./error-CxoEKg-4.mjs";
|
|
3
|
+
import { a as resolveTarget, c as withPluginsLock, i as readPlugins, l as writePlugins, n as matches, o as spellings, t as identify, u as written } from "./settings-aqM_b9UE.mjs";
|
|
4
|
+
import { Effect, Layer, Option, Path } from "effect";
|
|
5
|
+
import { Database, Event, Global, Plugin, Session, SessionStore } from "@codeworksh/harness/effect";
|
|
6
|
+
//#region src/cli/cmd/handlers/plugin/session.ts
|
|
7
|
+
/**
|
|
8
|
+
* The host directory a session is linked to.
|
|
9
|
+
*
|
|
10
|
+
* **A session ID can answer this and a project ID cannot**, which is why the flag takes one. A
|
|
11
|
+
* `Project` is env-independent by design -- its identity is a repo marker, a remote hash or a root
|
|
12
|
+
* commit, never a path -- and its spaces hold `location`s *inside* an env, which may be a container
|
|
13
|
+
* on another machine. Deriving a host settings file from one would mean walking the host
|
|
14
|
+
* filesystem from a path that means something somewhere else, which is the exact failure the
|
|
15
|
+
* `hostDir` split exists to prevent: it does not error, it finds a stranger's project.
|
|
16
|
+
*
|
|
17
|
+
* A session, by contrast, carries a `hostDir` that was *declared* on the host. Absent is a normal
|
|
18
|
+
* state rather than corruption, and it is the one this refuses.
|
|
19
|
+
*/
|
|
20
|
+
const linkedDirectory = Effect.fn("CLI.plugin.linkedDirectory")(function* (sessionId, home) {
|
|
21
|
+
const paths = yield* Global.resolve(Option.isNone(home) ? {} : { home: home.value });
|
|
22
|
+
const id = Session.SessionSchema.ID.ascending(sessionId);
|
|
23
|
+
return yield* Effect.gen(function* () {
|
|
24
|
+
const found = yield* (yield* SessionStore.Service).get(id);
|
|
25
|
+
if (Option.isNone(found)) return yield* new SessionStore.SessionNotFoundError({ sessionId: id });
|
|
26
|
+
const hostDir = Option.getOrUndefined(found.value.hostDir);
|
|
27
|
+
if (hostDir === void 0) return yield* new SessionStore.SessionNotLinkedError({ sessionId: id });
|
|
28
|
+
return hostDir;
|
|
29
|
+
}).pipe(Effect.provide(SessionStore.layer.pipe(Layer.provide(Event.layer), Layer.provide(Database.layer(yield* Database.path(paths.data))))));
|
|
30
|
+
});
|
|
31
|
+
//#endregion
|
|
32
|
+
//#region src/cli/cmd/handlers/plugin/add.ts
|
|
33
|
+
var add_default = handler(Cmd.commands.plugin.commands.add, Effect.fn("CLI.plugin.add")(function* ({ package: reference, global: userWide, session }) {
|
|
34
|
+
return yield* Effect.gen(function* () {
|
|
35
|
+
const shared = yield* Cmd.spec;
|
|
36
|
+
const path = yield* Path.Path;
|
|
37
|
+
const paths = yield* Global.resolve(Option.isNone(shared.home) ? {} : { home: shared.home.value });
|
|
38
|
+
const linked = Option.isNone(session) ? void 0 : yield* linkedDirectory(session.value, shared.home);
|
|
39
|
+
const from = linked ?? path.resolve(".");
|
|
40
|
+
const target = yield* resolveTarget(shared, userWide, linked, false);
|
|
41
|
+
const plugin = yield* Plugin.inspect(reference, {
|
|
42
|
+
cache: paths.cache,
|
|
43
|
+
hostDir: from,
|
|
44
|
+
file: target.path
|
|
45
|
+
});
|
|
46
|
+
const entry = yield* written(reference, {
|
|
47
|
+
hostDir: from,
|
|
48
|
+
file: target.path,
|
|
49
|
+
root: target.root
|
|
50
|
+
});
|
|
51
|
+
const spelled = yield* spellings(reference, from);
|
|
52
|
+
const version = plugin.version === void 0 ? "" : `@${plugin.version}`;
|
|
53
|
+
yield* withPluginsLock(target.path, Effect.gen(function* () {
|
|
54
|
+
const { source, plugins } = yield* readPlugins(target.path);
|
|
55
|
+
const entries = yield* identify(plugins, target.path, paths.cache);
|
|
56
|
+
const names = (candidate) => matches(candidate, spelled) || candidate.answers.has(plugin.id);
|
|
57
|
+
const existing = entries.findIndex((candidate) => candidate.loads && names(candidate));
|
|
58
|
+
if (existing >= 0) {
|
|
59
|
+
const current = entries[existing]?.value;
|
|
60
|
+
if (current === entry) {
|
|
61
|
+
yield* writeOut(`Plugin "${reference}" is already configured in ${target.path}\n`);
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
const replaced = [...plugins];
|
|
65
|
+
replaced[existing] = entry;
|
|
66
|
+
yield* writePlugins(target.path, source, replaced);
|
|
67
|
+
yield* writeOut(`Updated ${plugin.id} (${String(current)} -> ${entry}${version}) in ${target.path}\n`);
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
const configured = entries.findIndex((candidate) => !candidate.loads && names(candidate));
|
|
71
|
+
const updated = [...plugins];
|
|
72
|
+
updated.splice(configured < 0 ? updated.length : configured, 0, entry);
|
|
73
|
+
yield* writePlugins(target.path, source, updated);
|
|
74
|
+
yield* writeOut(`Added ${plugin.id} (${entry}${version}) to ${target.path}\n`);
|
|
75
|
+
}));
|
|
76
|
+
if (target.created !== void 0) yield* writeOut(`Created ${target.created}/\n`);
|
|
77
|
+
}).pipe(Effect.catch(reportFailure));
|
|
78
|
+
}));
|
|
79
|
+
//#endregion
|
|
80
|
+
export { add_default as default };
|
|
81
|
+
|
|
82
|
+
//# sourceMappingURL=add-DjJjtu0E.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add-DjJjtu0E.mjs","names":["Runtime.handler"],"sources":["../../src/cli/cmd/handlers/plugin/session.ts","../../src/cli/cmd/handlers/plugin/add.ts"],"sourcesContent":["import { Database, Event, Global, Session, SessionStore } from \"@codeworksh/harness/effect\";\nimport { Effect, Layer, Option } from \"effect\";\n\n/**\n * The host directory a session is linked to.\n *\n * **A session ID can answer this and a project ID cannot**, which is why the flag takes one. A\n * `Project` is env-independent by design -- its identity is a repo marker, a remote hash or a root\n * commit, never a path -- and its spaces hold `location`s *inside* an env, which may be a container\n * on another machine. Deriving a host settings file from one would mean walking the host\n * filesystem from a path that means something somewhere else, which is the exact failure the\n * `hostDir` split exists to prevent: it does not error, it finds a stranger's project.\n *\n * A session, by contrast, carries a `hostDir` that was *declared* on the host. Absent is a normal\n * state rather than corruption, and it is the one this refuses.\n */\nexport const linkedDirectory = Effect.fn(\"CLI.plugin.linkedDirectory\")(function* (\n\tsessionId: string,\n\thome: Option.Option<string>,\n) {\n\tconst paths = yield* Global.resolve(Option.isNone(home) ? {} : { home: home.value });\n\tconst id = Session.SessionSchema.ID.ascending(sessionId);\n\n\treturn yield* Effect.gen(function* () {\n\t\tconst sessions = yield* SessionStore.Service;\n\t\tconst found = yield* sessions.get(id);\n\t\tif (Option.isNone(found)) return yield* new SessionStore.SessionNotFoundError({ sessionId: id });\n\t\tconst hostDir = Option.getOrUndefined(found.value.hostDir);\n\t\tif (hostDir === undefined) return yield* new SessionStore.SessionNotLinkedError({ sessionId: id });\n\t\treturn hostDir;\n\t}).pipe(\n\t\t// Only the session row is read, so this needs the database and the event log the store is\n\t\t// built on -- no sandboxes, no control plane, no plugin machinery.\n\t\tEffect.provide(\n\t\t\tSessionStore.layer.pipe(\n\t\t\t\tLayer.provide(Event.layer),\n\t\t\t\tLayer.provide(Database.layer(yield* Database.path(paths.data))),\n\t\t\t),\n\t\t),\n\t);\n});\n","import { Global, Plugin } from \"@codeworksh/harness/effect\";\nimport { Effect, Option, Path } from \"effect\";\nimport { Runtime } from \"../../../../framework/runtime.ts\";\nimport { reportFailure } from \"../../../error.ts\";\nimport { writeOut } from \"../../../output.ts\";\nimport { Cmd } from \"../../cmd.ts\";\nimport { linkedDirectory } from \"./session.ts\";\nimport {\n\tidentify,\n\tmatches,\n\treadPlugins,\n\tresolveTarget,\n\tspellings,\n\twithPluginsLock,\n\twritePlugins,\n\twritten,\n} from \"./settings.ts\";\n\nexport default Runtime.handler(\n\tCmd.commands.plugin.commands.add,\n\tEffect.fn(\"CLI.plugin.add\")(function* ({ package: reference, global: userWide, session }) {\n\t\tconst program = Effect.gen(function* () {\n\t\t\tconst shared = yield* Cmd.spec;\n\t\t\tconst path = yield* Path.Path;\n\t\t\tconst paths = yield* Global.resolve(Option.isNone(shared.home) ? {} : { home: shared.home.value });\n\n\t\t\t// A session names the project to write into when the shell's directory is not it --\n\t\t\t// a server or a UI acting on a session's behalf, rather than a person standing in the\n\t\t\t// repository. It fails when that session has no project, which is a state `session\n\t\t\t// link` exists to fix.\n\t\t\tconst linked = Option.isNone(session) ? undefined : yield* linkedDirectory(session.value, shared.home);\n\t\t\t/*\n\t\t\t * One directory answers every question this command asks about the reference, and it\n\t\t\t * is resolved before any of them.\n\t\t\t *\n\t\t\t * A relative spec anchors here, the `.npmrc` chain governing the install is read from\n\t\t\t * here, and the entry is written anchored here. Splitting them is not a cosmetic\n\t\t\t * inconsistency: under `--session` the shell's directory is a server's, so validating\n\t\t\t * `./plugins/x.ts` against it imports one file and writes a reference to another, and\n\t\t\t * reading the `.npmrc` chain from it installs from the wrong registry -- a private\n\t\t\t * scope's token lives in the project being written to, not wherever the server runs.\n\t\t\t */\n\t\t\tconst from = linked ?? path.resolve(\".\");\n\n\t\t\t// The file the entry will land in decides the install's registry identity: it is named\n\t\t\t// here -- without creating the marker -- so the store keys the artifact under the same\n\t\t\t// `.npmrc` chain every later resolve of this entry re-derives, and a bad reference\n\t\t\t// still leaves nothing behind.\n\t\t\tconst target = yield* resolveTarget(shared, userWide, linked, false);\n\n\t\t\t// Install and import before touching the file: a spec that turns out not to be a plugin\n\t\t\t// should fail here, with its own error, rather than at the next run from a file the user\n\t\t\t// then has to repair by hand.\n\t\t\tconst plugin = yield* Plugin.inspect(reference, { cache: paths.cache, hostDir: from, file: target.path });\n\t\t\t// What goes in the file, which is not always what was typed: a relative path anchors to\n\t\t\t// the settings file being written, not to the directory the command ran in.\n\t\t\tconst entry = yield* written(reference, {\n\t\t\t\thostDir: from,\n\t\t\t\tfile: target.path,\n\t\t\t\troot: target.root,\n\t\t\t});\n\t\t\tconst spelled = yield* spellings(reference, from);\n\t\t\tconst version = plugin.version === undefined ? \"\" : `@${plugin.version}`;\n\t\t\tyield* withPluginsLock(\n\t\t\t\ttarget.path,\n\t\t\t\tEffect.gen(function* () {\n\t\t\t\t\tconst { source, plugins } = yield* readPlugins(target.path);\n\t\t\t\t\tconst entries = yield* identify(plugins, target.path, paths.cache);\n\t\t\t\t\t// Configured already if any spelling of an existing entry names this plugin -- the same\n\t\t\t\t\t// package under a different version, the path it was added by, or the ID it declares.\n\t\t\t\t\tconst names = (candidate: (typeof entries)[number]) =>\n\t\t\t\t\t\tmatches(candidate, spelled) || candidate.answers.has(plugin.id);\n\t\t\t\t\tconst existing = entries.findIndex((candidate) => candidate.loads && names(candidate));\n\t\t\t\t\tif (existing >= 0) {\n\t\t\t\t\t\tconst current = entries[existing]?.value;\n\t\t\t\t\t\tif (current === entry) {\n\t\t\t\t\t\t\tyield* writeOut(`Plugin \"${reference}\" is already configured in ${target.path}\\n`);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst replaced = [...plugins];\n\t\t\t\t\t\treplaced[existing] = entry;\n\t\t\t\t\t\tyield* writePlugins(target.path, source, replaced);\n\t\t\t\t\t\tyield* writeOut(\n\t\t\t\t\t\t\t`Updated ${plugin.id} (${String(current)} -> ${entry}${version}) in ${target.path}\\n`,\n\t\t\t\t\t\t);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Put the loader before existing configuration so its options apply to the module.\n\t\t\t\t\tconst configured = entries.findIndex((candidate) => !candidate.loads && names(candidate));\n\t\t\t\t\tconst updated = [...plugins];\n\t\t\t\t\tupdated.splice(configured < 0 ? updated.length : configured, 0, entry);\n\t\t\t\t\tyield* writePlugins(target.path, source, updated);\n\t\t\t\t\tyield* writeOut(`Added ${plugin.id} (${entry}${version}) to ${target.path}\\n`);\n\t\t\t\t}),\n\t\t\t);\n\t\t\t// Said after the write, because `resolveTarget` only named the marker: the lock's\n\t\t\t// write is what made it, and \"created\" should be true by the time it is printed.\n\t\t\tif (target.created !== undefined) yield* writeOut(`Created ${target.created}/\\n`);\n\t\t});\n\n\t\treturn yield* program.pipe(Effect.catch(reportFailure));\n\t}),\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAgBA,MAAa,kBAAkB,OAAO,GAAG,4BAA4B,CAAC,CAAC,WACtE,WACA,MACC;CACD,MAAM,QAAQ,OAAO,OAAO,QAAQ,OAAO,OAAO,IAAI,IAAI,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;CACnF,MAAM,KAAK,QAAQ,cAAc,GAAG,UAAU,SAAS;CAEvD,OAAO,OAAO,OAAO,IAAI,aAAa;EAErC,MAAM,QAAQ,QAAO,OADG,aAAa,QAAA,CACP,IAAI,EAAE;EACpC,IAAI,OAAO,OAAO,KAAK,GAAG,OAAO,OAAO,IAAI,aAAa,qBAAqB,EAAE,WAAW,GAAG,CAAC;EAC/F,MAAM,UAAU,OAAO,eAAe,MAAM,MAAM,OAAO;EACzD,IAAI,YAAY,KAAA,GAAW,OAAO,OAAO,IAAI,aAAa,sBAAsB,EAAE,WAAW,GAAG,CAAC;EACjG,OAAO;CACR,CAAC,CAAC,CAAC,KAGF,OAAO,QACN,aAAa,MAAM,KAClB,MAAM,QAAQ,MAAM,KAAK,GACzB,MAAM,QAAQ,SAAS,MAAM,OAAO,SAAS,KAA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YAAY,GAAG;IAClB,MAAM,UAAU,QAAQ,SAAS,EAAE;IACnC,IAAI,YAAY,OAAO;KACtB,OAAO,SAAS,WAAW,UAAU,6BAA6B,OAAO,KAAK,GAAG;KACjF;IACD;IACA,MAAM,WAAW,CAAC,GAAG,OAAO;IAC5B,SAAS,YAAY;IACrB,OAAO,aAAa,OAAO,MAAM,QAAQ,QAAQ;IACjD,OAAO,SACN,WAAW,OAAO,GAAG,IAAI,OAAO,OAAO,EAAE,MAAM,QAAQ,QAAQ,OAAO,OAAO,KAAK,GACnF;IACA;GACD;GAGA,MAAM,aAAa,QAAQ,WAAW,cAAc,CAAC,UAAU,SAAS,MAAM,SAAS,CAAC;GACxF,MAAM,UAAU,CAAC,GAAG,OAAO;GAC3B,QAAQ,OAAO,aAAa,IAAI,QAAQ,SAAS,YAAY,GAAG,KAAK;GACrE,OAAO,aAAa,OAAO,MAAM,QAAQ,OAAO;GAChD,OAAO,SAAS,SAAS,OAAO,GAAG,IAAI,QAAQ,QAAQ,OAAO,OAAO,KAAK,GAAG;EAC9E,CAAC,CACF;EAGA,IAAI,OAAO,YAAY,KAAA,GAAW,OAAO,SAAS,WAAW,OAAO,QAAQ,IAAI;CACjF,CAEoB,CAAC,CAAC,KAAK,OAAO,MAAM,aAAa,CAAC;AACvD,CAAC,CACF"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { i as Cmd } from "./runtime-BuFe9cOc.mjs";
|
|
2
|
+
import { Effect, Option } from "effect";
|
|
3
|
+
import { Global, ModelCatalog } from "@codeworksh/harness/effect";
|
|
4
|
+
//#region src/cli/cmd/handlers/models/catalog.ts
|
|
5
|
+
/** The home `--home` names, or the default one. */
|
|
6
|
+
const home = Effect.gen(function* () {
|
|
7
|
+
const shared = yield* Cmd.spec;
|
|
8
|
+
return (yield* Global.resolve(Option.isNone(shared.home) ? {} : { home: shared.home.value })).home;
|
|
9
|
+
});
|
|
10
|
+
/** Check the home's catalog, as `run` does at boot, before reading it. */
|
|
11
|
+
const synced = Effect.gen(function* () {
|
|
12
|
+
yield* ModelCatalog.sync(yield* home);
|
|
13
|
+
});
|
|
14
|
+
//#endregion
|
|
15
|
+
export { synced as n, home as t };
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=catalog-BeNHJEEM.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catalog-BeNHJEEM.mjs","names":[],"sources":["../../src/cli/cmd/handlers/models/catalog.ts"],"sourcesContent":["import { Global, ModelCatalog } from \"@codeworksh/harness/effect\";\nimport { Effect, Option } from \"effect\";\nimport { Cmd } from \"../../cmd.ts\";\n\n/** The home `--home` names, or the default one. */\nexport const home = Effect.gen(function* () {\n\tconst shared = yield* Cmd.spec;\n\treturn (yield* Global.resolve(Option.isNone(shared.home) ? {} : { home: shared.home.value })).home;\n});\n\n/** Check the home's catalog, as `run` does at boot, before reading it. */\nexport const synced = Effect.gen(function* () {\n\tyield* ModelCatalog.sync(yield* home);\n});\n"],"mappings":";;;;;AAKA,MAAa,OAAO,OAAO,IAAI,aAAa;CAC3C,MAAM,SAAS,OAAO,IAAI;CAC1B,QAAQ,OAAO,OAAO,QAAQ,OAAO,OAAO,OAAO,IAAI,IAAI,CAAC,IAAI,EAAE,MAAM,OAAO,KAAK,MAAM,CAAC,EAAA,CAAG;AAC/F,CAAC;;AAGD,MAAa,SAAS,OAAO,IAAI,aAAa;CAC7C,OAAO,aAAa,KAAK,OAAO,IAAI;AACrC,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { i as Cmd, t as handler } from "./runtime-BuFe9cOc.mjs";
|
|
2
|
+
import { d as writeOut, i as reportFailure } from "./error-CxoEKg-4.mjs";
|
|
3
|
+
import { a as targeted, i as read, n as local, r as probe, t as fetchable } from "./entries-BXBULTVt.mjs";
|
|
4
|
+
import { Effect, Option } from "effect";
|
|
5
|
+
import { Plugin } from "@codeworksh/harness/effect";
|
|
6
|
+
//#region src/cli/cmd/handlers/plugin/check.ts
|
|
7
|
+
/**
|
|
8
|
+
* Which configured plugins have a newer revision available.
|
|
9
|
+
*
|
|
10
|
+
* A probe failure -- offline, registry down, a remote that refuses -- is **not** an update. It is
|
|
11
|
+
* reported per target and the command exits non-zero, rather than being swallowed into "you are up
|
|
12
|
+
* to date": an outage that reads as currency is the one answer this command must never give.
|
|
13
|
+
*/
|
|
14
|
+
var check_default = handler(Cmd.commands.plugin.commands.check, Effect.fn("CLI.plugin.check")(function* ({ refresh, spec }) {
|
|
15
|
+
return yield* Effect.gen(function* () {
|
|
16
|
+
const shared = yield* Cmd.spec;
|
|
17
|
+
const { entries, cache, hostDir } = yield* read(shared);
|
|
18
|
+
const selected = yield* targeted(entries, spec, hostDir);
|
|
19
|
+
if (selected.length === 0 && Option.isSome(spec)) return;
|
|
20
|
+
let outdated = 0;
|
|
21
|
+
let failed = 0;
|
|
22
|
+
for (const entry of selected) {
|
|
23
|
+
const target = fetchable(entry.target);
|
|
24
|
+
if (target === void 0) {
|
|
25
|
+
yield* local(entry, spec);
|
|
26
|
+
continue;
|
|
27
|
+
}
|
|
28
|
+
const state = yield* Plugin.check(target, cache, {
|
|
29
|
+
refresh,
|
|
30
|
+
probe: probe(cache, entry.from),
|
|
31
|
+
from: entry.from
|
|
32
|
+
}).pipe(Effect.result);
|
|
33
|
+
if (state._tag === "Failure") {
|
|
34
|
+
failed += 1;
|
|
35
|
+
yield* writeOut(`${entry.reference} error[${state.failure.reason}]: ${state.failure.message}\n`);
|
|
36
|
+
continue;
|
|
37
|
+
}
|
|
38
|
+
switch (state.success._tag) {
|
|
39
|
+
case "outdated":
|
|
40
|
+
outdated += 1;
|
|
41
|
+
yield* writeOut(`${entry.reference} ${state.success.filed ?? "?"} -> ${state.success.available}\n`);
|
|
42
|
+
break;
|
|
43
|
+
case "not-installed": yield* writeOut(`${entry.reference} plugin-not-installed\n`);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
if (Option.isSome(spec) && selected.every((entry) => fetchable(entry.target) === void 0)) return;
|
|
47
|
+
yield* writeOut(outdated === 0 && failed === 0 ? "Everything is up to date.\n" : `${outdated} update${outdated === 1 ? "" : "s"} available.\n`);
|
|
48
|
+
if (failed > 0) process.exitCode = 1;
|
|
49
|
+
}).pipe(Effect.catch(reportFailure));
|
|
50
|
+
}));
|
|
51
|
+
//#endregion
|
|
52
|
+
export { check_default as default };
|
|
53
|
+
|
|
54
|
+
//# sourceMappingURL=check-CJtU790x.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check-CJtU790x.mjs","names":["Runtime.handler"],"sources":["../../src/cli/cmd/handlers/plugin/check.ts"],"sourcesContent":["import { Plugin } from \"@codeworksh/harness/effect\";\nimport { Effect, Option } from \"effect\";\nimport { Runtime } from \"../../../../framework/runtime.ts\";\nimport { reportFailure } from \"../../../error.ts\";\nimport { writeOut } from \"../../../output.ts\";\nimport { Cmd } from \"../../cmd.ts\";\nimport { fetchable, local, probe, read, targeted } from \"./entries.ts\";\n\n/**\n * Which configured plugins have a newer revision available.\n *\n * A probe failure -- offline, registry down, a remote that refuses -- is **not** an update. It is\n * reported per target and the command exits non-zero, rather than being swallowed into \"you are up\n * to date\": an outage that reads as currency is the one answer this command must never give.\n */\nexport default Runtime.handler(\n\tCmd.commands.plugin.commands.check,\n\tEffect.fn(\"CLI.plugin.check\")(function* ({ refresh, spec }) {\n\t\tconst program = Effect.gen(function* () {\n\t\t\tconst shared = yield* Cmd.spec;\n\t\t\tconst { entries, cache, hostDir } = yield* read(shared);\n\t\t\tconst selected = yield* targeted(entries, spec, hostDir);\n\t\t\tif (selected.length === 0 && Option.isSome(spec)) return;\n\n\t\t\tlet outdated = 0;\n\t\t\tlet failed = 0;\n\t\t\tfor (const entry of selected) {\n\t\t\t\tconst target = fetchable(entry.target);\n\t\t\t\t// Nothing to compare: a local path has no revision, and `check` skips it rather\n\t\t\t\t// than reporting it as current.\n\t\t\t\tif (target === undefined) {\n\t\t\t\t\tyield* local(entry, spec);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tconst state = yield* Plugin.check(target, cache, {\n\t\t\t\t\trefresh,\n\t\t\t\t\tprobe: probe(cache, entry.from),\n\t\t\t\t\tfrom: entry.from,\n\t\t\t\t}).pipe(Effect.result);\n\t\t\t\tif (state._tag === \"Failure\") {\n\t\t\t\t\tfailed += 1;\n\t\t\t\t\tyield* writeOut(`${entry.reference} error[${state.failure.reason}]: ${state.failure.message}\\n`);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tswitch (state.success._tag) {\n\t\t\t\t\tcase \"outdated\":\n\t\t\t\t\t\toutdated += 1;\n\t\t\t\t\t\tyield* writeOut(`${entry.reference} ${state.success.filed ?? \"?\"} -> ${state.success.available}\\n`);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"not-installed\":\n\t\t\t\t\t\tyield* writeOut(`${entry.reference} plugin-not-installed\\n`);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t// An exact version and a commit SHA cannot move, so neither is worth a line.\n\t\t\t\t\tcase \"immutable\":\n\t\t\t\t\tcase \"current\":\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// A spec that named only local plugins compared nothing, so there is nothing to sum up.\n\t\t\tif (Option.isSome(spec) && selected.every((entry) => fetchable(entry.target) === undefined)) return;\n\t\t\tyield* writeOut(\n\t\t\t\toutdated === 0 && failed === 0\n\t\t\t\t\t? \"Everything is up to date.\\n\"\n\t\t\t\t\t: `${outdated} update${outdated === 1 ? \"\" : \"s\"} available.\\n`,\n\t\t\t);\n\t\t\tif (failed > 0) process.exitCode = 1;\n\t\t});\n\n\t\treturn yield* program.pipe(Effect.catch(reportFailure));\n\t}),\n);\n"],"mappings":";;;;;;;;;;;;;AAeA,IAAA,gBAAeA,QACd,IAAI,SAAS,OAAO,SAAS,OAC7B,OAAO,GAAG,kBAAkB,CAAC,CAAC,WAAW,EAAE,SAAS,QAAQ;CAqD3D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-0,0 +1,90 @@
|
|
|
1
|
+
import { d as writeOut } from "./error-CxoEKg-4.mjs";
|
|
2
|
+
import { s as userLayer } from "./settings-aqM_b9UE.mjs";
|
|
3
|
+
import { Effect, Option, Path } from "effect";
|
|
4
|
+
import { Global, Plugin, Settings } from "@codeworksh/harness/effect";
|
|
5
|
+
//#region src/cli/cmd/handlers/plugin/entries.ts
|
|
6
|
+
/** Only a string entry loads a module; `{ package }` is configuration for one already selected. */
|
|
7
|
+
const moduleOf = (entry) => typeof entry === "string" ? entry : void 0;
|
|
8
|
+
const read = Effect.fn("CLI.plugin.entries")(function* (shared) {
|
|
9
|
+
const hostCwd = (yield* Path.Path).resolve(".");
|
|
10
|
+
const hostDir = hostCwd;
|
|
11
|
+
const paths = yield* Global.resolve(Option.isNone(shared.home) ? {} : { home: shared.home.value });
|
|
12
|
+
const root = yield* Settings.projectRoot(hostDir, paths.home);
|
|
13
|
+
const layers = {
|
|
14
|
+
home: paths.home,
|
|
15
|
+
...userLayer(shared, hostCwd)
|
|
16
|
+
};
|
|
17
|
+
const boot = yield* Settings.load(layers);
|
|
18
|
+
const views = root === void 0 ? [boot] : [boot, yield* Settings.load({
|
|
19
|
+
...layers,
|
|
20
|
+
hostDir: root
|
|
21
|
+
})];
|
|
22
|
+
const entries = /* @__PURE__ */ new Map();
|
|
23
|
+
for (const view of views) for (const [reference, one] of Settings.modules(view.declared)) {
|
|
24
|
+
const target = Option.getOrUndefined(yield* Plugin.parse(reference, hostDir).pipe(Effect.option));
|
|
25
|
+
const from = Plugin.anchor(one.file, hostDir);
|
|
26
|
+
const key = yield* identity(target, reference, from, paths.cache);
|
|
27
|
+
entries.set(key, {
|
|
28
|
+
written: moduleOf(one.written) ?? reference,
|
|
29
|
+
reference,
|
|
30
|
+
file: one.file,
|
|
31
|
+
from,
|
|
32
|
+
target
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
return {
|
|
36
|
+
entries: [...entries.values()],
|
|
37
|
+
cache: paths.cache,
|
|
38
|
+
hostDir
|
|
39
|
+
};
|
|
40
|
+
});
|
|
41
|
+
/**
|
|
42
|
+
* What makes two entries one artifact: the store's own key for a fetched target, the file for a
|
|
43
|
+
* local one. A registry that cannot be read keeps the entry apart, so its install reports why.
|
|
44
|
+
*/
|
|
45
|
+
const identity = (target, reference, from, cache) => {
|
|
46
|
+
const fetched = fetchable(target);
|
|
47
|
+
if (fetched === void 0) return Effect.succeed(target?.kind === "local" ? target.path : reference);
|
|
48
|
+
return Plugin.identity(fetched, cache, from).pipe(Effect.orElseSucceed(() => `${reference}\0${from}`));
|
|
49
|
+
};
|
|
50
|
+
/** What a reference names, whatever version it was written with: a package, a git spec, a file. */
|
|
51
|
+
const source = (reference, hostDir) => Plugin.canonical(reference, hostDir).pipe(Effect.orElseSucceed(() => reference));
|
|
52
|
+
/**
|
|
53
|
+
* The entries a command acts on: all of them, or every one `spec` names.
|
|
54
|
+
*
|
|
55
|
+
* Matched by source identity, the way the `plugins` array reads -- `@acme/x` selects
|
|
56
|
+
* `@acme/x@^1`, a relative path selects the file it resolves to from `hostDir`, and a local package
|
|
57
|
+
* also answers to the name its `package.json` declares. A plugin ID is not a spelling of anything
|
|
58
|
+
* in that array, so it matches nothing. Every match is kept: a spec both layers declare under
|
|
59
|
+
* different registries is two artifacts, and both answer to it.
|
|
60
|
+
*/
|
|
61
|
+
const targeted = Effect.fn("CLI.plugin.targeted")(function* (entries, spec, hostDir) {
|
|
62
|
+
if (Option.isNone(spec)) return entries;
|
|
63
|
+
const wanted = yield* source(spec.value, hostDir);
|
|
64
|
+
const selected = [];
|
|
65
|
+
for (const entry of entries) if ((yield* source(entry.reference, hostDir)) === wanted || entry.target?.kind === "local" && (yield* Plugin.localName(entry.target.path)) === wanted) selected.push(entry);
|
|
66
|
+
if (selected.length === 0) {
|
|
67
|
+
yield* writeOut(`Plugin "${spec.value}" is not configured. Run \`codework plugin list\` to see what is.\n`);
|
|
68
|
+
process.exitCode = 1;
|
|
69
|
+
}
|
|
70
|
+
return selected;
|
|
71
|
+
});
|
|
72
|
+
/**
|
|
73
|
+
* A local plugin has no revision to compare and is never copied into the store. Skipped quietly
|
|
74
|
+
* when a command walks everything; named, it says why nothing happened.
|
|
75
|
+
*/
|
|
76
|
+
const local = (entry, spec) => Option.isSome(spec) ? writeOut(`${entry.reference} local: no remote revision to compare\n`) : Effect.void;
|
|
77
|
+
/**
|
|
78
|
+
* The network half, handed to the store so the store itself never opens a socket.
|
|
79
|
+
*
|
|
80
|
+
* `probe` bypasses pacote's own metadata cache, because a staleness check that reads a cache is
|
|
81
|
+
* not a staleness check. `from` is the host directory: a probe that read a different `.npmrc`
|
|
82
|
+
* chain than the install would answer about a registry nothing is ever fetched from.
|
|
83
|
+
*/
|
|
84
|
+
const probe = (cache, from) => (target) => Plugin.probe(target, cache, from);
|
|
85
|
+
/** Only a fetched target has a store entry; a local one is loaded where it lies. */
|
|
86
|
+
const fetchable = (target) => target === void 0 || target.kind === "local" ? void 0 : target;
|
|
87
|
+
//#endregion
|
|
88
|
+
export { targeted as a, read as i, local as n, probe as r, fetchable as t };
|
|
89
|
+
|
|
90
|
+
//# sourceMappingURL=entries-BXBULTVt.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entries-BXBULTVt.mjs","names":[],"sources":["../../src/cli/cmd/handlers/plugin/entries.ts"],"sourcesContent":["import { Global, Plugin, Settings } from \"@codeworksh/harness/effect\";\nimport { Effect, Option, Path } from \"effect\";\nimport { writeOut } from \"../../../output.ts\";\nimport { userLayer, type Shared } from \"./settings.ts\";\n\n/**\n * Every plugin entry the settings files name, across every layer, in the order they accumulate.\n *\n * This is what `install`, `list`, `check` and `update` all operate on: unlike `add` and `remove`,\n * none of them writes an entry. They read what is already there and act on the store -- each one\n * under the `.npmrc` context of the file that declared it, which is what keys the artifact.\n */\nexport interface Entry {\n\t/** The reference as the settings file spells it: the string a person will search for. */\n\treadonly written: string;\n\t/** The same reference, anchored to the file that declared it. This is what resolves. */\n\treadonly reference: string;\n\t/** Which settings file owns it: the last to declare it in the view that needs it. */\n\treadonly file: string;\n\t/**\n\t * The `.npmrc` anchor for the entry's store identity: the project that declared it, so the\n\t * registry context is the same wherever this command happens to run.\n\t */\n\treadonly from: string;\n\t/** Absent for an unparseable entry and for a local path. */\n\treadonly target: Plugin.Target | undefined;\n}\n\n/** Only a string entry loads a module; `{ package }` is configuration for one already selected. */\nconst moduleOf = (entry: unknown): string | undefined => (typeof entry === \"string\" ? entry : undefined);\n\nexport const read = Effect.fn(\"CLI.plugin.entries\")(function* (shared: Shared) {\n\tconst nodePath = yield* Path.Path;\n\t// The directory the command runs in resolves its app-level flags. No session links it to\n\t// another host directory, so it is the command's anchor too: project settings are discovered\n\t// from here, and a relative spec typed here resolves here.\n\tconst hostCwd = nodePath.resolve(\".\");\n\tconst hostDir = hostCwd;\n\tconst paths = yield* Global.resolve(Option.isNone(shared.home) ? {} : { home: shared.home.value });\n\tconst root = yield* Settings.projectRoot(hostDir, paths.home);\n\tconst layers = { home: paths.home, ...userLayer(shared, hostCwd) };\n\t/*\n\t * The runtime resolves plugins in two views, and each needs its own artifact on disk: boot\n\t * reads the user layers alone, and a session reads every layer. Within a view the last file to\n\t * declare a reference owns it, so a spec both layers name is owned by the user file at boot and\n\t * by the project file in the project's sessions -- two `.npmrc` anchors, and possibly two\n\t * registries. Collapsing it to one owner leaves one of those views without its artifact.\n\t */\n\tconst boot = yield* Settings.load(layers);\n\tconst views = root === undefined ? [boot] : [boot, yield* Settings.load({ ...layers, hostDir: root })];\n\n\t// One entry per store artifact, so two anchors on one registry stay a single line. A later\n\t// view names the file, which is the one a person in this project would edit.\n\tconst entries = new Map<string, Entry>();\n\tfor (const view of views) {\n\t\t// views is [boot] outside a project, or [boot, session] inside one.\n\t\t// Boot comes first, and the order matters (see below).\n\t\tfor (const [reference, one] of Settings.modules(view.declared)) {\n\t\t\t// Already anchored to the file that declared it, so `hostDir` here only affects a\n\t\t\t// reference no settings file produced.\n\t\t\tconst target = Option.getOrUndefined(yield* Plugin.parse(reference, hostDir).pipe(Effect.option));\n\t\t\tconst from = Plugin.anchor(one.file, hostDir);\n\t\t\tconst key = yield* identity(target, reference, from, paths.cache);\n\t\t\tentries.set(key, { written: moduleOf(one.written) ?? reference, reference, file: one.file, from, target });\n\t\t}\n\t}\n\treturn { entries: [...entries.values()] as ReadonlyArray<Entry>, cache: paths.cache, hostDir };\n});\n\n/**\n * What makes two entries one artifact: the store's own key for a fetched target, the file for a\n * local one. A registry that cannot be read keeps the entry apart, so its install reports why.\n */\nconst identity = (target: Plugin.Target | undefined, reference: string, from: string, cache: string) => {\n\tconst fetched = fetchable(target);\n\tif (fetched === undefined) return Effect.succeed(target?.kind === \"local\" ? target.path : reference);\n\treturn Plugin.identity(fetched, cache, from).pipe(Effect.orElseSucceed(() => `${reference}\\0${from}`));\n};\n\n/** What a reference names, whatever version it was written with: a package, a git spec, a file. */\nconst source = (reference: string, hostDir: string) =>\n\tPlugin.canonical(reference, hostDir).pipe(Effect.orElseSucceed(() => reference));\n\n/**\n * The entries a command acts on: all of them, or every one `spec` names.\n *\n * Matched by source identity, the way the `plugins` array reads -- `@acme/x` selects\n * `@acme/x@^1`, a relative path selects the file it resolves to from `hostDir`, and a local package\n * also answers to the name its `package.json` declares. A plugin ID is not a spelling of anything\n * in that array, so it matches nothing. Every match is kept: a spec both layers declare under\n * different registries is two artifacts, and both answer to it.\n */\nexport const targeted = Effect.fn(\"CLI.plugin.targeted\")(function* (\n\tentries: ReadonlyArray<Entry>,\n\tspec: Option.Option<string>,\n\t/** The host directory the command resolves from, which a relative spec is typed against. */\n\thostDir: string,\n) {\n\tif (Option.isNone(spec)) return entries;\n\tconst wanted = yield* source(spec.value, hostDir);\n\tconst selected: Entry[] = [];\n\tfor (const entry of entries) {\n\t\tconst named =\n\t\t\t(yield* source(entry.reference, hostDir)) === wanted ||\n\t\t\t(entry.target?.kind === \"local\" && (yield* Plugin.localName(entry.target.path)) === wanted);\n\t\tif (named) selected.push(entry);\n\t}\n\tif (selected.length === 0) {\n\t\tyield* writeOut(`Plugin \"${spec.value}\" is not configured. Run \\`codework plugin list\\` to see what is.\\n`);\n\t\tprocess.exitCode = 1;\n\t}\n\treturn selected as ReadonlyArray<Entry>;\n});\n\n/**\n * A local plugin has no revision to compare and is never copied into the store. Skipped quietly\n * when a command walks everything; named, it says why nothing happened.\n */\nexport const local = (entry: Entry, spec: Option.Option<string>) =>\n\tOption.isSome(spec) ? writeOut(`${entry.reference} local: no remote revision to compare\\n`) : Effect.void;\n\n/**\n * The network half, handed to the store so the store itself never opens a socket.\n *\n * `probe` bypasses pacote's own metadata cache, because a staleness check that reads a cache is\n * not a staleness check. `from` is the host directory: a probe that read a different `.npmrc`\n * chain than the install would answer about a registry nothing is ever fetched from.\n */\nexport const probe =\n\t(cache: string, from: string): Plugin.Probe =>\n\t(target) =>\n\t\tPlugin.probe(target, cache, from);\n\n/** Only a fetched target has a store entry; a local one is loaded where it lies. */\nexport const fetchable = (target: Plugin.Target | undefined): Plugin.Fetchable | undefined =>\n\ttarget === undefined || target.kind === \"local\" ? undefined : target;\n"],"mappings":";;;;;;AA6BA,MAAM,YAAY,UAAwC,OAAO,UAAU,WAAW,QAAQ,KAAA;AAE9F,MAAa,OAAO,OAAO,GAAG,oBAAoB,CAAC,CAAC,WAAW,QAAgB;CAK9E,MAAM,WAAU,OAJQ,KAAK,KAAA,CAIJ,QAAQ,GAAG;CACpC,MAAM,UAAU;CAChB,MAAM,QAAQ,OAAO,OAAO,QAAQ,OAAO,OAAO,OAAO,IAAI,IAAI,CAAC,IAAI,EAAE,MAAM,OAAO,KAAK,MAAM,CAAC;CACjG,MAAM,OAAO,OAAO,SAAS,YAAY,SAAS,MAAM,IAAI;CAC5D,MAAM,SAAS;EAAE,MAAM,MAAM;EAAM,GAAG,UAAU,QAAQ,OAAO;CAAE;CAQjE,MAAM,OAAO,OAAO,SAAS,KAAK,MAAM;CACxC,MAAM,QAAQ,SAAS,KAAA,IAAY,CAA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