@codeworksh/cli 0.0.1-dev.20260918040208 → 0.0.1-dev.20260922135856

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.
Files changed (64) hide show
  1. package/README.md +51 -0
  2. package/add-D7X5BuCv.mjs +81 -0
  3. package/add-D7X5BuCv.mjs.map +1 -0
  4. package/{catalog-DobwC9tt.mjs → catalog-DL8yWdvI.mjs} +2 -2
  5. package/{catalog-DobwC9tt.mjs.map → catalog-DL8yWdvI.mjs.map} +1 -1
  6. package/check-M9CqztTk.mjs +47 -0
  7. package/check-M9CqztTk.mjs.map +1 -0
  8. package/commonjs-CiyyOsS6.mjs +160 -0
  9. package/commonjs-CiyyOsS6.mjs.map +1 -0
  10. package/definitions-ClJIBYEm.mjs +3348 -0
  11. package/definitions-ClJIBYEm.mjs.map +1 -0
  12. package/entries-DBdy6ahj.mjs +48 -0
  13. package/entries-DBdy6ahj.mjs.map +1 -0
  14. package/{error-Cr8LvfEq.mjs → error-DTXBm1nO.mjs} +2324 -5136
  15. package/error-DTXBm1nO.mjs.map +1 -0
  16. package/{generate-BMJEbGEP.mjs → generate-C5NElYXe.mjs} +3 -3
  17. package/{generate-BMJEbGEP.mjs.map → generate-C5NElYXe.mjs.map} +1 -1
  18. package/{harness-hle7yBVs.mjs → harness-DQxbts5f.mjs} +2 -2
  19. package/{harness-hle7yBVs.mjs.map → harness-DQxbts5f.mjs.map} +1 -1
  20. package/index.mjs +16 -6
  21. package/index.mjs.map +1 -1
  22. package/install-CJEnZ9dx.mjs +53 -0
  23. package/install-CJEnZ9dx.mjs.map +1 -0
  24. package/lib-5d-Jmuz2.mjs +16078 -0
  25. package/lib-5d-Jmuz2.mjs.map +1 -0
  26. package/lib-CVW4jqJ3.mjs +37659 -0
  27. package/lib-CVW4jqJ3.mjs.map +1 -0
  28. package/lib-HXZBVLKt.mjs +846 -0
  29. package/lib-HXZBVLKt.mjs.map +1 -0
  30. package/lib-vrwKjvzk.mjs +10868 -0
  31. package/lib-vrwKjvzk.mjs.map +1 -0
  32. package/link-D8V3E5iZ.mjs +40 -0
  33. package/link-D8V3E5iZ.mjs.map +1 -0
  34. package/{list-crXAfyCe.mjs → list-BMUDpLRf.mjs} +4 -4
  35. package/{list-crXAfyCe.mjs.map → list-BMUDpLRf.mjs.map} +1 -1
  36. package/list-DS9BJ3dD.mjs +76 -0
  37. package/list-DS9BJ3dD.mjs.map +1 -0
  38. package/p-map-LZ99xLhZ.mjs +116 -0
  39. package/p-map-LZ99xLhZ.mjs.map +1 -0
  40. package/package.json +14 -8
  41. package/{providers-BcJ_s8zf.mjs → providers-DT5BfXJV.mjs} +4 -4
  42. package/{providers-BcJ_s8zf.mjs.map → providers-DT5BfXJV.mjs.map} +1 -1
  43. package/reload-2GZ_8UBW.mjs +26 -0
  44. package/reload-2GZ_8UBW.mjs.map +1 -0
  45. package/remove-t8FHVGC0.mjs +36 -0
  46. package/remove-t8FHVGC0.mjs.map +1 -0
  47. package/{run-B4mqUQsS.mjs → run-CP7aAfkf.mjs} +11 -8
  48. package/run-CP7aAfkf.mjs.map +1 -0
  49. package/{runtime-DuL-GGrx.mjs → runtime-CDSh4qOj.mjs} +108 -1
  50. package/runtime-CDSh4qOj.mjs.map +1 -0
  51. package/{serve-CRUpKDkt.mjs → serve-DewC8gvV.mjs} +19 -6
  52. package/serve-DewC8gvV.mjs.map +1 -0
  53. package/settings-Bn2pmQXX.mjs +215 -0
  54. package/settings-Bn2pmQXX.mjs.map +1 -0
  55. package/type-defs-xvRvQI4T.mjs +538 -0
  56. package/type-defs-xvRvQI4T.mjs.map +1 -0
  57. package/update-CLfU-oh7.mjs +44 -0
  58. package/update-CLfU-oh7.mjs.map +1 -0
  59. package/valid-BXe5q7ao.mjs +354 -0
  60. package/valid-BXe5q7ao.mjs.map +1 -0
  61. package/error-Cr8LvfEq.mjs.map +0 -1
  62. package/run-B4mqUQsS.mjs.map +0 -1
  63. package/runtime-DuL-GGrx.mjs.map +0 -1
  64. package/serve-CRUpKDkt.mjs.map +0 -1
