@codeworksh/cli 0.0.1-dev.20260922135856 → 0.0.1-dev.20260922184805
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/README.md +43 -0
- package/{add-D7X5BuCv.mjs → add--i7mPR73.mjs} +4 -4
- package/{add-D7X5BuCv.mjs.map → add--i7mPR73.mjs.map} +1 -1
- package/{catalog-DL8yWdvI.mjs → catalog-DJxy_lne.mjs} +2 -2
- package/{catalog-DL8yWdvI.mjs.map → catalog-DJxy_lne.mjs.map} +1 -1
- package/{check-M9CqztTk.mjs → check-Dq2WOgap.mjs} +4 -4
- package/{check-M9CqztTk.mjs.map → check-Dq2WOgap.mjs.map} +1 -1
- package/{commonjs-CiyyOsS6.mjs → commonjs-BDiLMfFF.mjs} +3 -3
- package/{commonjs-CiyyOsS6.mjs.map → commonjs-BDiLMfFF.mjs.map} +1 -1
- package/{definitions-ClJIBYEm.mjs → definitions-Dfwyyv_K.mjs} +3 -3
- package/{definitions-ClJIBYEm.mjs.map → definitions-Dfwyyv_K.mjs.map} +1 -1
- package/{entries-DBdy6ahj.mjs → entries-Gfsq7U4P.mjs} +2 -2
- package/{entries-DBdy6ahj.mjs.map → entries-Gfsq7U4P.mjs.map} +1 -1
- package/{error-DTXBm1nO.mjs → error-BrbT9_4g.mjs} +119 -9
- package/error-BrbT9_4g.mjs.map +1 -0
- package/{generate-C5NElYXe.mjs → generate-DrGYpD3l.mjs} +3 -3
- package/{generate-C5NElYXe.mjs.map → generate-DrGYpD3l.mjs.map} +1 -1
- package/{harness-DQxbts5f.mjs → harness-Bgvrr0ZB.mjs} +2 -2
- package/{harness-DQxbts5f.mjs.map → harness-Bgvrr0ZB.mjs.map} +1 -1
- package/index.d.mts +6 -1
- package/index.mjs +20 -14
- package/index.mjs.map +1 -1
- package/{install-CJEnZ9dx.mjs → install-DoO4D3fk.mjs} +4 -4
- package/{install-CJEnZ9dx.mjs.map → install-DoO4D3fk.mjs.map} +1 -1
- package/{lib-CVW4jqJ3.mjs → lib-BkWR53Bz.mjs} +6 -6
- package/{lib-CVW4jqJ3.mjs.map → lib-BkWR53Bz.mjs.map} +1 -1
- package/{lib-HXZBVLKt.mjs → lib-CyynPpjH.mjs} +5 -5
- package/{lib-HXZBVLKt.mjs.map → lib-CyynPpjH.mjs.map} +1 -1
- package/{lib-5d-Jmuz2.mjs → lib-Dw7R2suc.mjs} +5 -5
- package/{lib-5d-Jmuz2.mjs.map → lib-Dw7R2suc.mjs.map} +1 -1
- package/{lib-vrwKjvzk.mjs → lib-JQygPqgO.mjs} +3 -3
- package/{lib-vrwKjvzk.mjs.map → lib-JQygPqgO.mjs.map} +1 -1
- package/{link-D8V3E5iZ.mjs → link-B1zfETsS.mjs} +3 -3
- package/{link-D8V3E5iZ.mjs.map → link-B1zfETsS.mjs.map} +1 -1
- package/{list-DS9BJ3dD.mjs → list-3OR68HpY.mjs} +4 -4
- package/{list-DS9BJ3dD.mjs.map → list-3OR68HpY.mjs.map} +1 -1
- package/{list-BMUDpLRf.mjs → list-CfPfmfe0.mjs} +4 -4
- package/{list-BMUDpLRf.mjs.map → list-CfPfmfe0.mjs.map} +1 -1
- package/login-GFV3Z9f2.mjs +45 -0
- package/login-GFV3Z9f2.mjs.map +1 -0
- package/logout-D17TQUfo.mjs +29 -0
- package/logout-D17TQUfo.mjs.map +1 -0
- package/{p-map-LZ99xLhZ.mjs → p-map-C2WSUhyP.mjs} +2 -2
- package/{p-map-LZ99xLhZ.mjs.map → p-map-C2WSUhyP.mjs.map} +1 -1
- package/package.json +3 -3
- package/{providers-DT5BfXJV.mjs → providers-DLXs9aWZ.mjs} +4 -4
- package/{providers-DT5BfXJV.mjs.map → providers-DLXs9aWZ.mjs.map} +1 -1
- package/refresh-BTNuP1zL.mjs +35 -0
- package/refresh-BTNuP1zL.mjs.map +1 -0
- package/{reload-2GZ_8UBW.mjs → reload-BzwsCBQq.mjs} +3 -3
- package/{reload-2GZ_8UBW.mjs.map → reload-BzwsCBQq.mjs.map} +1 -1
- package/{remove-t8FHVGC0.mjs → remove-DgB3l5JL.mjs} +4 -4
- package/{remove-t8FHVGC0.mjs.map → remove-DgB3l5JL.mjs.map} +1 -1
- package/{run-CP7aAfkf.mjs → run-BVo4XsL6.mjs} +4 -4
- package/{run-CP7aAfkf.mjs.map → run-BVo4XsL6.mjs.map} +1 -1
- package/{runtime-CDSh4qOj.mjs → runtime-Dl621FOp.mjs} +76 -1
- package/runtime-Dl621FOp.mjs.map +1 -0
- package/{serve-DewC8gvV.mjs → serve-Dpep18-A.mjs} +79 -16
- package/serve-Dpep18-A.mjs.map +1 -0
- package/{settings-Bn2pmQXX.mjs → settings-C52IrA72.mjs} +2 -2
- package/{settings-Bn2pmQXX.mjs.map → settings-C52IrA72.mjs.map} +1 -1
- package/shared-Uwjcofff.mjs +115 -0
- package/shared-Uwjcofff.mjs.map +1 -0
- package/status-DPYq2Sx4.mjs +31 -0
- package/status-DPYq2Sx4.mjs.map +1 -0
- package/{type-defs-xvRvQI4T.mjs → type-defs-BZxrtlVD.mjs} +3 -3
- package/{type-defs-xvRvQI4T.mjs.map → type-defs-BZxrtlVD.mjs.map} +1 -1
- package/{update-CLfU-oh7.mjs → update-CJrBbHwq.mjs} +4 -4
- package/{update-CLfU-oh7.mjs.map → update-CJrBbHwq.mjs.map} +1 -1
- package/{valid-BXe5q7ao.mjs → valid-BWgW_TUl.mjs} +2 -2
- package/{valid-BXe5q7ao.mjs.map → valid-BWgW_TUl.mjs.map} +1 -1
- package/error-DTXBm1nO.mjs.map +0 -1
- package/runtime-CDSh4qOj.mjs.map +0 -1
- package/serve-DewC8gvV.mjs.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { i as Cmd, t as handler } from "./runtime-
|
|
1
|
+
import { a as reportFailure, d as writeError, f as writeOut, n as ModelgenError } from "./error-BrbT9_4g.mjs";
|
|
2
|
+
import { i as Cmd, t as handler } from "./runtime-Dl621FOp.mjs";
|
|
3
3
|
import { Effect, FileSystem, Option, Path } from "effect";
|
|
4
4
|
import { generateModels } from "@codeworksh/aikit/modelgen";
|
|
5
5
|
//#region src/cli/cmd/handlers/models/generate.ts
|
|
@@ -32,4 +32,4 @@ var generate_default = handler(Cmd.commands.models.commands.generate, Effect.fn(
|
|
|
32
32
|
//#endregion
|
|
33
33
|
export { generate_default as default };
|
|
34
34
|
|
|
35
|
-
//# sourceMappingURL=generate-
|
|
35
|
+
//# sourceMappingURL=generate-DrGYpD3l.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-
|
|
1
|
+
{"version":3,"file":"generate-DrGYpD3l.mjs","names":["Runtime.handler"],"sources":["../../src/cli/cmd/handlers/models/generate.ts"],"sourcesContent":["import { generateModels } from \"@codeworksh/aikit/modelgen\";\nimport { Effect, FileSystem, Option, Path } from \"effect\";\nimport { Runtime } from \"../../../../framework/runtime.ts\";\nimport { ModelgenError, reportFailure } from \"../../../error.ts\";\nimport { writeError, writeOut } from \"../../../output.ts\";\nimport { Cmd } from \"../../cmd.ts\";\n\nconst DEFAULT_FILENAME = \"models.gen.json\";\n\nconst resolveTarget = Effect.fn(\"CLI.models.resolveTarget\")(function* (inputPath: Option.Option<string>) {\n\tif (Option.isNone(inputPath)) return Option.none<string>();\n\n\tconst path = yield* Path.Path;\n\tconst fs = yield* FileSystem.FileSystem;\n\tconst raw = inputPath.value.trim();\n\tconst asDirectory = raw === \".\" || raw === \"..\" || raw.endsWith(\"/\") || raw.endsWith(\"\\\\\");\n\tconst resolved = path.resolve(raw);\n\tif (asDirectory) return Option.some(path.join(resolved, DEFAULT_FILENAME));\n\n\tconst directory = yield* fs.stat(resolved).pipe(\n\t\tEffect.map((stat) => stat.type === \"Directory\"),\n\t\tEffect.orElseSucceed(() => false),\n\t);\n\treturn Option.some(directory ? path.join(resolved, DEFAULT_FILENAME) : resolved);\n});\n\nexport default Runtime.handler(\n\tCmd.commands.models.commands.generate,\n\tEffect.fn(\"CLI.models.generate\")(function* ({ path }) {\n\t\tconst program = Effect.gen(function* () {\n\t\t\tconst targetPath = yield* resolveTarget(path);\n\t\t\tconst generated = yield* Effect.tryPromise({\n\t\t\t\ttry: () =>\n\t\t\t\t\tgenerateModels(Option.match(targetPath, { onNone: () => ({}), onSome: (value) => ({ path: value }) })),\n\t\t\t\tcatch: (cause) => new ModelgenError({ cause }),\n\t\t\t});\n\t\t\tyield* writeError(`Generated model catalog at ${generated}\\n`);\n\t\t\tyield* writeOut(`${generated}\\n`);\n\t\t});\n\n\t\treturn yield* program.pipe(Effect.catch(reportFailure));\n\t}),\n);\n"],"mappings":";;;;;AAOA,MAAM,mBAAmB;AAEzB,MAAM,gBAAgB,OAAO,GAAG,0BAA0B,CAAC,CAAC,WAAW,WAAkC;CACxG,IAAI,OAAO,OAAO,SAAS,GAAG,OAAO,OAAO,KAAa;CAEzD,MAAM,OAAO,OAAO,KAAK;CACzB,MAAM,KAAK,OAAO,WAAW;CAC7B,MAAM,MAAM,UAAU,MAAM,KAAK;CACjC,MAAM,cAAc,QAAQ,OAAO,QAAQ,QAAQ,IAAI,SAAS,GAAG,KAAK,IAAI,SAAS,IAAI;CACzF,MAAM,WAAW,KAAK,QAAQ,GAAG;CACjC,IAAI,aAAa,OAAO,OAAO,KAAK,KAAK,KAAK,UAAU,gBAAgB,CAAC;CAEzE,MAAM,YAAY,OAAO,GAAG,KAAK,QAAQ,CAAC,CAAC,KAC1C,OAAO,KAAK,SAAS,KAAK,SAAS,WAAW,GAC9C,OAAO,oBAAoB,KAAK,CACjC;CACA,OAAO,OAAO,KAAK,YAAY,KAAK,KAAK,UAAU,gBAAgB,IAAI,QAAQ;AAChF,CAAC;AAED,IAAA,mBAAeA,QACd,IAAI,SAAS,OAAO,SAAS,UAC7B,OAAO,GAAG,qBAAqB,CAAC,CAAC,WAAW,EAAE,QAAQ;CAYrD,OAAO,OAXS,OAAO,IAAI,aAAa;EACvC,MAAM,aAAa,OAAO,cAAc,IAAI;EAC5C,MAAM,YAAY,OAAO,OAAO,WAAW;GAC1C,WACC,eAAe,OAAO,MAAM,YAAY;IAAE,eAAe,CAAC;IAAI,SAAS,WAAW,EAAE,MAAM,MAAM;GAAG,CAAC,CAAC;GACtG,QAAQ,UAAU,IAAI,cAAc,EAAE,MAAM,CAAC;EAC9C,CAAC;EACD,OAAO,WAAW,8BAA8B,UAAU,GAAG;EAC7D,OAAO,SAAS,GAAG,UAAU,GAAG;CACjC,CAEoB,CAAC,CAAC,KAAK,OAAO,MAAM,aAAa,CAAC;AACvD,CAAC,CACF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { nt as sandbox, tt as sandbox$1 } from "./error-BrbT9_4g.mjs";
|
|
2
2
|
import { Option } from "effect";
|
|
3
3
|
//#region src/cli/harness.ts
|
|
4
4
|
/**
|
|
@@ -15,4 +15,4 @@ const harnessOptions = (shared) => ({
|
|
|
15
15
|
//#endregion
|
|
16
16
|
export { harnessOptions as t };
|
|
17
17
|
|
|
18
|
-
//# sourceMappingURL=harness-
|
|
18
|
+
//# sourceMappingURL=harness-Bgvrr0ZB.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"harness-
|
|
1
|
+
{"version":3,"file":"harness-Bgvrr0ZB.mjs","names":["DaytonaSandbox","VercelSandbox"],"sources":["../../src/cli/harness.ts"],"sourcesContent":["import type { Harness } from \"@codeworksh/harness/effect\";\nimport DaytonaSandbox from \"@codeworksh/harness/sandboxes/daytona\";\nimport VercelSandbox from \"@codeworksh/harness/sandboxes/vercel\";\nimport { Option } from \"effect\";\n\ninterface Shared {\n\treadonly userConfigDir: Option.Option<string>;\n\treadonly home: Option.Option<string>;\n\treadonly database: Option.Option<string>;\n}\n\n/**\n * The harness boot options every local-harness command builds from the shared\n * flags. `run` and `serve` must agree on the data directory and driver set --\n * a session created by one is expected to be readable by the other.\n */\nexport const harnessOptions = (shared: Shared): Harness.Options => ({\n\t...(Option.isNone(shared.userConfigDir) ? {} : { userConfigDir: shared.userConfigDir.value }),\n\t...(Option.isNone(shared.home) ? {} : { home: shared.home.value }),\n\t...(Option.isNone(shared.database) ? {} : { database: shared.database.value }),\n\tsandboxes: [DaytonaSandbox.make({}), VercelSandbox.make({})],\n});\n"],"mappings":";;;;;;;;AAgBA,MAAa,kBAAkB,YAAqC;CACnE,GAAI,OAAO,OAAO,OAAO,aAAa,IAAI,CAAC,IAAI,EAAE,eAAe,OAAO,cAAc,MAAM;CAC3F,GAAI,OAAO,OAAO,OAAO,IAAI,IAAI,CAAC,IAAI,EAAE,MAAM,OAAO,KAAK,MAAM;CAChE,GAAI,OAAO,OAAO,OAAO,QAAQ,IAAI,CAAC,IAAI,EAAE,UAAU,OAAO,SAAS,MAAM;CAC5E,WAAW,CAACA,QAAe,KAAK,CAAC,CAAC,GAAGC,UAAc,KAAK,CAAC,CAAC,CAAC;AAC5D"}
|
package/index.d.mts
CHANGED
|
@@ -10,12 +10,17 @@ declare const ModelgenError_base: Schema.Class<ModelgenError, Schema.TaggedStruc
|
|
|
10
10
|
readonly cause: Schema.Defect;
|
|
11
11
|
}>, import("effect/Cause").YieldableError>;
|
|
12
12
|
declare class ModelgenError extends ModelgenError_base {}
|
|
13
|
+
declare const OAuthError_base: Schema.Class<OAuthError, Schema.TaggedStruct<"CLI.OAuthError", {
|
|
14
|
+
readonly message: Schema.String;
|
|
15
|
+
readonly cause: Schema.optional<Schema.Defect>;
|
|
16
|
+
}>, import("effect/Cause").YieldableError>;
|
|
17
|
+
declare class OAuthError extends OAuthError_base {}
|
|
13
18
|
/**
|
|
14
19
|
* Every failure a command handler may surface to the runtime. Harness failures are
|
|
15
20
|
* rendered inside the handler that owns them, so only the CLI's own errors reach
|
|
16
21
|
* the top-level renderer.
|
|
17
22
|
*/
|
|
18
|
-
type CommandError = InvalidInputError | ModelgenError;
|
|
23
|
+
type CommandError = InvalidInputError | ModelgenError | OAuthError;
|
|
19
24
|
//#endregion
|
|
20
25
|
//#region src/index.d.ts
|
|
21
26
|
export declare const main: Effect.Effect<void, CommandError | CliError.CliError>;
|
package/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { i as Cmd, n as handlers, r as run } from "./runtime-
|
|
2
|
+
import { i as Cmd, n as handlers, r as run } from "./runtime-Dl621FOp.mjs";
|
|
3
3
|
import * as NodeRuntime from "@effect/platform-node/NodeRuntime";
|
|
4
4
|
import * as NodeServices from "@effect/platform-node/NodeServices";
|
|
5
5
|
import { Effect } from "effect";
|
|
@@ -8,22 +8,28 @@ var version = "0.0.1";
|
|
|
8
8
|
//#endregion
|
|
9
9
|
//#region src/index.ts
|
|
10
10
|
const Handlers = handlers(Cmd, {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
auth: {
|
|
12
|
+
login: () => import("./login-GFV3Z9f2.mjs"),
|
|
13
|
+
status: () => import("./status-DPYq2Sx4.mjs"),
|
|
14
|
+
refresh: () => import("./refresh-BTNuP1zL.mjs"),
|
|
15
|
+
logout: () => import("./logout-D17TQUfo.mjs")
|
|
16
|
+
},
|
|
17
|
+
run: () => import("./run-BVo4XsL6.mjs"),
|
|
18
|
+
serve: () => import("./serve-Dpep18-A.mjs"),
|
|
19
|
+
session: { link: () => import("./link-B1zfETsS.mjs") },
|
|
14
20
|
plugin: {
|
|
15
|
-
add: () => import("./add
|
|
16
|
-
check: () => import("./check-
|
|
17
|
-
install: () => import("./install-
|
|
18
|
-
list: () => import("./list-
|
|
19
|
-
reload: () => import("./reload-
|
|
20
|
-
remove: () => import("./remove-
|
|
21
|
-
update: () => import("./update-
|
|
21
|
+
add: () => import("./add--i7mPR73.mjs"),
|
|
22
|
+
check: () => import("./check-Dq2WOgap.mjs"),
|
|
23
|
+
install: () => import("./install-DoO4D3fk.mjs"),
|
|
24
|
+
list: () => import("./list-3OR68HpY.mjs"),
|
|
25
|
+
reload: () => import("./reload-BzwsCBQq.mjs"),
|
|
26
|
+
remove: () => import("./remove-DgB3l5JL.mjs"),
|
|
27
|
+
update: () => import("./update-CJrBbHwq.mjs")
|
|
22
28
|
},
|
|
23
29
|
models: {
|
|
24
|
-
$: () => import("./list-
|
|
25
|
-
providers: () => import("./providers-
|
|
26
|
-
generate: () => import("./generate-
|
|
30
|
+
$: () => import("./list-CfPfmfe0.mjs"),
|
|
31
|
+
providers: () => import("./providers-DLXs9aWZ.mjs"),
|
|
32
|
+
generate: () => import("./generate-DrGYpD3l.mjs")
|
|
27
33
|
}
|
|
28
34
|
});
|
|
29
35
|
const main = run(Cmd, Handlers, { version }).pipe(Effect.provide(NodeServices.layer));
|
package/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":["Runtime.handlers","Runtime.run","pkg.version"],"sources":["../../package.json","../../src/index.ts"],"sourcesContent":["","#!/usr/bin/env node\n\nimport * as NodeRuntime from \"@effect/platform-node/NodeRuntime\";\nimport * as NodeServices from \"@effect/platform-node/NodeServices\";\nimport { Effect } from \"effect\";\nimport type { CliError } from \"effect/unstable/cli\";\nimport pkg from \"../package.json\" with { type: \"json\" };\nimport { Cmd } from \"./cli/cmd/cmd.ts\";\nimport type { CommandError } from \"./cli/error.ts\";\nimport { Runtime } from \"./framework/runtime.ts\";\n\nconst Handlers = Runtime.handlers(Cmd, {\n\trun: () => import(\"./cli/cmd/handlers/run.ts\"),\n\tserve: () => import(\"./cli/cmd/handlers/serve.ts\"),\n\tsession: {\n\t\tlink: () => import(\"./cli/cmd/handlers/session/link.ts\"),\n\t},\n\tplugin: {\n\t\tadd: () => import(\"./cli/cmd/handlers/plugin/add.ts\"),\n\t\tcheck: () => import(\"./cli/cmd/handlers/plugin/check.ts\"),\n\t\tinstall: () => import(\"./cli/cmd/handlers/plugin/install.ts\"),\n\t\tlist: () => import(\"./cli/cmd/handlers/plugin/list.ts\"),\n\t\treload: () => import(\"./cli/cmd/handlers/plugin/reload.ts\"),\n\t\tremove: () => import(\"./cli/cmd/handlers/plugin/remove.ts\"),\n\t\tupdate: () => import(\"./cli/cmd/handlers/plugin/update.ts\"),\n\t},\n\tmodels: {\n\t\t$: () => import(\"./cli/cmd/handlers/models/list.ts\"),\n\t\tproviders: () => import(\"./cli/cmd/handlers/models/providers.ts\"),\n\t\tgenerate: () => import(\"./cli/cmd/handlers/models/generate.ts\"),\n\t},\n});\n\nexport const main: Effect.Effect<void, CommandError | CliError.CliError> = Runtime.run(Cmd, Handlers, {\n\tversion: pkg.version,\n}).pipe(Effect.provide(NodeServices.layer));\n\nNodeRuntime.runMain(main);\n"],"mappings":";;;;;;;;;ACWA,MAAM,WAAWA,SAAiB,KAAK;CACtC,WAAW,OAAO;CAClB,aAAa,OAAO;CACpB,SAAS,EACR,YAAY,OAAO,uBACpB;CACA,QAAQ;EACP,WAAW,OAAO;EAClB,aAAa,OAAO;EACpB,eAAe,OAAO;EACtB,YAAY,OAAO;EACnB,cAAc,OAAO;EACrB,cAAc,OAAO;EACrB,cAAc,OAAO;CACtB;CACA,QAAQ;EACP,SAAS,OAAO;EAChB,iBAAiB,OAAO;EACxB,gBAAgB,OAAO;CACxB;AACD,CAAC;AAED,MAAa,OAA8DC,IAAY,KAAK,UAAU,EAC5FC,QACV,CAAC,CAAC,CAAC,KAAK,OAAO,QAAQ,aAAa,KAAK,CAAC;AAE1C,YAAY,QAAQ,IAAI"}
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["Runtime.handlers","Runtime.run","pkg.version"],"sources":["../../package.json","../../src/index.ts"],"sourcesContent":["","#!/usr/bin/env node\n\nimport * as NodeRuntime from \"@effect/platform-node/NodeRuntime\";\nimport * as NodeServices from \"@effect/platform-node/NodeServices\";\nimport { Effect } from \"effect\";\nimport type { CliError } from \"effect/unstable/cli\";\nimport pkg from \"../package.json\" with { type: \"json\" };\nimport { Cmd } from \"./cli/cmd/cmd.ts\";\nimport type { CommandError } from \"./cli/error.ts\";\nimport { Runtime } from \"./framework/runtime.ts\";\n\nconst Handlers = Runtime.handlers(Cmd, {\n\tauth: {\n\t\tlogin: () => import(\"./cli/cmd/handlers/auth/login.ts\"),\n\t\tstatus: () => import(\"./cli/cmd/handlers/auth/status.ts\"),\n\t\trefresh: () => import(\"./cli/cmd/handlers/auth/refresh.ts\"),\n\t\tlogout: () => import(\"./cli/cmd/handlers/auth/logout.ts\"),\n\t},\n\trun: () => import(\"./cli/cmd/handlers/run.ts\"),\n\tserve: () => import(\"./cli/cmd/handlers/serve.ts\"),\n\tsession: {\n\t\tlink: () => import(\"./cli/cmd/handlers/session/link.ts\"),\n\t},\n\tplugin: {\n\t\tadd: () => import(\"./cli/cmd/handlers/plugin/add.ts\"),\n\t\tcheck: () => import(\"./cli/cmd/handlers/plugin/check.ts\"),\n\t\tinstall: () => import(\"./cli/cmd/handlers/plugin/install.ts\"),\n\t\tlist: () => import(\"./cli/cmd/handlers/plugin/list.ts\"),\n\t\treload: () => import(\"./cli/cmd/handlers/plugin/reload.ts\"),\n\t\tremove: () => import(\"./cli/cmd/handlers/plugin/remove.ts\"),\n\t\tupdate: () => import(\"./cli/cmd/handlers/plugin/update.ts\"),\n\t},\n\tmodels: {\n\t\t$: () => import(\"./cli/cmd/handlers/models/list.ts\"),\n\t\tproviders: () => import(\"./cli/cmd/handlers/models/providers.ts\"),\n\t\tgenerate: () => import(\"./cli/cmd/handlers/models/generate.ts\"),\n\t},\n});\n\nexport const main: Effect.Effect<void, CommandError | CliError.CliError> = Runtime.run(Cmd, Handlers, {\n\tversion: pkg.version,\n}).pipe(Effect.provide(NodeServices.layer));\n\nNodeRuntime.runMain(main);\n"],"mappings":";;;;;;;;;ACWA,MAAM,WAAWA,SAAiB,KAAK;CACtC,MAAM;EACL,aAAa,OAAO;EACpB,cAAc,OAAO;EACrB,eAAe,OAAO;EACtB,cAAc,OAAO;CACtB;CACA,WAAW,OAAO;CAClB,aAAa,OAAO;CACpB,SAAS,EACR,YAAY,OAAO,uBACpB;CACA,QAAQ;EACP,WAAW,OAAO;EAClB,aAAa,OAAO;EACpB,eAAe,OAAO;EACtB,YAAY,OAAO;EACnB,cAAc,OAAO;EACrB,cAAc,OAAO;EACrB,cAAc,OAAO;CACtB;CACA,QAAQ;EACP,SAAS,OAAO;EAChB,iBAAiB,OAAO;EACxB,gBAAgB,OAAO;CACxB;AACD,CAAC;AAED,MAAa,OAA8DC,IAAY,KAAK,UAAU,EAC5FC,QACV,CAAC,CAAC,CAAC,KAAK,OAAO,QAAQ,aAAa,KAAK,CAAC;AAE1C,YAAY,QAAQ,IAAI"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { i as Cmd, t as handler } from "./runtime-
|
|
3
|
-
import { r as read, t as fetchable } from "./entries-
|
|
1
|
+
import { B as inspect, U as resolve, a as reportFailure, f as writeOut } from "./error-BrbT9_4g.mjs";
|
|
2
|
+
import { i as Cmd, t as handler } from "./runtime-Dl621FOp.mjs";
|
|
3
|
+
import { r as read, t as fetchable } from "./entries-Gfsq7U4P.mjs";
|
|
4
4
|
import { Effect } from "effect";
|
|
5
5
|
//#region src/cli/cmd/handlers/plugin/install.ts
|
|
6
6
|
/**
|
|
@@ -50,4 +50,4 @@ var install_default = handler(Cmd.commands.plugin.commands.install, Effect.fn("C
|
|
|
50
50
|
//#endregion
|
|
51
51
|
export { install_default as default };
|
|
52
52
|
|
|
53
|
-
//# sourceMappingURL=install-
|
|
53
|
+
//# sourceMappingURL=install-DoO4D3fk.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"install-
|
|
1
|
+
{"version":3,"file":"install-DoO4D3fk.mjs","names":["Runtime.handler","Plugin.resolve","Plugin.inspect"],"sources":["../../src/cli/cmd/handlers/plugin/install.ts"],"sourcesContent":["import { Plugin } from \"@codeworksh/harness/effect\";\nimport { Effect } 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, read } from \"./entries.ts\";\n\n/**\n * `plugin install`, with no argument: the answer to a fresh checkout.\n *\n * A committed `.codework/settings.jsonc` names plugins, the store on a colleague's machine is\n * empty, and something has to materialise them. This is `npm install` with no arguments -- it\n * writes no settings entry, because the entries already exist.\n *\n * It is also what lets **boot stay offline**. Without it the only path from an entry to bytes is a\n * boot that installs, which makes every fresh start a possible network wait; with it, boot\n * resolves or reports, and the error names this command as the remedy.\n */\nexport default Runtime.handler(\n\tCmd.commands.plugin.commands.install,\n\tEffect.fn(\"CLI.plugin.install\")(function* () {\n\t\tconst program = Effect.gen(function* () {\n\t\t\tconst shared = yield* Cmd.spec;\n\t\t\tconst { entries, cache } = yield* read(shared);\n\n\t\t\tlet installed = 0;\n\t\t\tlet present = 0;\n\t\t\tlet local = 0;\n\t\t\tfor (const entry of entries) {\n\t\t\t\tconst target = fetchable(entry.target);\n\t\t\t\tif (target === undefined) {\n\t\t\t\t\t// A local plugin is loaded where it lies and never copied into the store, so\n\t\t\t\t\t// there is nothing to install. An unparseable entry is `list`'s to report.\n\t\t\t\t\tlocal += 1;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif ((yield* Plugin.resolve(target, cache, entry.from)) !== undefined) {\n\t\t\t\t\tpresent += 1;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t// `inspect` installs, imports and validates, so a spec that turns out not to be a\n\t\t\t\t// plugin fails here rather than at the next run. The reported ID comes from the\n\t\t\t\t// module, never from the spec.\n\t\t\t\tconst plugin = yield* Plugin.inspect(entry.reference, { cache, hostDir: entry.from, file: entry.file });\n\t\t\t\tinstalled += 1;\n\t\t\t\tyield* writeOut(`Installed ${entry.reference} (${plugin.id})\\n`);\n\t\t\t}\n\n\t\t\tconst parts = [\n\t\t\t\t`${installed} installed`,\n\t\t\t\t...(present === 0 ? [] : [`${present} already present`]),\n\t\t\t\t...(local === 0 ? [] : [`${local} local`]),\n\t\t\t];\n\t\t\tyield* writeOut(`${parts.join(\", \")}\\n`);\n\t\t});\n\n\t\treturn yield* program.pipe(Effect.catch(reportFailure));\n\t}),\n);\n"],"mappings":";;;;;;;;;;;;;;;;AAmBA,IAAA,kBAAeA,QACd,IAAI,SAAS,OAAO,SAAS,SAC7B,OAAO,GAAG,oBAAoB,CAAC,CAAC,aAAa;CAoC5C,OAAO,OAnCS,OAAO,IAAI,aAAa;EACvC,MAAM,SAAS,OAAO,IAAI;EAC1B,MAAM,EAAE,SAAS,UAAU,OAAO,KAAK,MAAM;EAE7C,IAAI,YAAY;EAChB,IAAI,UAAU;EACd,IAAI,QAAQ;EACZ,KAAK,MAAM,SAAS,SAAS;GAC5B,MAAM,SAAS,UAAU,MAAM,MAAM;GACrC,IAAI,WAAW,KAAA,GAAW;IAGzB,SAAS;IACT;GACD;GACA,KAAK,OAAOC,QAAe,QAAQ,OAAO,MAAM,IAAI,OAAO,KAAA,GAAW;IACrE,WAAW;IACX;GACD;GAIA,MAAM,SAAS,OAAOC,QAAe,MAAM,WAAW;IAAE;IAAO,SAAS,MAAM;IAAM,MAAM,MAAM;GAAK,CAAC;GACtG,aAAa;GACb,OAAO,SAAS,aAAa,MAAM,UAAU,IAAI,OAAO,GAAG,IAAI;EAChE;EAEA,MAAM,QAAQ;GACb,GAAG,UAAU;GACb,GAAI,YAAY,IAAI,CAAC,IAAI,CAAC,GAAG,QAAQ,iBAAiB;GACtD,GAAI,UAAU,IAAI,CAAC,IAAI,CAAC,GAAG,MAAM,OAAO;EACzC;EACA,OAAO,SAAS,GAAG,MAAM,KAAK,IAAI,EAAE,GAAG;CACxC,CAEoB,CAAC,CAAC,KAAK,OAAO,MAAM,aAAa,CAAC;AACvD,CAAC,CACF"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Ct as
|
|
2
|
-
import { c as require_lib$21, f as require_index_min$1, h as require_commonjs$3, i as require_lib$17, l as require_lib$19, n as require_lib$22, o as require_semver, p as require_lib$18, r as require_lib$23, t as require_lib$20, u as require_index_min$2 } from "./lib-
|
|
1
|
+
import { Ct as __commonJSMin, Dt as __toCommonJS, Et as __require, Ot as __toESM, Tt as __exportAll, wt as __esmMin } from "./error-BrbT9_4g.mjs";
|
|
2
|
+
import { c as require_lib$21, f as require_index_min$1, h as require_commonjs$3, i as require_lib$17, l as require_lib$19, n as require_lib$22, o as require_semver, p as require_lib$18, r as require_lib$23, t as require_lib$20, u as require_index_min$2 } from "./lib-JQygPqgO.mjs";
|
|
3
3
|
import { URL as URL$1 } from "url";
|
|
4
4
|
import { once } from "events";
|
|
5
5
|
import assert from "assert";
|
|
@@ -2577,7 +2577,7 @@ var require_entry_index = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
2577
2577
|
const indexDir = bucketDir(cache);
|
|
2578
2578
|
const stream = new Minipass({ objectMode: true });
|
|
2579
2579
|
Promise.resolve().then(async () => {
|
|
2580
|
-
const { default: pMap } = await import("./p-map-
|
|
2580
|
+
const { default: pMap } = await import("./p-map-C2WSUhyP.mjs");
|
|
2581
2581
|
await pMap(await readdirOrEmpty(indexDir), async (bucket) => {
|
|
2582
2582
|
const bucketPath = path$7.join(indexDir, bucket);
|
|
2583
2583
|
const subbuckets = await readdirOrEmpty(bucketPath);
|
|
@@ -3660,7 +3660,7 @@ var require_verify$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
3660
3660
|
}
|
|
3661
3661
|
async function garbageCollect(cache, opts) {
|
|
3662
3662
|
opts.log.silly("verify", "garbage collecting content");
|
|
3663
|
-
const { default: pMap } = await import("./p-map-
|
|
3663
|
+
const { default: pMap } = await import("./p-map-C2WSUhyP.mjs");
|
|
3664
3664
|
const indexStream = index.lsStream(cache);
|
|
3665
3665
|
const liveContent = /* @__PURE__ */ new Set();
|
|
3666
3666
|
indexStream.on("data", (entry) => {
|
|
@@ -3735,7 +3735,7 @@ var require_verify$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
3735
3735
|
}
|
|
3736
3736
|
async function rebuildIndex(cache, opts) {
|
|
3737
3737
|
opts.log.silly("verify", "rebuilding index");
|
|
3738
|
-
const { default: pMap } = await import("./p-map-
|
|
3738
|
+
const { default: pMap } = await import("./p-map-C2WSUhyP.mjs");
|
|
3739
3739
|
const entries = await index.ls(cache);
|
|
3740
3740
|
const stats = {
|
|
3741
3741
|
missingContent: 0,
|
|
@@ -37656,4 +37656,4 @@ var require_lib = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
37656
37656
|
//#endregion
|
|
37657
37657
|
export { require_lib$8 as a, require_lib$15 as c, require_run_script as i, require_lib$16 as l, require_lib$2 as n, require_lib$11 as o, require_lib$5 as r, require_lib$13 as s, require_lib as t };
|
|
37658
37658
|
|
|
37659
|
-
//# sourceMappingURL=lib-
|
|
37659
|
+
//# sourceMappingURL=lib-BkWR53Bz.mjs.map
|