@@ -1,5 +1,5 @@
1
- import { d as writeOut, i as reportFailure, n as ModelgenError, u as writeError } from "./error-Cr8LvfEq.mjs";
2
- import { i as Cmd, t as handler } from "./runtime-DuL-GGrx.mjs";
1
+ import { d as writeOut, i as reportFailure, n as ModelgenError, u as writeError } from "./error-DTXBm1nO.mjs";
2
+ import { i as Cmd, t as handler } from "./runtime-CDSh4qOj.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-BMJEbGEP.mjs.map
35
+ //# sourceMappingURL=generate-C5NElYXe.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"generate-BMJEbGEP.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
+ {"version":3,"file":"generate-C5NElYXe.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 { N as sandbox$1, P as sandbox } from "./error-Cr8LvfEq.mjs";
1
+ import { $ as sandbox$1, et as sandbox } from "./error-DTXBm1nO.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-hle7yBVs.mjs.map
18
+ //# sourceMappingURL=harness-DQxbts5f.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"harness-hle7yBVs.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"}
1
+ {"version":3,"file":"harness-DQxbts5f.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.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-DuL-GGrx.mjs";
2
+ import { i as Cmd, n as handlers, r as run } from "./runtime-CDSh4qOj.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,12 +8,22 @@ var version = "0.0.1";
8
8
  //#endregion
9
9
  //#region src/index.ts
10
10
  const Handlers = handlers(Cmd, {
11
- run: () => import("./run-B4mqUQsS.mjs"),
12
- serve: () => import("./serve-CRUpKDkt.mjs"),
11
+ run: () => import("./run-CP7aAfkf.mjs"),
12
+ serve: () => import("./serve-DewC8gvV.mjs"),
13
+ session: { link: () => import("./link-D8V3E5iZ.mjs") },
14
+ plugin: {
15
+ add: () => import("./add-D7X5BuCv.mjs"),
16
+ check: () => import("./check-M9CqztTk.mjs"),
17
+ install: () => import("./install-CJEnZ9dx.mjs"),
18
+ list: () => import("./list-DS9BJ3dD.mjs"),
19
+ reload: () => import("./reload-2GZ_8UBW.mjs"),
20
+ remove: () => import("./remove-t8FHVGC0.mjs"),
21
+ update: () => import("./update-CLfU-oh7.mjs")
22
+ },
13
23
  models: {
14
- $: () => import("./list-crXAfyCe.mjs"),
15
- providers: () => import("./providers-BcJ_s8zf.mjs"),
16
- generate: () => import("./generate-BMJEbGEP.mjs")
24
+ $: () => import("./list-BMUDpLRf.mjs"),
25
+ providers: () => import("./providers-DT5BfXJV.mjs"),
26
+ generate: () => import("./generate-C5NElYXe.mjs")
17
27
  }
18
28
  });
19
29
  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\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,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\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"}
@@ -0,0 +1,53 @@
1
+ import { R as inspect, V as resolve, d as writeOut, i as reportFailure } from "./error-DTXBm1nO.mjs";
2
+ import { i as Cmd, t as handler } from "./runtime-CDSh4qOj.mjs";
3
+ import { r as read, t as fetchable } from "./entries-DBdy6ahj.mjs";
4
+ import { Effect } from "effect";
5
+ //#region src/cli/cmd/handlers/plugin/install.ts
6
+ /**
7
+ * `plugin install`, with no argument: the answer to a fresh checkout.
8
+ *
9
+ * A committed `.codework/settings.jsonc` names plugins, the store on a colleague's machine is
10
+ * empty, and something has to materialise them. This is `npm install` with no arguments -- it
11
+ * writes no settings entry, because the entries already exist.
12
+ *
13
+ * It is also what lets **boot stay offline**. Without it the only path from an entry to bytes is a
14
+ * boot that installs, which makes every fresh start a possible network wait; with it, boot
15
+ * resolves or reports, and the error names this command as the remedy.
16
+ */
17
+ var install_default = handler(Cmd.commands.plugin.commands.install, Effect.fn("CLI.plugin.install")(function* () {
18
+ return yield* Effect.gen(function* () {
19
+ const shared = yield* Cmd.spec;
20
+ const { entries, cache } = yield* read(shared);
21
+ let installed = 0;
22
+ let present = 0;
23
+ let local = 0;
24
+ for (const entry of entries) {
25
+ const target = fetchable(entry.target);
26
+ if (target === void 0) {
27
+ local += 1;
28
+ continue;
29
+ }
30
+ if ((yield* resolve(target, cache, entry.from)) !== void 0) {
31
+ present += 1;
32
+ continue;
33
+ }
34
+ const plugin = yield* inspect(entry.reference, {
35
+ cache,
36
+ hostDir: entry.from,
37
+ file: entry.file
38
+ });
39
+ installed += 1;
40
+ yield* writeOut(`Installed ${entry.reference} (${plugin.id})\n`);
41
+ }
42
+ const parts = [
43
+ `${installed} installed`,
44
+ ...present === 0 ? [] : [`${present} already present`],
45
+ ...local === 0 ? [] : [`${local} local`]
46
+ ];
47
+ yield* writeOut(`${parts.join(", ")}\n`);
48
+ }).pipe(Effect.catch(reportFailure));
49
+ }));
50
+ //#endregion
51
+ export { install_default as default };
52
+
53
+ //# sourceMappingURL=install-CJEnZ9dx.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"install-CJEnZ9dx.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"}