@codeworksh/cli 0.7.0 → 0.8.0-dev.20261106090116

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 (92) hide show
  1. package/{acp-GGhof_w_.mjs → acp-DeWVsQOe.mjs} +3 -3
  2. package/{acp-GGhof_w_.mjs.map → acp-DeWVsQOe.mjs.map} +1 -1
  3. package/{add-CGjQkVRs.mjs → add-31QB-o0_.mjs} +4 -4
  4. package/{add-CGjQkVRs.mjs.map → add-31QB-o0_.mjs.map} +1 -1
  5. package/{add-DArbv6Op.mjs → add-Dgy0iTEQ.mjs} +3 -3
  6. package/{add-DArbv6Op.mjs.map → add-Dgy0iTEQ.mjs.map} +1 -1
  7. package/{check-BRHzx5p0.mjs → check-BoANDJxT.mjs} +3 -3
  8. package/{check-BRHzx5p0.mjs.map → check-BoANDJxT.mjs.map} +1 -1
  9. package/{control-F0bo3rXh.mjs → control-CQxWGS4k.mjs} +4 -4
  10. package/{control-F0bo3rXh.mjs.map → control-CQxWGS4k.mjs.map} +1 -1
  11. package/disconnect-BiLuV4JZ.mjs +2 -0
  12. package/{entries-DnbFTTLU.mjs → entries-DpL4xhu0.mjs} +3 -3
  13. package/{entries-DnbFTTLU.mjs.map → entries-DpL4xhu0.mjs.map} +1 -1
  14. package/{error--BWou73I.mjs → error-CPyvkO4x.mjs} +189 -6
  15. package/error-CPyvkO4x.mjs.map +1 -0
  16. package/{fork-DlhNFPUB.mjs → fork-CjZteIbk.mjs} +3 -3
  17. package/{fork-DlhNFPUB.mjs.map → fork-CjZteIbk.mjs.map} +1 -1
  18. package/{identity-Bcl1KlX-.mjs → identity-CXCKJL3z.mjs} +2 -2
  19. package/{identity-Bcl1KlX-.mjs.map → identity-CXCKJL3z.mjs.map} +1 -1
  20. package/index.mjs +33 -33
  21. package/{install-DRJ5KKyb.mjs → install-BUfEBtrj.mjs} +3 -3
  22. package/{install-DRJ5KKyb.mjs.map → install-BUfEBtrj.mjs.map} +1 -1
  23. package/{jsonc-Cel7I0yd.mjs → jsonc-Ca0uQLm-.mjs} +2 -2
  24. package/{jsonc-Cel7I0yd.mjs.map → jsonc-Ca0uQLm-.mjs.map} +1 -1
  25. package/{link-CJE1PRTf.mjs → link-ZuzWj9qt.mjs} +2 -2
  26. package/{link-CJE1PRTf.mjs.map → link-ZuzWj9qt.mjs.map} +1 -1
  27. package/{list-B3kSn78f.mjs → list-6QTwXTKO.mjs} +3 -3
  28. package/{list-B3kSn78f.mjs.map → list-6QTwXTKO.mjs.map} +1 -1
  29. package/{list-Cf-zESJf.mjs → list-BnIIcMI3.mjs} +2 -2
  30. package/{list-Cf-zESJf.mjs.map → list-BnIIcMI3.mjs.map} +1 -1
  31. package/{list-TLhgvlKp.mjs → list-DDuzyNv0.mjs} +2 -2
  32. package/{list-TLhgvlKp.mjs.map → list-DDuzyNv0.mjs.map} +1 -1
  33. package/{list-Df4ngZjL.mjs → list-DPbF2uMB.mjs} +3 -3
  34. package/{list-Df4ngZjL.mjs.map → list-DPbF2uMB.mjs.map} +1 -1
  35. package/{login-oWLqnAQK.mjs → login-BtuROCPJ.mjs} +3 -3
  36. package/{login-oWLqnAQK.mjs.map → login-BtuROCPJ.mjs.map} +1 -1
  37. package/{login-BJ3d7FM_.mjs → login-CGXU21AK.mjs} +3 -3
  38. package/{login-BJ3d7FM_.mjs.map → login-CGXU21AK.mjs.map} +1 -1
  39. package/{logout-D44pgH6b.mjs → logout-Bnk2hxfZ.mjs} +3 -3
  40. package/{logout-D44pgH6b.mjs.map → logout-Bnk2hxfZ.mjs.map} +1 -1
  41. package/{logout-ClrNQ8LO.mjs → logout-DUn8KSjX.mjs} +3 -3
  42. package/{logout-ClrNQ8LO.mjs.map → logout-DUn8KSjX.mjs.map} +1 -1
  43. package/package-b1hY7JGl.mjs +6 -0
  44. package/package-b1hY7JGl.mjs.map +1 -0
  45. package/package.json +3 -3
  46. package/{providers-ozcPo-AJ.mjs → providers-GEdlDJHp.mjs} +2 -2
  47. package/{providers-ozcPo-AJ.mjs.map → providers-GEdlDJHp.mjs.map} +1 -1
  48. package/reconnect-ChE5ETwx.mjs +2 -0
  49. package/{refresh-B6iT5eWN.mjs → refresh-93t2pSpb.mjs} +2 -2
  50. package/{refresh-B6iT5eWN.mjs.map → refresh-93t2pSpb.mjs.map} +1 -1
  51. package/{refresh-CH7lLrF3.mjs → refresh-DGJW3rSp.mjs} +3 -3
  52. package/{refresh-CH7lLrF3.mjs.map → refresh-DGJW3rSp.mjs.map} +1 -1
  53. package/{relink-BvrynRLV.mjs → relink-Djy5t7D2.mjs} +3 -3
  54. package/{relink-BvrynRLV.mjs.map → relink-Djy5t7D2.mjs.map} +1 -1
  55. package/{reload-qYk-KlpL.mjs → reload-Dm464rPC.mjs} +2 -2
  56. package/{reload-qYk-KlpL.mjs.map → reload-Dm464rPC.mjs.map} +1 -1
  57. package/{remove-Be5ytOgR.mjs → remove-DBT19X2j.mjs} +3 -3
  58. package/{remove-Be5ytOgR.mjs.map → remove-DBT19X2j.mjs.map} +1 -1
  59. package/{remove-CTzOWKTq.mjs → remove-f7C_vEOD.mjs} +4 -4
  60. package/{remove-CTzOWKTq.mjs.map → remove-f7C_vEOD.mjs.map} +1 -1
  61. package/{restart-Dhlrvevr.mjs → restart-Cu3FmNqT.mjs} +3 -3
  62. package/{restart-Dhlrvevr.mjs.map → restart-Cu3FmNqT.mjs.map} +1 -1
  63. package/{run-BX65GBq_.mjs → run-CTFksYXE.mjs} +3 -3
  64. package/{run-BX65GBq_.mjs.map → run-CTFksYXE.mjs.map} +1 -1
  65. package/{serve-y19CU2VR.mjs → serve-CCSTypjf.mjs} +171 -31
  66. package/serve-CCSTypjf.mjs.map +1 -0
  67. package/{service-Df8gDfve.mjs → service-BPaZTjoE.mjs} +3 -3
  68. package/{service-Df8gDfve.mjs.map → service-BPaZTjoE.mjs.map} +1 -1
  69. package/{settings-BzAk8lIo.mjs → settings-DasbTMFs.mjs} +3 -3
  70. package/{settings-BzAk8lIo.mjs.map → settings-DasbTMFs.mjs.map} +1 -1
  71. package/{shared-BnR3BFZM.mjs → shared-CDyNsYBy.mjs} +3 -3
  72. package/{shared-BnR3BFZM.mjs.map → shared-CDyNsYBy.mjs.map} +1 -1
  73. package/{shared-BU8-Q5m8.mjs → shared-CiSbTY59.mjs} +2 -2
  74. package/{shared-BU8-Q5m8.mjs.map → shared-CiSbTY59.mjs.map} +1 -1
  75. package/{start-DrVnKdfd.mjs → start-CIXXEF_C.mjs} +3 -3
  76. package/{start-DrVnKdfd.mjs.map → start-CIXXEF_C.mjs.map} +1 -1
  77. package/{status-B-AAul1G.mjs → status-CHcJyF_7.mjs} +3 -3
  78. package/{status-B-AAul1G.mjs.map → status-CHcJyF_7.mjs.map} +1 -1
  79. package/{status-BrL3Eecl.mjs → status-GEavIY5x.mjs} +3 -3
  80. package/{status-BrL3Eecl.mjs.map → status-GEavIY5x.mjs.map} +1 -1
  81. package/{stop-D-OJCp9e.mjs → stop-CFrBVQnf.mjs} +3 -3
  82. package/{stop-D-OJCp9e.mjs.map → stop-CFrBVQnf.mjs.map} +1 -1
  83. package/{thread-BuNept5V.mjs → thread-I6vNdC0y.mjs} +2 -2
  84. package/{thread-BuNept5V.mjs.map → thread-I6vNdC0y.mjs.map} +1 -1
  85. package/{update-DoS5AWg6.mjs → update-C3llbIB0.mjs} +3 -3
  86. package/{update-DoS5AWg6.mjs.map → update-C3llbIB0.mjs.map} +1 -1
  87. package/disconnect-DemFNh2P.mjs +0 -2
  88. package/error--BWou73I.mjs.map +0 -1
  89. package/package-CDB-uxy3.mjs +0 -6
  90. package/package-CDB-uxy3.mjs.map +0 -1
  91. package/reconnect-BcJtQx3U.mjs +0 -2
  92. package/serve-y19CU2VR.mjs.map +0 -1
package/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { t as version } from "./package-CDB-uxy3.mjs";
2
+ import { t as version } from "./package-b1hY7JGl.mjs";
3
3
  import { i as Cmd, n as handlers, r as run } from "./runtime-CK2CunDw.mjs";
4
4
  import * as NodeRuntime from "@effect/platform-node/NodeRuntime";
5
5
  import * as NodeServices from "@effect/platform-node/NodeServices";
@@ -7,50 +7,50 @@ import { Effect } from "effect";
7
7
  //#region src/index.ts
8
8
  const Handlers = handlers(Cmd, {
9
9
  auth: {
10
- login: () => import("./login-oWLqnAQK.mjs"),
11
- status: () => import("./status-B-AAul1G.mjs"),
12
- refresh: () => import("./refresh-CH7lLrF3.mjs"),
13
- logout: () => import("./logout-ClrNQ8LO.mjs")
10
+ login: () => import("./login-BtuROCPJ.mjs"),
11
+ status: () => import("./status-CHcJyF_7.mjs"),
12
+ refresh: () => import("./refresh-DGJW3rSp.mjs"),
13
+ logout: () => import("./logout-DUn8KSjX.mjs")
14
14
  },
15
15
  mcp: {
16
- add: () => import("./add-CGjQkVRs.mjs"),
17
- remove: () => import("./remove-CTzOWKTq.mjs"),
18
- list: () => import("./list-B3kSn78f.mjs"),
19
- login: () => import("./login-BJ3d7FM_.mjs"),
20
- logout: () => import("./logout-D44pgH6b.mjs"),
21
- reconnect: () => import("./reconnect-BcJtQx3U.mjs"),
22
- disconnect: () => import("./disconnect-DemFNh2P.mjs")
16
+ add: () => import("./add-31QB-o0_.mjs"),
17
+ remove: () => import("./remove-f7C_vEOD.mjs"),
18
+ list: () => import("./list-6QTwXTKO.mjs"),
19
+ login: () => import("./login-CGXU21AK.mjs"),
20
+ logout: () => import("./logout-Bnk2hxfZ.mjs"),
21
+ reconnect: () => import("./reconnect-ChE5ETwx.mjs"),
22
+ disconnect: () => import("./disconnect-BiLuV4JZ.mjs")
23
23
  },
24
- run: () => import("./run-BX65GBq_.mjs"),
25
- serve: () => import("./serve-y19CU2VR.mjs"),
24
+ run: () => import("./run-CTFksYXE.mjs"),
25
+ serve: () => import("./serve-CCSTypjf.mjs"),
26
26
  service: {
27
- start: () => import("./start-DrVnKdfd.mjs"),
28
- restart: () => import("./restart-Dhlrvevr.mjs"),
29
- status: () => import("./status-BrL3Eecl.mjs"),
30
- stop: () => import("./stop-D-OJCp9e.mjs")
27
+ start: () => import("./start-CIXXEF_C.mjs"),
28
+ restart: () => import("./restart-Cu3FmNqT.mjs"),
29
+ status: () => import("./status-GEavIY5x.mjs"),
30
+ stop: () => import("./stop-CFrBVQnf.mjs")
31
31
  },
32
32
  session: {
33
- link: () => import("./link-CJE1PRTf.mjs"),
34
- relink: () => import("./relink-BvrynRLV.mjs")
33
+ link: () => import("./link-ZuzWj9qt.mjs"),
34
+ relink: () => import("./relink-Djy5t7D2.mjs")
35
35
  },
36
36
  thread: {
37
- list: () => import("./list-TLhgvlKp.mjs"),
38
- fork: () => import("./fork-DlhNFPUB.mjs")
37
+ list: () => import("./list-DDuzyNv0.mjs"),
38
+ fork: () => import("./fork-CjZteIbk.mjs")
39
39
  },
40
- acp: () => import("./acp-GGhof_w_.mjs"),
40
+ acp: () => import("./acp-DeWVsQOe.mjs"),
41
41
  plugin: {
42
- add: () => import("./add-DArbv6Op.mjs"),
43
- check: () => import("./check-BRHzx5p0.mjs"),
44
- install: () => import("./install-DRJ5KKyb.mjs"),
45
- list: () => import("./list-Df4ngZjL.mjs"),
46
- reload: () => import("./reload-qYk-KlpL.mjs"),
47
- remove: () => import("./remove-Be5ytOgR.mjs"),
48
- update: () => import("./update-DoS5AWg6.mjs")
42
+ add: () => import("./add-Dgy0iTEQ.mjs"),
43
+ check: () => import("./check-BoANDJxT.mjs"),
44
+ install: () => import("./install-BUfEBtrj.mjs"),
45
+ list: () => import("./list-DPbF2uMB.mjs"),
46
+ reload: () => import("./reload-Dm464rPC.mjs"),
47
+ remove: () => import("./remove-DBT19X2j.mjs"),
48
+ update: () => import("./update-C3llbIB0.mjs")
49
49
  },
50
50
  models: {
51
- $: () => import("./list-Cf-zESJf.mjs"),
52
- providers: () => import("./providers-ozcPo-AJ.mjs"),
53
- refresh: () => import("./refresh-B6iT5eWN.mjs")
51
+ $: () => import("./list-BnIIcMI3.mjs"),
52
+ providers: () => import("./providers-GEdlDJHp.mjs"),
53
+ refresh: () => import("./refresh-93t2pSpb.mjs")
54
54
  }
55
55
  });
56
56
  const main = run(Cmd, Handlers, { version }).pipe(Effect.provide(NodeServices.layer));
@@ -1,6 +1,6 @@
1
1
  import { i as Cmd, t as handler } from "./runtime-CK2CunDw.mjs";
2
- import { f as writeOut, i as reportFailure } from "./error--BWou73I.mjs";
3
- import { i as read, t as fetchable } from "./entries-DnbFTTLU.mjs";
2
+ import { f as writeOut, i as reportFailure } from "./error-CPyvkO4x.mjs";
3
+ import { i as read, t as fetchable } from "./entries-DpL4xhu0.mjs";
4
4
  import { Effect } from "effect";
5
5
  import { Plugin } from "@codeworksh/harness/effect";
6
6
  //#region src/cli/cmd/handlers/plugin/install.ts
@@ -51,4 +51,4 @@ var install_default = handler(Cmd.commands.plugin.commands.install, Effect.fn("C
51
51
  //#endregion
52
52
  export { install_default as default };
53
53
 
54
- //# sourceMappingURL=install-DRJ5KKyb.mjs.map
54
+ //# sourceMappingURL=install-BUfEBtrj.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"install-DRJ5KKyb.mjs","names":["Runtime.handler"],"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,OAAO,OAAO,QAAQ,QAAQ,OAAO,MAAM,IAAI,OAAO,KAAA,GAAW;IACrE,WAAW;IACX;GACD;GAIA,MAAM,SAAS,OAAO,OAAO,QAAQ,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
+ {"version":3,"file":"install-BUfEBtrj.mjs","names":["Runtime.handler"],"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,OAAO,OAAO,QAAQ,QAAQ,OAAO,MAAM,IAAI,OAAO,KAAA,GAAW;IACrE,WAAW;IACX;GACD;GAIA,MAAM,SAAS,OAAO,OAAO,QAAQ,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,4 +1,4 @@
1
- import { t as InvalidInputError } from "./error--BWou73I.mjs";
1
+ import { t as InvalidInputError } from "./error-CPyvkO4x.mjs";
2
2
  import { Effect, FileSystem, Path } from "effect";
3
3
  import { Plugin } from "@codeworksh/harness/effect";
4
4
  import { applyEdits, modify, parse } from "jsonc-parser";
@@ -55,4 +55,4 @@ const locked = (path, edit) => Effect.gen(function* () {
55
55
  //#endregion
56
56
  export { read as n, write as r, locked as t };
57
57
 
58
- //# sourceMappingURL=jsonc-Cel7I0yd.mjs.map
58
+ //# sourceMappingURL=jsonc-Ca0uQLm-.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"jsonc-Cel7I0yd.mjs","names":["parseJsonc"],"sources":["../../src/cli/jsonc.ts"],"sourcesContent":["import { Plugin } from \"@codeworksh/harness/effect\";\nimport { Effect, FileSystem, Path } from \"effect\";\nimport { applyEdits, modify, parse as parseJsonc, type ParseError } from \"jsonc-parser\";\nimport { InvalidInputError } from \"./error.ts\";\n\n/**\n * Reading and rewriting one value of a JSONC file the CLI edits for its owner: `settings.jsonc`,\n * `mcp.json`.\n *\n * Edits go through `jsonc-parser`, so a hand-written file keeps its comments, key order and\n * formatting. The write is a temp file renamed over the original, so an interrupted run leaves the\n * previous file intact rather than a half-written document.\n */\n\n/** The file's text and its top-level object; a missing file reads as `{}`. */\nexport const read = Effect.fn(\"CLI.jsonc.read\")(function* (path: string, what: string) {\n\tconst fs = yield* FileSystem.FileSystem;\n\tconst source = (yield* fs.exists(path)) ? yield* fs.readFileString(path) : \"{}\";\n\tconst errors: ParseError[] = [];\n\tconst document: unknown = parseJsonc(source, errors, { allowTrailingComma: true });\n\tif (errors.length > 0 || typeof document !== \"object\" || document === null || Array.isArray(document)) {\n\t\treturn yield* new InvalidInputError({ message: `${path} is not a valid ${what}` });\n\t}\n\treturn { source, document: document as Record<string, unknown> };\n});\n\n/** Set the value at `at` in `source`, or remove it when `value` is undefined, and write the file. */\nexport const write = Effect.fn(\"CLI.jsonc.write\")(function* (\n\tpath: string,\n\tsource: string,\n\tat: ReadonlyArray<string>,\n\tvalue: unknown,\n) {\n\tconst fs = yield* FileSystem.FileSystem;\n\tconst nodePath = yield* Path.Path;\n\t// A removal is not formatted: the formatter would reflow the sibling before it as well.\n\tconst edited = applyEdits(\n\t\tsource,\n\t\tmodify(\n\t\t\tsource,\n\t\t\t[...at],\n\t\t\tvalue,\n\t\t\tvalue === undefined ? {} : { formattingOptions: { tabSize: 2, insertSpaces: false } },\n\t\t),\n\t);\n\tconst directory = nodePath.dirname(path);\n\tyield* fs.makeDirectory(directory, { recursive: true });\n\tconst mode = (yield* fs.exists(path)) ? (yield* fs.stat(path)).mode & 0o777 : 0o600;\n\tconst temporary = yield* fs.makeTempFile({ directory, prefix: `.${nodePath.basename(path)}.`, suffix: \".tmp\" });\n\tyield* fs\n\t\t.writeFileString(temporary, edited.endsWith(\"\\n\") ? edited : `${edited}\\n`)\n\t\t.pipe(\n\t\t\tEffect.andThen(fs.chmod(temporary, mode)),\n\t\t\tEffect.andThen(fs.rename(temporary, path)),\n\t\t\tEffect.ensuring(fs.remove(temporary, { force: true }).pipe(Effect.ignore)),\n\t\t);\n});\n\n/**\n * Serialize one read-modify-rename of `path` across CLI processes. Only the local edit is locked, so\n * work that precedes it does not wait behind another process.\n */\nexport const locked = <A, E, R>(path: string, edit: Effect.Effect<A, E, R>) =>\n\tEffect.gen(function* () {\n\t\tconst fs = yield* FileSystem.FileSystem;\n\t\tconst nodePath = yield* Path.Path;\n\t\tyield* fs.makeDirectory(nodePath.dirname(path), { recursive: true });\n\t\tyield* Plugin.settingsLock(\n\t\t\t`${path}.lock`,\n\t\t\t() => new InvalidInputError({ message: `timed out waiting to edit ${path}` }),\n\t\t);\n\t\treturn yield* edit;\n\t}).pipe(Effect.scoped);\n\nexport * as Jsonc from \"./jsonc.ts\";\n"],"mappings":";;;;;;;;;;;;;;AAeA,MAAa,OAAO,OAAO,GAAG,gBAAgB,CAAC,CAAC,WAAW,MAAc,MAAc;CACtF,MAAM,KAAK,OAAO,WAAW;CAC7B,MAAM,UAAU,OAAO,GAAG,OAAO,IAAI,KAAK,OAAO,GAAG,eAAe,IAAI,IAAI;CAC3E,MAAM,SAAuB,CAAC;CAC9B,MAAM,WAAoBA,MAAW,QAAQ,QAAQ,EAAE,oBAAoB,KAAK,CAAC;CACjF,IAAI,OAAO,SAAS,KAAK,OAAO,aAAa,YAAY,aAAa,QAAQ,MAAM,QAAQ,QAAQ,GACnG,OAAO,OAAO,IAAI,kBAAkB,EAAE,SAAS,GAAG,KAAK,kBAAkB,OAAO,CAAC;CAElF,OAAO;EAAE;EAAkB;CAAo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AC,CAAC,KAAK,OAAO,MAAM"}
1
+ {"version":3,"file":"jsonc-Ca0uQLm-.mjs","names":["parseJsonc"],"sources":["../../src/cli/jsonc.ts"],"sourcesContent":["import { Plugin } from \"@codeworksh/harness/effect\";\nimport { Effect, FileSystem, Path } from \"effect\";\nimport { applyEdits, modify, parse as parseJsonc, type ParseError } from \"jsonc-parser\";\nimport { InvalidInputError } from \"./error.ts\";\n\n/**\n * Reading and rewriting one value of a JSONC file the CLI edits for its owner: `settings.jsonc`,\n * `mcp.json`.\n *\n * Edits go through `jsonc-parser`, so a hand-written file keeps its comments, key order and\n * formatting. The write is a temp file renamed over the original, so an interrupted run leaves the\n * previous file intact rather than a half-written document.\n */\n\n/** The file's text and its top-level object; a missing file reads as `{}`. */\nexport const read = Effect.fn(\"CLI.jsonc.read\")(function* (path: string, what: string) {\n\tconst fs = yield* FileSystem.FileSystem;\n\tconst source = (yield* fs.exists(path)) ? yield* fs.readFileString(path) : \"{}\";\n\tconst errors: ParseError[] = [];\n\tconst document: unknown = parseJsonc(source, errors, { allowTrailingComma: true });\n\tif (errors.length > 0 || typeof document !== \"object\" || document === null || Array.isArray(document)) {\n\t\treturn yield* new InvalidInputError({ message: `${path} is not a valid ${what}` });\n\t}\n\treturn { source, document: document as Record<string, unknown> };\n});\n\n/** Set the value at `at` in `source`, or remove it when `value` is undefined, and write the file. */\nexport const write = Effect.fn(\"CLI.jsonc.write\")(function* (\n\tpath: string,\n\tsource: string,\n\tat: ReadonlyArray<string>,\n\tvalue: unknown,\n) {\n\tconst fs = yield* FileSystem.FileSystem;\n\tconst nodePath = yield* Path.Path;\n\t// A removal is not formatted: the formatter would reflow the sibling before it as well.\n\tconst edited = applyEdits(\n\t\tsource,\n\t\tmodify(\n\t\t\tsource,\n\t\t\t[...at],\n\t\t\tvalue,\n\t\t\tvalue === undefined ? {} : { formattingOptions: { tabSize: 2, insertSpaces: false } },\n\t\t),\n\t);\n\tconst directory = nodePath.dirname(path);\n\tyield* fs.makeDirectory(directory, { recursive: true });\n\tconst mode = (yield* fs.exists(path)) ? (yield* fs.stat(path)).mode & 0o777 : 0o600;\n\tconst temporary = yield* fs.makeTempFile({ directory, prefix: `.${nodePath.basename(path)}.`, suffix: \".tmp\" });\n\tyield* fs\n\t\t.writeFileString(temporary, edited.endsWith(\"\\n\") ? edited : `${edited}\\n`)\n\t\t.pipe(\n\t\t\tEffect.andThen(fs.chmod(temporary, mode)),\n\t\t\tEffect.andThen(fs.rename(temporary, path)),\n\t\t\tEffect.ensuring(fs.remove(temporary, { force: true }).pipe(Effect.ignore)),\n\t\t);\n});\n\n/**\n * Serialize one read-modify-rename of `path` across CLI processes. Only the local edit is locked, so\n * work that precedes it does not wait behind another process.\n */\nexport const locked = <A, E, R>(path: string, edit: Effect.Effect<A, E, R>) =>\n\tEffect.gen(function* () {\n\t\tconst fs = yield* FileSystem.FileSystem;\n\t\tconst nodePath = yield* Path.Path;\n\t\tyield* fs.makeDirectory(nodePath.dirname(path), { recursive: true });\n\t\tyield* Plugin.settingsLock(\n\t\t\t`${path}.lock`,\n\t\t\t() => new InvalidInputError({ message: `timed out waiting to edit ${path}` }),\n\t\t);\n\t\treturn yield* edit;\n\t}).pipe(Effect.scoped);\n\nexport * as Jsonc from \"./jsonc.ts\";\n"],"mappings":";;;;;;;;;;;;;;AAeA,MAAa,OAAO,OAAO,GAAG,gBAAgB,CAAC,CAAC,WAAW,MAAc,MAAc;CACtF,MAAM,KAAK,OAAO,WAAW;CAC7B,MAAM,UAAU,OAAO,GAAG,OAAO,IAAI,KAAK,OAAO,GAAG,eAAe,IAAI,IAAI;CAC3E,MAAM,SAAuB,CAAC;CAC9B,MAAM,WAAoBA,MAAW,QAAQ,QAAQ,EAAE,oBAAoB,KAAK,CAAC;CACjF,IAAI,OAAO,SAAS,KAAK,OAAO,aAAa,YAAY,aAAa,QAAQ,MAAM,QAAQ,QAAQ,GACnG,OAAO,OAAO,IAAI,kBAAkB,EAAE,SAAS,GAAG,KAAK,kBAAkB,O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AC,CAC7E;CACA,OAAO,OAAO;AACf,CAAC,CAAC,CAAC,KAAK,OAAO,MAAM"}
@@ -1,5 +1,5 @@
1
1
  import { i as Cmd, t as handler } from "./runtime-CK2CunDw.mjs";
2
- import { f as writeOut, i as reportFailure, m as make, p as layer } from "./error--BWou73I.mjs";
2
+ import { f as writeOut, i as reportFailure, m as make, p as layer } from "./error-CPyvkO4x.mjs";
3
3
  import { Effect, Option, Path } from "effect";
4
4
  import { Session } from "@codeworksh/harness/effect";
5
5
  //#region src/cli/cmd/handlers/session/link.ts
@@ -38,4 +38,4 @@ var link_default = handler(Cmd.commands.session.commands.link, Effect.fn("CLI.se
38
38
  //#endregion
39
39
  export { link_default as default };
40
40
 
41
- //# sourceMappingURL=link-CJE1PRTf.mjs.map
41
+ //# sourceMappingURL=link-ZuzWj9qt.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"link-CJE1PRTf.mjs","names":["Runtime.handler","Client.make","Client.layer"],"sources":["../../src/cli/cmd/handlers/session/link.ts"],"sourcesContent":["import { Session } 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 { Client } from \"../../../../server/client.ts\";\nimport { Cmd } from \"../../cmd.ts\";\n\n/**\n * Sets `hostDir` on an existing session.\n *\n * **The session ID identifies it; the path is the target.** A project cannot identify a session --\n * it may have many or none, and it is the session that carries the field.\n *\n * The path defaults to the shell's directory, which is both the common case (you are standing in\n * the project you want to link) and safe to default: the CLI runs on the host, so the trust\n * question about naming host paths is about remote clients, not about a local shell's own cwd.\n *\n * Not `session relink`, which moves a session to another checkout of the same project. Different\n * axes -- `relink` changes where the *work* happens, `link` changes which host directory the\n * session is *anchored to* -- and conflating them would recreate the confusion the two names\n * exist to avoid.\n *\n * The anchor is not a settings mechanism. Settings discovery reads it, so do plugin installs, and\n * so will whatever needs a host-side directory next; naming any one of them in the description is\n * what made this read like a settings flag.\n */\nexport default Runtime.handler(\n\tCmd.commands.session.commands.link,\n\tEffect.fn(\"CLI.session.link\")(function* ({ session, path, unlink, server }) {\n\t\tconst program = Effect.gen(function* () {\n\t\t\tconst nodePath = yield* Path.Path;\n\t\t\tconst rpc = yield* Client.make;\n\t\t\tconst sessionId = Session.SessionSchema.ID.make(session);\n\t\t\tconst hostDir = unlink\n\t\t\t\t? undefined\n\t\t\t\t: Session.AbsolutePath.make(nodePath.resolve(Option.getOrElse(path, () => \".\")));\n\n\t\t\tconst info = yield* rpc[\"session.link\"]({\n\t\t\t\tsessionId,\n\t\t\t\t...(hostDir === undefined ? {} : { hostDir }),\n\t\t\t});\n\t\t\t// Settings are re-read every exchange, so this applies at the next one: no reload, no\n\t\t\t// restart, the project layer simply starts or stops being read.\n\t\t\tyield* writeOut(\n\t\t\t\tinfo.hostDir === undefined\n\t\t\t\t\t? `Unlinked ${info.id}; it now reads the user settings alone.\\n`\n\t\t\t\t\t: `Linked ${info.id} to ${info.hostDir}\\n`,\n\t\t\t);\n\t\t});\n\n\t\treturn yield* program.pipe(Effect.provide(Client.layer(server)), Effect.scoped, Effect.catch(reportFailure));\n\t}),\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AA2BA,IAAA,eAAeA,QACd,IAAI,SAAS,QAAQ,SAAS,MAC9B,OAAO,GAAG,kBAAkB,CAAC,CAAC,WAAW,EAAE,SAAS,MAAM,QAAQ,UAAU;CAsB3E,OAAO,OArBS,OAAO,IAAI,aAAa;EACvC,MAAM,WAAW,OAAO,KAAK;EAC7B,MAAM,MAAM,OAAOC;EACnB,MAAM,YAAY,QAAQ,cAAc,GAAG,KAAK,OAAO;EACvD,MAAM,UAAU,SACb,KAAA,IACA,QAAQ,aAAa,KAAK,SAAS,QAAQ,OAAO,UAAU,YAAY,GAAG,CAAC,CAAC;EAEhF,MAAM,OAAO,OAAO,IAAI,eAAe,CAAC;GACvC;GACA,GAAI,YAAY,KAAA,IAAY,CAAC,IAAI,EAAE,QAAQ;EAC5C,CAAC;EAGD,OAAO,SACN,KAAK,YAAY,KAAA,IACd,YAAY,KAAK,GAAG,6CACpB,UAAU,KAAK,GAAG,MAAM,KAAK,QAAQ,GACzC;CACD,CAEoB,CAAC,CAAC,KAAK,OAAO,QAAQC,MAAa,MAAM,CAAC,GAAG,OAAO,QAAQ,OAAO,MAAM,aAAa,CAAC;AAC5G,CAAC,CACF"}
1
+ {"version":3,"file":"link-ZuzWj9qt.mjs","names":["Runtime.handler","Client.make","Client.layer"],"sources":["../../src/cli/cmd/handlers/session/link.ts"],"sourcesContent":["import { Session } 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 { Client } from \"../../../../server/client.ts\";\nimport { Cmd } from \"../../cmd.ts\";\n\n/**\n * Sets `hostDir` on an existing session.\n *\n * **The session ID identifies it; the path is the target.** A project cannot identify a session --\n * it may have many or none, and it is the session that carries the field.\n *\n * The path defaults to the shell's directory, which is both the common case (you are standing in\n * the project you want to link) and safe to default: the CLI runs on the host, so the trust\n * question about naming host paths is about remote clients, not about a local shell's own cwd.\n *\n * Not `session relink`, which moves a session to another checkout of the same project. Different\n * axes -- `relink` changes where the *work* happens, `link` changes which host directory the\n * session is *anchored to* -- and conflating them would recreate the confusion the two names\n * exist to avoid.\n *\n * The anchor is not a settings mechanism. Settings discovery reads it, so do plugin installs, and\n * so will whatever needs a host-side directory next; naming any one of them in the description is\n * what made this read like a settings flag.\n */\nexport default Runtime.handler(\n\tCmd.commands.session.commands.link,\n\tEffect.fn(\"CLI.session.link\")(function* ({ session, path, unlink, server }) {\n\t\tconst program = Effect.gen(function* () {\n\t\t\tconst nodePath = yield* Path.Path;\n\t\t\tconst rpc = yield* Client.make;\n\t\t\tconst sessionId = Session.SessionSchema.ID.make(session);\n\t\t\tconst hostDir = unlink\n\t\t\t\t? undefined\n\t\t\t\t: Session.AbsolutePath.make(nodePath.resolve(Option.getOrElse(path, () => \".\")));\n\n\t\t\tconst info = yield* rpc[\"session.link\"]({\n\t\t\t\tsessionId,\n\t\t\t\t...(hostDir === undefined ? {} : { hostDir }),\n\t\t\t});\n\t\t\t// Settings are re-read every exchange, so this applies at the next one: no reload, no\n\t\t\t// restart, the project layer simply starts or stops being read.\n\t\t\tyield* writeOut(\n\t\t\t\tinfo.hostDir === undefined\n\t\t\t\t\t? `Unlinked ${info.id}; it now reads the user settings alone.\\n`\n\t\t\t\t\t: `Linked ${info.id} to ${info.hostDir}\\n`,\n\t\t\t);\n\t\t});\n\n\t\treturn yield* program.pipe(Effect.provide(Client.layer(server)), Effect.scoped, Effect.catch(reportFailure));\n\t}),\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AA2BA,IAAA,eAAeA,QACd,IAAI,SAAS,QAAQ,SAAS,MAC9B,OAAO,GAAG,kBAAkB,CAAC,CAAC,WAAW,EAAE,SAAS,MAAM,QAAQ,UAAU;CAsB3E,OAAO,OArBS,OAAO,IAAI,aAAa;EACvC,MAAM,WAAW,OAAO,KAAK;EAC7B,MAAM,MAAM,OAAOC;EACnB,MAAM,YAAY,QAAQ,cAAc,GAAG,KAAK,OAAO;EACvD,MAAM,UAAU,SACb,KAAA,IACA,QAAQ,aAAa,KAAK,SAAS,QAAQ,OAAO,UAAU,YAAY,GAAG,CAAC,CAAC;EAEhF,MAAM,OAAO,OAAO,IAAI,eAAe,CAAC;GACvC;GACA,GAAI,YAAY,KAAA,IAAY,CAAC,IAAI,EAAE,QAAQ;EAC5C,CAAC;EAGD,OAAO,SACN,KAAK,YAAY,KAAA,IACd,YAAY,KAAK,GAAG,6CACpB,UAAU,KAAK,GAAG,MAAM,KAAK,QAAQ,GACzC;CACD,CAEoB,CAAC,CAAC,KAAK,OAAO,QAAQC,MAAa,MAAM,CAAC,GAAG,OAAO,QAAQ,OAAO,MAAM,aAAa,CAAC;AAC5G,CAAC,CACF"}
@@ -1,6 +1,6 @@
1
1
  import { i as Cmd, t as handler } from "./runtime-CK2CunDw.mjs";
2
- import { f as writeOut, i as reportFailure } from "./error--BWou73I.mjs";
3
- import { n as configured, r as describe, t as MARKS } from "./shared-BnR3BFZM.mjs";
2
+ import { f as writeOut, i as reportFailure } from "./error-CPyvkO4x.mjs";
3
+ import { n as configured, r as describe, t as MARKS } from "./shared-CDyNsYBy.mjs";
4
4
  import { Effect, Layer, References } from "effect";
5
5
  import { Database, Event, Mcp } from "@codeworksh/harness/effect";
6
6
  //#region src/cli/cmd/handlers/mcp/list.ts
@@ -68,4 +68,4 @@ var list_default = handler(Cmd.commands.mcp.commands.list, Effect.fn("CLI.mcp.li
68
68
  //#endregion
69
69
  export { list_default as default };
70
70
 
71
- //# sourceMappingURL=list-B3kSn78f.mjs.map
71
+ //# sourceMappingURL=list-6QTwXTKO.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"list-B3kSn78f.mjs","names":["Runtime.handler"],"sources":["../../src/cli/cmd/handlers/mcp/list.ts"],"sourcesContent":["/* @effect-diagnostics preferSchemaOverJson:off -- `--json` prints the report as it is built. */\nimport { Database, Event, type EventList, Mcp } from \"@codeworksh/harness/effect\";\nimport { Effect, Layer, References } from \"effect\";\nimport { Runtime } from \"../../../../framework/runtime.ts\";\nimport { reportFailure } from \"../../../error.ts\";\nimport { writeOut } from \"../../../output.ts\";\nimport { Cmd } from \"../../cmd.ts\";\nimport { configured, describe, MARKS } from \"./shared.ts\";\n\ninterface Report {\n\treadonly name: string;\n\treadonly level: \"user\" | \"project\";\n\treadonly file: string;\n\t/** The project `mcp.json` that overrides `enabled` or exposure of this user server. */\n\treadonly override?: string;\n\treadonly enabled: boolean;\n\treadonly exposure: string;\n\treadonly transport: string;\n\treadonly state: Mcp.State;\n\treadonly tools: ReadonlyArray<string>;\n\t/** Tools it listed that were left out because the MCP SDK rejects them. */\n\treadonly skipped?: EventList.McpSkipped;\n\t/** Tools whose exposure differs from the server's, from `toolExposure`. */\n\treadonly toolExposure?: Record<string, string>;\n\t/** Whether the server offers resources. They are not listed: listing every one can take long. */\n\treadonly resources?: true;\n\treadonly error?: string;\n}\n\nexport default Runtime.handler(\n\tCmd.commands.mcp.commands.list,\n\tEffect.fn(\"CLI.mcp.list\")(function* ({ json }) {\n\t\tconst program = Effect.gen(function* () {\n\t\t\tconst { home, authFile, hostCwd, root, user, servers, errors } = yield* configured();\n\t\t\t// Every connect problem is in the report; the service's own logs would only repeat it.\n\t\t\tconst statuses = yield* Mcp.check({\n\t\t\t\tservers: servers.map((server) => [server.name, server.config] as const),\n\t\t\t\tdirectory: hostCwd,\n\t\t\t\thostDir: root ?? hostCwd,\n\t\t\t}).pipe(\n\t\t\t\t// Status events need an event service; nothing reads them here, so it keeps them in memory.\n\t\t\t\tEffect.provide(\n\t\t\t\t\tMcp.layer({ hostCwd, home, authFile }).pipe(\n\t\t\t\t\t\tLayer.provide(Event.layer.pipe(Layer.provide(Database.layer(\":memory:\")))),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tEffect.provideService(References.MinimumLogLevel, \"None\"),\n\t\t\t);\n\t\t\tconst reports = servers.map((server): Report => {\n\t\t\t\tconst { config } = server;\n\t\t\t\tconst status = statuses.find((one) => one.server === server.name);\n\t\t\t\tconst exposure = config.exposure ?? \"direct\";\n\t\t\t\tconst tools = status?.tools ?? [];\n\t\t\t\tconst overrides = tools.filter((tool) => tool.exposure !== exposure);\n\t\t\t\tconst state = status?.state ?? \"disabled\";\n\t\t\t\treturn {\n\t\t\t\t\tname: server.name,\n\t\t\t\t\tlevel: server.file === user ? \"user\" : \"project\",\n\t\t\t\t\tfile: server.file,\n\t\t\t\t\t...(server.override === undefined ? {} : { override: server.override }),\n\t\t\t\t\tenabled: config.enabled !== false,\n\t\t\t\t\texposure,\n\t\t\t\t\ttransport: \"url\" in config ? config.url : [config.command, ...(config.args ?? [])].join(\" \"),\n\t\t\t\t\tstate,\n\t\t\t\t\ttools: tools.map((tool) => tool.name),\n\t\t\t\t\t...(status?.skipped === undefined ? {} : { skipped: status.skipped }),\n\t\t\t\t\t...(overrides.length === 0\n\t\t\t\t\t\t? {}\n\t\t\t\t\t\t: { toolExposure: Object.fromEntries(overrides.map((tool) => [tool.name, tool.exposure])) }),\n\t\t\t\t\t...(status?.resources ? { resources: true as const } : {}),\n\t\t\t\t\t...(state !== \"connected\" && status?.error !== undefined ? { error: status.error } : {}),\n\t\t\t\t};\n\t\t\t});\n\t\t\tconst failed = errors.length > 0 || reports.some((report) => report.enabled && report.state !== \"connected\");\n\t\t\tif (failed)\n\t\t\t\tyield* Effect.sync(() => {\n\t\t\t\t\tprocess.exitCode = 1;\n\t\t\t\t});\n\n\t\t\tif (json) return yield* writeOut(`${JSON.stringify({ servers: reports, errors }, null, 2)}\\n`);\n\t\t\tconst lines: string[] = [];\n\t\t\tif (reports.length === 0 && errors.length === 0)\n\t\t\t\tlines.push(`No MCP servers configured. Add them to ${user} or .codework/mcp.json.`);\n\t\t\tconst width = Math.max(0, ...reports.map((report) => report.name.length));\n\t\t\tfor (const report of reports) {\n\t\t\t\tlines.push(\n\t\t\t\t\t`${MARKS[report.state]} ${report.name.padEnd(width)} ${describe(report.state, report.tools.length, report.skipped)} (${report.exposure}, ${report.level})`,\n\t\t\t\t);\n\t\t\t\tconst detail = (line: string) => lines.push(` ${line}`);\n\t\t\t\tdetail(report.transport);\n\t\t\t\tif (report.override !== undefined) detail(`project override: ${report.override}`);\n\t\t\t\tif (report.tools.length > 0)\n\t\t\t\t\tdetail(\n\t\t\t\t\t\t`tools: ${report.tools\n\t\t\t\t\t\t\t.map((tool) => {\n\t\t\t\t\t\t\t\tconst exposure = report.toolExposure?.[tool];\n\t\t\t\t\t\t\t\treturn exposure === undefined ? tool : `${tool} [${exposure}]`;\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t.join(\", \")}`,\n\t\t\t\t\t);\n\t\t\t\tif (report.resources) detail(\"offers resources\");\n\t\t\t\tif (report.error !== undefined) for (const line of report.error.split(\"\\n\")) detail(line);\n\t\t\t}\n\t\t\tfor (const error of errors) lines.push(`config error: ${error}`);\n\t\t\tyield* writeOut(`${lines.join(\"\\n\")}\\n`);\n\t\t});\n\t\treturn yield* program.pipe(Effect.catch(reportFailure));\n\t}),\n);\n"],"mappings":";;;;;;AA6BA,IAAA,eAAeA,QACd,IAAI,SAAS,IAAI,SAAS,MAC1B,OAAO,GAAG,cAAc,CAAC,CAAC,WAAW,EAAE,QAAQ;CA2E9C,OAAO,OA1ES,OAAO,IAAI,aAAa;EACvC,MAAM,EAAE,MAAM,UAAU,SAAS,MAAM,MAAM,SAAS,WAAW,OAAO,WAAW;EAEnF,MAAM,WAAW,OAAO,IAAI,MAAM;GACjC,SAAS,QAAQ,KAAK,WAAW,CAAC,OAAO,MAAM,OAAO,MAAM,CAAU;GACtE,WAAW;GACX,SAAS,QAAQ;EAClB,CAAC,CAAC,CAAC,KAEF,OAAO,QACN,IAAI,MAAM;GAAE;GAAS;GAAM;EAAS,CAAC,CAAC,CAAC,KACtC,MAAM,QAAQ,MAAM,MAAM,KAAK,MAAM,QAAQ,SAAS,MAAM,UAAU,CAAC,CAAC,CAAC,CAC1E,CACD,GACA,OAAO,eAAe,WAAW,iBAAiB,MAAM,CACzD;EACA,MAAM,UAAU,QAAQ,KAAK,WAAmB;GAC/C,MAAM,EAAE,WAAW;GACnB,MAAM,SAAS,SAAS,MAAM,QAAQ,IAAI,WAAW,OAAO,IAAI;GAChE,MAAM,WAAW,OAAO,YAAY;GACpC,MAAM,QAAQ,QAAQ,SAAS,CAAC;GAChC,MAAM,YAAY,MAAM,QAAQ,SAAS,KAAK,aAAa,QAAQ;GACnE,MAAM,QAAQ,QAAQ,SAAS;GAC/B,OAAO;IACN,MAAM,OAAO;IACb,OAAO,OAAO,SAAS,OAAO,SAAS;IACvC,MAAM,OAAO;IACb,GAAI,OAAO,aAAa,KAAA,IAAY,CAAC,IAAI,EAAE,UAAU,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AU,SAAiB,MAAM,KAAK,OAAO,MAAM;GACzD,OAAO,OAAO,SAAS;GACvB,IAAI,OAAO,aAAa,KAAA,GAAW,OAAO,qBAAqB,OAAO,UAAU;GAChF,IAAI,OAAO,MAAM,SAAS,GACzB,OACC,UAAU,OAAO,MACf,KAAK,SAAS;IACd,MAAM,WAAW,OAAO,eAAe;IACvC,OAAO,aAAa,KAAA,IAAY,OAAO,GAAG,KAAK,IAAI,SAAS;GAC7D,CAAC,CAAC,CACD,KAAK,IAAI,GACZ;GACD,IAAI,OAAO,WAAW,OAAO,kBAAkB;GAC/C,IAAI,OAAO,UAAU,KAAA,GAAW,KAAK,MAAM,QAAQ,OAAO,MAAM,MAAM,IAAI,GAAG,OAAO,IAAI;EACzF;EACA,KAAK,MAAM,SAAS,QAAQ,MAAM,KAAK,iBAAiB,OAAO;EAC/D,OAAO,SAAS,GAAG,MAAM,KAAK,IAAI,EAAE,GAAG;CACxC,CACoB,CAAC,CAAC,KAAK,OAAO,MAAM,aAAa,CAAC;AACvD,CAAC,CACF"}
1
+ {"version":3,"file":"list-6QTwXTKO.mjs","names":["Runtime.handler"],"sources":["../../src/cli/cmd/handlers/mcp/list.ts"],"sourcesContent":["/* @effect-diagnostics preferSchemaOverJson:off -- `--json` prints the report as it is built. */\nimport { Database, Event, type EventList, Mcp } from \"@codeworksh/harness/effect\";\nimport { Effect, Layer, References } from \"effect\";\nimport { Runtime } from \"../../../../framework/runtime.ts\";\nimport { reportFailure } from \"../../../error.ts\";\nimport { writeOut } from \"../../../output.ts\";\nimport { Cmd } from \"../../cmd.ts\";\nimport { configured, describe, MARKS } from \"./shared.ts\";\n\ninterface Report {\n\treadonly name: string;\n\treadonly level: \"user\" | \"project\";\n\treadonly file: string;\n\t/** The project `mcp.json` that overrides `enabled` or exposure of this user server. */\n\treadonly override?: string;\n\treadonly enabled: boolean;\n\treadonly exposure: string;\n\treadonly transport: string;\n\treadonly state: Mcp.State;\n\treadonly tools: ReadonlyArray<string>;\n\t/** Tools it listed that were left out because the MCP SDK rejects them. */\n\treadonly skipped?: EventList.McpSkipped;\n\t/** Tools whose exposure differs from the server's, from `toolExposure`. */\n\treadonly toolExposure?: Record<string, string>;\n\t/** Whether the server offers resources. They are not listed: listing every one can take long. */\n\treadonly resources?: true;\n\treadonly error?: string;\n}\n\nexport default Runtime.handler(\n\tCmd.commands.mcp.commands.list,\n\tEffect.fn(\"CLI.mcp.list\")(function* ({ json }) {\n\t\tconst program = Effect.gen(function* () {\n\t\t\tconst { home, authFile, hostCwd, root, user, servers, errors } = yield* configured();\n\t\t\t// Every connect problem is in the report; the service's own logs would only repeat it.\n\t\t\tconst statuses = yield* Mcp.check({\n\t\t\t\tservers: servers.map((server) => [server.name, server.config] as const),\n\t\t\t\tdirectory: hostCwd,\n\t\t\t\thostDir: root ?? hostCwd,\n\t\t\t}).pipe(\n\t\t\t\t// Status events need an event service; nothing reads them here, so it keeps them in memory.\n\t\t\t\tEffect.provide(\n\t\t\t\t\tMcp.layer({ hostCwd, home, authFile }).pipe(\n\t\t\t\t\t\tLayer.provide(Event.layer.pipe(Layer.provide(Database.layer(\":memory:\")))),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tEffect.provideService(References.MinimumLogLevel, \"None\"),\n\t\t\t);\n\t\t\tconst reports = servers.map((server): Report => {\n\t\t\t\tconst { config } = server;\n\t\t\t\tconst status = statuses.find((one) => one.server === server.name);\n\t\t\t\tconst exposure = config.exposure ?? \"direct\";\n\t\t\t\tconst tools = status?.tools ?? [];\n\t\t\t\tconst overrides = tools.filter((tool) => tool.exposure !== exposure);\n\t\t\t\tconst state = status?.state ?? \"disabled\";\n\t\t\t\treturn {\n\t\t\t\t\tname: server.name,\n\t\t\t\t\tlevel: server.file === user ? \"user\" : \"project\",\n\t\t\t\t\tfile: server.file,\n\t\t\t\t\t...(server.override === undefined ? {} : { override: server.override }),\n\t\t\t\t\tenabled: config.enabled !== false,\n\t\t\t\t\texposure,\n\t\t\t\t\ttransport: \"url\" in config ? config.url : [config.command, ...(config.args ?? [])].join(\" \"),\n\t\t\t\t\tstate,\n\t\t\t\t\ttools: tools.map((tool) => tool.name),\n\t\t\t\t\t...(status?.skipped === undefined ? {} : { skipped: status.skipped }),\n\t\t\t\t\t...(overrides.length === 0\n\t\t\t\t\t\t? {}\n\t\t\t\t\t\t: { toolExposure: Object.fromEntries(overrides.map((tool) => [tool.name, tool.exposure])) }),\n\t\t\t\t\t...(status?.resources ? { resources: true as const } : {}),\n\t\t\t\t\t...(state !== \"connected\" && status?.error !== undefined ? { error: status.error } : {}),\n\t\t\t\t};\n\t\t\t});\n\t\t\tconst failed = errors.length > 0 || reports.some((report) => report.enabled && report.state !== \"connected\");\n\t\t\tif (failed)\n\t\t\t\tyield* Effect.sync(() => {\n\t\t\t\t\tprocess.exitCode = 1;\n\t\t\t\t});\n\n\t\t\tif (json) return yield* writeOut(`${JSON.stringify({ servers: reports, errors }, null, 2)}\\n`);\n\t\t\tconst lines: string[] = [];\n\t\t\tif (reports.length === 0 && errors.length === 0)\n\t\t\t\tlines.push(`No MCP servers configured. Add them to ${user} or .codework/mcp.json.`);\n\t\t\tconst width = Math.max(0, ...reports.map((report) => report.name.length));\n\t\t\tfor (const report of reports) {\n\t\t\t\tlines.push(\n\t\t\t\t\t`${MARKS[report.state]} ${report.name.padEnd(width)} ${describe(report.state, report.tools.length, report.skipped)} (${report.exposure}, ${report.level})`,\n\t\t\t\t);\n\t\t\t\tconst detail = (line: string) => lines.push(` ${line}`);\n\t\t\t\tdetail(report.transport);\n\t\t\t\tif (report.override !== undefined) detail(`project override: ${report.override}`);\n\t\t\t\tif (report.tools.length > 0)\n\t\t\t\t\tdetail(\n\t\t\t\t\t\t`tools: ${report.tools\n\t\t\t\t\t\t\t.map((tool) => {\n\t\t\t\t\t\t\t\tconst exposure = report.toolExposure?.[tool];\n\t\t\t\t\t\t\t\treturn exposure === undefined ? tool : `${tool} [${exposure}]`;\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t.join(\", \")}`,\n\t\t\t\t\t);\n\t\t\t\tif (report.resources) detail(\"offers resources\");\n\t\t\t\tif (report.error !== undefined) for (const line of report.error.split(\"\\n\")) detail(line);\n\t\t\t}\n\t\t\tfor (const error of errors) lines.push(`config error: ${error}`);\n\t\t\tyield* writeOut(`${lines.join(\"\\n\")}\\n`);\n\t\t});\n\t\treturn yield* program.pipe(Effect.catch(reportFailure));\n\t}),\n);\n"],"mappings":";;;;;;AA6BA,IAAA,eAAeA,QACd,IAAI,SAAS,IAAI,SAAS,MAC1B,OAAO,GAAG,cAAc,CAAC,CAAC,WAAW,EAAE,QAAQ;CA2E9C,OAAO,OA1ES,OAAO,IAAI,aAAa;EACvC,MAAM,EAAE,MAAM,UAAU,SAAS,MAAM,MAAM,SAAS,WAAW,OAAO,WAAW;EAEnF,MAAM,WAAW,OAAO,IAAI,MAAM;GACjC,SAAS,QAAQ,KAAK,WAAW,CAAC,OAAO,MAAM,OAAO,MAAM,CAAU;GACtE,WAAW;GACX,SAAS,QAAQ;EAClB,CAAC,CAAC,CAAC,KAEF,OAAO,QACN,IAAI,MAAM;GAAE;GAAS;GAAM;EAAS,CAAC,CAAC,CAAC,KACtC,MAAM,QAAQ,MAAM,MAAM,KAAK,MAAM,QAAQ,SAAS,MAAM,UAAU,CAAC,CAAC,CAAC,CAC1E,CACD,GACA,OAAO,eAAe,WAAW,iBAAiB,MAAM,CACzD;EACA,MAAM,UAAU,QAAQ,KAAK,WAAmB;GAC/C,MAAM,EAAE,WAAW;GACnB,MAAM,SAAS,SAAS,MAAM,QAAQ,IAAI,WAAW,OAAO,IAAI;GAChE,MAAM,WAAW,OAAO,YAAY;GACpC,MAAM,QAAQ,QAAQ,SAAS,CAAC;GAChC,MAAM,YAAY,MAAM,QAAQ,SAAS,KAAK,aAAa,QAAQ;GACnE,MAAM,QAAQ,QAAQ,SAAS;GAC/B,OAAO;IACN,MAAM,OAAO;IACb,OAAO,OAAO,SAAS,OAAO,SAAS;IACvC,MAAM,OA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EAAE,IAAI,OAAO,SAAS,IAAI,OAAO,MAAM,EAC1J;GACA,MAAM,UAAU,SAAiB,MAAM,KAAK,OAAO,MAAM;GACzD,OAAO,OAAO,SAAS;GACvB,IAAI,OAAO,aAAa,KAAA,GAAW,OAAO,qBAAqB,OAAO,UAAU;GAChF,IAAI,OAAO,MAAM,SAAS,GACzB,OACC,UAAU,OAAO,MACf,KAAK,SAAS;IACd,MAAM,WAAW,OAAO,eAAe;IACvC,OAAO,aAAa,KAAA,IAAY,OAAO,GAAG,KAAK,IAAI,SAAS;GAC7D,CAAC,CAAC,CACD,KAAK,IAAI,GACZ;GACD,IAAI,OAAO,WAAW,OAAO,kBAAkB;GAC/C,IAAI,OAAO,UAAU,KAAA,GAAW,KAAK,MAAM,QAAQ,OAAO,MAAM,MAAM,IAAI,GAAG,OAAO,IAAI;EACzF;EACA,KAAK,MAAM,SAAS,QAAQ,MAAM,KAAK,iBAAiB,OAAO;EAC/D,OAAO,SAAS,GAAG,MAAM,KAAK,IAAI,EAAE,GAAG;CACxC,CACoB,CAAC,CAAC,KAAK,OAAO,MAAM,aAAa,CAAC;AACvD,CAAC,CACF"}
@@ -1,5 +1,5 @@
1
1
  import { i as Cmd, t as handler } from "./runtime-CK2CunDw.mjs";
2
- import { f as writeOut, i as reportFailure, t as InvalidInputError } from "./error--BWou73I.mjs";
2
+ import { f as writeOut, i as reportFailure, t as InvalidInputError } from "./error-CPyvkO4x.mjs";
3
3
  import { n as synced } from "./catalog-XfqtqMDz.mjs";
4
4
  import { Effect, Option } from "effect";
5
5
  import { ModelCatalog } from "@codeworksh/harness/effect";
@@ -27,4 +27,4 @@ var list_default = handler(Cmd.commands.models, Effect.fn("CLI.models.list")(fun
27
27
  //#endregion
28
28
  export { list_default as default };
29
29
 
30
- //# sourceMappingURL=list-Cf-zESJf.mjs.map
30
+ //# sourceMappingURL=list-BnIIcMI3.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"list-Cf-zESJf.mjs","names":["Runtime.handler"],"sources":["../../src/cli/cmd/handlers/models/list.ts"],"sourcesContent":["import { ModelCatalog } from \"@codeworksh/harness/effect\";\nimport { Effect, Option } from \"effect\";\nimport { Runtime } from \"../../../../framework/runtime.ts\";\nimport { InvalidInputError, reportFailure } from \"../../../error.ts\";\nimport { writeOut } from \"../../../output.ts\";\nimport { Cmd } from \"../../cmd.ts\";\nimport { synced } from \"./catalog.ts\";\n\nexport default Runtime.handler(\n\tCmd.commands.models,\n\tEffect.fn(\"CLI.models.list\")(function* ({ provider }) {\n\t\tconst program = Effect.gen(function* () {\n\t\t\tyield* synced;\n\t\t\tconst catalog = yield* ModelCatalog.models;\n\t\t\tif (Option.isSome(provider)) {\n\t\t\t\tconst providerId = provider.value;\n\t\t\t\tif (!Object.hasOwn(catalog, providerId)) {\n\t\t\t\t\treturn yield* new InvalidInputError({\n\t\t\t\t\t\tmessage: `provider \"${providerId}\" is not in the catalog\\nhint: run \\`codework models providers\\``,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tconst sorted = Object.keys(catalog[providerId] ?? {}).sort((a, b) => a.localeCompare(b));\n\t\t\t\tyield* writeOut(sorted.map((modelId) => `${providerId}/${modelId}\\n`).join(\"\"));\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst lines: string[] = [];\n\t\t\tconst providers = Object.keys(catalog).sort((a, b) => a.localeCompare(b));\n\t\t\tfor (const providerId of providers) {\n\t\t\t\tconst providerModels = Object.keys(catalog[providerId] ?? {}).sort((a, b) => a.localeCompare(b));\n\t\t\t\tfor (const modelId of providerModels) {\n\t\t\t\t\tlines.push(`${providerId}/${modelId}\\n`);\n\t\t\t\t}\n\t\t\t}\n\t\t\tyield* writeOut(lines.join(\"\"));\n\t\t});\n\n\t\treturn yield* program.pipe(Effect.catch(reportFailure));\n\t}),\n);\n"],"mappings":";;;;;;AAQA,IAAA,eAAeA,QACd,IAAI,SAAS,QACb,OAAO,GAAG,iBAAiB,CAAC,CAAC,WAAW,EAAE,YAAY;CA2BrD,OAAO,OA1BS,OAAO,IAAI,aAAa;EACvC,OAAO;EACP,MAAM,UAAU,OAAO,aAAa;EACpC,IAAI,OAAO,OAAO,QAAQ,GAAG;GAC5B,MAAM,aAAa,SAAS;GAC5B,IAAI,CAAC,OAAO,OAAO,SAAS,UAAU,GACrC,OAAO,OAAO,IAAI,kBAAkB,EACnC,SAAS,aAAa,WAAW,kEAClC,CAAC;GAEF,MAAM,SAAS,OAAO,KAAK,QAAQ,eAAe,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,MAAM,EAAE,cAAc,CAAC,CAAC;GACvF,OAAO,SAAS,OAAO,KAAK,YAAY,GAAG,WAAW,GAAG,QAAQ,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC;GAC9E;EACD;EAEA,MAAM,QAAkB,CAAC;EACzB,MAAM,YAAY,OAAO,KAAK,OAAO,CAAC,CAAC,MAAM,GAAG,MAAM,EAAE,cAAc,CAAC,CAAC;EACxE,KAAK,MAAM,cAAc,WAAW;GACnC,MAAM,iBAAiB,OAAO,KAAK,QAAQ,eAAe,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,MAAM,EAAE,cAAc,CAAC,CAAC;GAC/F,KAAK,MAAM,WAAW,gBACrB,MAAM,KAAK,GAAG,WAAW,GAAG,QAAQ,GAAG;EAEzC;EACA,OAAO,SAAS,MAAM,KAAK,EAAE,CAAC;CAC/B,CAEoB,CAAC,CAAC,KAAK,OAAO,MAAM,aAAa,CAAC;AACvD,CAAC,CACF"}
1
+ {"version":3,"file":"list-BnIIcMI3.mjs","names":["Runtime.handler"],"sources":["../../src/cli/cmd/handlers/models/list.ts"],"sourcesContent":["import { ModelCatalog } from \"@codeworksh/harness/effect\";\nimport { Effect, Option } from \"effect\";\nimport { Runtime } from \"../../../../framework/runtime.ts\";\nimport { InvalidInputError, reportFailure } from \"../../../error.ts\";\nimport { writeOut } from \"../../../output.ts\";\nimport { Cmd } from \"../../cmd.ts\";\nimport { synced } from \"./catalog.ts\";\n\nexport default Runtime.handler(\n\tCmd.commands.models,\n\tEffect.fn(\"CLI.models.list\")(function* ({ provider }) {\n\t\tconst program = Effect.gen(function* () {\n\t\t\tyield* synced;\n\t\t\tconst catalog = yield* ModelCatalog.models;\n\t\t\tif (Option.isSome(provider)) {\n\t\t\t\tconst providerId = provider.value;\n\t\t\t\tif (!Object.hasOwn(catalog, providerId)) {\n\t\t\t\t\treturn yield* new InvalidInputError({\n\t\t\t\t\t\tmessage: `provider \"${providerId}\" is not in the catalog\\nhint: run \\`codework models providers\\``,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tconst sorted = Object.keys(catalog[providerId] ?? {}).sort((a, b) => a.localeCompare(b));\n\t\t\t\tyield* writeOut(sorted.map((modelId) => `${providerId}/${modelId}\\n`).join(\"\"));\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst lines: string[] = [];\n\t\t\tconst providers = Object.keys(catalog).sort((a, b) => a.localeCompare(b));\n\t\t\tfor (const providerId of providers) {\n\t\t\t\tconst providerModels = Object.keys(catalog[providerId] ?? {}).sort((a, b) => a.localeCompare(b));\n\t\t\t\tfor (const modelId of providerModels) {\n\t\t\t\t\tlines.push(`${providerId}/${modelId}\\n`);\n\t\t\t\t}\n\t\t\t}\n\t\t\tyield* writeOut(lines.join(\"\"));\n\t\t});\n\n\t\treturn yield* program.pipe(Effect.catch(reportFailure));\n\t}),\n);\n"],"mappings":";;;;;;AAQA,IAAA,eAAeA,QACd,IAAI,SAAS,QACb,OAAO,GAAG,iBAAiB,CAAC,CAAC,WAAW,EAAE,YAAY;CA2BrD,OAAO,OA1BS,OAAO,IAAI,aAAa;EACvC,OAAO;EACP,MAAM,UAAU,OAAO,aAAa;EACpC,IAAI,OAAO,OAAO,QAAQ,GAAG;GAC5B,MAAM,aAAa,SAAS;GAC5B,IAAI,CAAC,OAAO,OAAO,SAAS,UAAU,GACrC,OAAO,OAAO,IAAI,kBAAkB,EACnC,SAAS,aAAa,WAAW,kEAClC,CAAC;GAEF,MAAM,SAAS,OAAO,KAAK,QAAQ,eAAe,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,MAAM,EAAE,cAAc,CAAC,CAAC;GACvF,OAAO,SAAS,OAAO,KAAK,YAAY,GAAG,WAAW,GAAG,QAAQ,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC;GAC9E;EACD;EAEA,MAAM,QAAkB,CAAC;EACzB,MAAM,YAAY,OAAO,KAAK,OAAO,CAAC,CAAC,MAAM,GAAG,MAAM,EAAE,cAAc,CAAC,CAAC;EACxE,KAAK,MAAM,cAAc,WAAW;GACnC,MAAM,iBAAiB,OAAO,KAAK,QAAQ,eAAe,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,MAAM,EAAE,cAAc,CAAC,CAAC;GAC/F,KAAK,MAAM,WAAW,gBACrB,MAAM,KAAK,GAAG,WAAW,GAAG,QAAQ,GAAG;EAEzC;EACA,OAAO,SAAS,MAAM,KAAK,EAAE,CAAC;CAC/B,CAEoB,CAAC,CAAC,KAAK,OAAO,MAAM,aAAa,CAAC;AACvD,CAAC,CACF"}
@@ -1,5 +1,5 @@
1
1
  import { i as Cmd, t as handler } from "./runtime-CK2CunDw.mjs";
2
- import { d as writeJson, f as writeOut, i as reportFailure, m as make, p as layer, y as ThreadInfo } from "./error--BWou73I.mjs";
2
+ import { d as writeJson, f as writeOut, i as reportFailure, m as make, p as layer, y as ThreadInfo } from "./error-CPyvkO4x.mjs";
3
3
  import { Effect, Schema } from "effect";
4
4
  import { Session } from "@codeworksh/harness/effect";
5
5
  //#region src/cli/cmd/handlers/thread/list.ts
@@ -33,4 +33,4 @@ var list_default = handler(Cmd.commands.thread.commands.list, Effect.fn("CLI.thr
33
33
  //#endregion
34
34
  export { list_default as default };
35
35
 
36
- //# sourceMappingURL=list-TLhgvlKp.mjs.map
36
+ //# sourceMappingURL=list-DDuzyNv0.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"list-TLhgvlKp.mjs","names":["Runtime.handler","Client.make","ThreadInfoSchema","Client.layer"],"sources":["../../src/cli/cmd/handlers/thread/list.ts"],"sourcesContent":["import { Session } from \"@codeworksh/harness/effect\";\nimport { Effect, Schema } from \"effect\";\nimport { Runtime } from \"../../../../framework/runtime.ts\";\nimport { Client } from \"../../../../server/client.ts\";\nimport { type ThreadInfo, ThreadInfo as ThreadInfoSchema } from \"../../../../server/contract.ts\";\nimport { reportFailure } from \"../../../error.ts\";\nimport { writeJson, writeOut } from \"../../../output.ts\";\nimport { Cmd } from \"../../cmd.ts\";\n\nconst origin = (info: ThreadInfo): string => {\n\tswitch (info.origin.kind) {\n\t\tcase \"main\":\n\t\t\treturn \"main\";\n\t\tcase \"fork\":\n\t\t\treturn `fork of ${info.origin.threadId}`;\n\t\tcase \"subagent\":\n\t\t\treturn `subagent of ${info.origin.threadId}`;\n\t}\n};\n\nconst cost = (info: ThreadInfo) => `$${info.usage.cost.toFixed(4)}`;\n\nexport default Runtime.handler(\n\tCmd.commands.thread.commands.list,\n\tEffect.fn(\"CLI.thread.list\")(function* ({ session, json, server }) {\n\t\tconst program = Effect.gen(function* () {\n\t\t\tconst rpc = yield* Client.make;\n\t\t\tconst threads = yield* rpc[\"thread.list\"]({ sessionId: Session.SessionSchema.ID.make(session) });\n\t\t\tif (json) return yield* writeJson(Schema.Array(ThreadInfoSchema), threads);\n\t\t\tif (threads.length === 0) return yield* writeOut(`No threads in ${session}.\\n`);\n\t\t\tconst rows = threads.map((info) => [\n\t\t\t\tinfo.id,\n\t\t\t\torigin(info),\n\t\t\t\tinfo.model === undefined ? \"-\" : `${info.model.provider}/${info.model.id}`,\n\t\t\t\t`${info.usage.input + info.usage.output} tok ${cost(info)}`,\n\t\t\t\tinfo.title ?? \"(untitled)\",\n\t\t\t]);\n\t\t\tconst widths = rows[0]?.map((_, column) => Math.max(...rows.map((row) => row[column]?.length ?? 0))) ?? [];\n\t\t\tfor (const row of rows) {\n\t\t\t\tconst last = row.length - 1;\n\t\t\t\tyield* writeOut(\n\t\t\t\t\t`${row.map((cell, column) => (column === last ? cell : cell.padEnd(widths[column] ?? 0))).join(\" \")}\\n`,\n\t\t\t\t);\n\t\t\t}\n\t\t});\n\n\t\treturn yield* program.pipe(Effect.provide(Client.layer(server)), Effect.scoped, Effect.catch(reportFailure));\n\t}),\n);\n"],"mappings":";;;;;AASA,MAAM,UAAU,SAA6B;CAC5C,QAAQ,KAAK,OAAO,MAApB;EACC,KAAK,QACJ,OAAO;EACR,KAAK,QACJ,OAAO,WAAW,KAAK,OAAO;EAC/B,KAAK,YACJ,OAAO,eAAe,KAAK,OAAO;CACpC;AACD;AAEA,MAAM,QAAQ,SAAqB,IAAI,KAAK,MAAM,KAAK,QAAQ,CAAC;AAEhE,IAAA,eAAeA,QACd,IAAI,SAAS,OAAO,SAAS,MAC7B,OAAO,GAAG,iBAAiB,CAAC,CAAC,WAAW,EAAE,SAAS,MAAM,UAAU;CAsBlE,OAAO,OArBS,OAAO,IAAI,aAAa;EAEvC,MAAM,UAAU,QAAO,OADJC,KAAAA,CACQ,cAAc,CAAC,EAAE,WAAW,QAAQ,cAAc,GAAG,KAAK,OAAO,EAAE,CAAC;EAC/F,IAAI,MAAM,OAAO,OAAO,UAAU,OAAO,MAAMC,UAAgB,GAAG,OAAO;EACzE,IAAI,QAAQ,WAAW,GAAG,OAAO,OAAO,SAAS,iBAAiB,QAAQ,IAAI;EAC9E,MAAM,OAAO,QAAQ,KAAK,SAAS;GAClC,KAAK;GACL,OAAO,IAAI;GACX,KAAK,UAAU,KAAA,IAAY,MAAM,GAAG,KAAK,MAAM,SAAS,GAAG,KAAK,MAAM;GACtE,GAAG,KAAK,MAAM,QAAQ,KAAK,MAAM,OAAO,OAAO,KAAK,IAAI;GACxD,KAAK,SAAS;EACf,CAAC;EACD,MAAM,SAAS,KAAK,EAAE,EAAE,KAAK,GAAG,WAAW,KAAK,IAAI,GAAG,KAAK,KAAK,QAAQ,IAAI,OAAO,EAAE,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC;EACzG,KAAK,MAAM,OAAO,MAAM;GACvB,MAAM,OAAO,IAAI,SAAS;GAC1B,OAAO,SACN,GAAG,IAAI,KAAK,MAAM,WAAY,WAAW,OAAO,OAAO,KAAK,OAAO,OAAO,WAAW,CAAC,CAAE,CAAC,CAAC,KAAK,IAAI,EAAE,GACtG;EACD;CACD,CAEoB,CAAC,CAAC,KAAK,OAAO,QAAQC,MAAa,MAAM,CAAC,GAAG,OAAO,QAAQ,OAAO,MAAM,aAAa,CAAC;AAC5G,CAAC,CACF"}
1
+ {"version":3,"file":"list-DDuzyNv0.mjs","names":["Runtime.handler","Client.make","ThreadInfoSchema","Client.layer"],"sources":["../../src/cli/cmd/handlers/thread/list.ts"],"sourcesContent":["import { Session } from \"@codeworksh/harness/effect\";\nimport { Effect, Schema } from \"effect\";\nimport { Runtime } from \"../../../../framework/runtime.ts\";\nimport { Client } from \"../../../../server/client.ts\";\nimport { type ThreadInfo, ThreadInfo as ThreadInfoSchema } from \"../../../../server/contract.ts\";\nimport { reportFailure } from \"../../../error.ts\";\nimport { writeJson, writeOut } from \"../../../output.ts\";\nimport { Cmd } from \"../../cmd.ts\";\n\nconst origin = (info: ThreadInfo): string => {\n\tswitch (info.origin.kind) {\n\t\tcase \"main\":\n\t\t\treturn \"main\";\n\t\tcase \"fork\":\n\t\t\treturn `fork of ${info.origin.threadId}`;\n\t\tcase \"subagent\":\n\t\t\treturn `subagent of ${info.origin.threadId}`;\n\t}\n};\n\nconst cost = (info: ThreadInfo) => `$${info.usage.cost.toFixed(4)}`;\n\nexport default Runtime.handler(\n\tCmd.commands.thread.commands.list,\n\tEffect.fn(\"CLI.thread.list\")(function* ({ session, json, server }) {\n\t\tconst program = Effect.gen(function* () {\n\t\t\tconst rpc = yield* Client.make;\n\t\t\tconst threads = yield* rpc[\"thread.list\"]({ sessionId: Session.SessionSchema.ID.make(session) });\n\t\t\tif (json) return yield* writeJson(Schema.Array(ThreadInfoSchema), threads);\n\t\t\tif (threads.length === 0) return yield* writeOut(`No threads in ${session}.\\n`);\n\t\t\tconst rows = threads.map((info) => [\n\t\t\t\tinfo.id,\n\t\t\t\torigin(info),\n\t\t\t\tinfo.model === undefined ? \"-\" : `${info.model.provider}/${info.model.id}`,\n\t\t\t\t`${info.usage.input + info.usage.output} tok ${cost(info)}`,\n\t\t\t\tinfo.title ?? \"(untitled)\",\n\t\t\t]);\n\t\t\tconst widths = rows[0]?.map((_, column) => Math.max(...rows.map((row) => row[column]?.length ?? 0))) ?? [];\n\t\t\tfor (const row of rows) {\n\t\t\t\tconst last = row.length - 1;\n\t\t\t\tyield* writeOut(\n\t\t\t\t\t`${row.map((cell, column) => (column === last ? cell : cell.padEnd(widths[column] ?? 0))).join(\" \")}\\n`,\n\t\t\t\t);\n\t\t\t}\n\t\t});\n\n\t\treturn yield* program.pipe(Effect.provide(Client.layer(server)), Effect.scoped, Effect.catch(reportFailure));\n\t}),\n);\n"],"mappings":";;;;;AASA,MAAM,UAAU,SAA6B;CAC5C,QAAQ,KAAK,OAAO,MAApB;EACC,KAAK,QACJ,OAAO;EACR,KAAK,QACJ,OAAO,WAAW,KAAK,OAAO;EAC/B,KAAK,YACJ,OAAO,eAAe,KAAK,OAAO;CACpC;AACD;AAEA,MAAM,QAAQ,SAAqB,IAAI,KAAK,MAAM,KAAK,QAAQ,CAAC;AAEhE,IAAA,eAAeA,QACd,IAAI,SAAS,OAAO,SAAS,MAC7B,OAAO,GAAG,iBAAiB,CAAC,CAAC,WAAW,EAAE,SAAS,MAAM,UAAU;CAsBlE,OAAO,OArBS,OAAO,IAAI,aAAa;EAEvC,MAAM,UAAU,QAAO,OADJC,KAAAA,CACQ,cAAc,CAAC,EAAE,WAAW,QAAQ,cAAc,GAAG,KAAK,OAAO,EAAE,CAAC;EAC/F,IAAI,MAAM,OAAO,OAAO,UAAU,OAAO,MAAMC,UAAgB,GAAG,OAAO;EACzE,IAAI,QAAQ,WAAW,GAAG,OAAO,OAAO,SAAS,iBAAiB,QAAQ,IAAI;EAC9E,MAAM,OAAO,QAAQ,KAAK,SAAS;GAClC,KAAK;GACL,OAAO,IAAI;GACX,KAAK,UAAU,KAAA,IAAY,MAAM,GAAG,KAAK,MAAM,SAAS,GAAG,KAAK,MAAM;GACtE,GAAG,KAAK,MAAM,QAAQ,KAAK,MAAM,OAAO,OAAO,KAAK,IAAI;GACxD,KAAK,SAAS;EACf,CAAC;EACD,MAAM,SAAS,KAAK,EAAE,EAAE,KAAK,GAAG,WAAW,KAAK,IAAI,GAAG,KAAK,KAAK,QAAQ,IAAI,OAAO,EAAE,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC;EACzG,KAAK,MAAM,OAAO,MAAM;GACvB,MAAM,OAAO,IAAI,SAAS;GAC1B,OAAO,SACN,GAAG,IAAI,KAAK,MAAM,WAAY,WAAW,OAAO,OAAO,KAAK,OAAO,OAAO,WAAW,CAAC,CAAE,CAAC,CAAC,KAAK,IAAI,EAAE,GACtG;EACD;CACD,CAEoB,CAAC,CAAC,KAAK,OAAO,QAAQC,MAAa,MAAM,CAAC,GAAG,OAAO,QAAQ,OAAO,MAAM,aAAa,CAAC;AAC5G,CAAC,CACF"}
@@ -1,6 +1,6 @@
1
1
  import { i as Cmd, t as handler } from "./runtime-CK2CunDw.mjs";
2
- import { f as writeOut, i as reportFailure } from "./error--BWou73I.mjs";
3
- import { i as read } from "./entries-DnbFTTLU.mjs";
2
+ import { f as writeOut, i as reportFailure } from "./error-CPyvkO4x.mjs";
3
+ import { i as read } from "./entries-DpL4xhu0.mjs";
4
4
  import { Effect, Schema } from "effect";
5
5
  import { Plugin } from "@codeworksh/harness/effect";
6
6
  //#region src/cli/cmd/handlers/plugin/list.ts
@@ -74,4 +74,4 @@ var list_default = handler(Cmd.commands.plugin.commands.list, Effect.fn("CLI.plu
74
74
  //#endregion
75
75
  export { list_default as default };
76
76
 
77
- //# sourceMappingURL=list-Df4ngZjL.mjs.map
77
+ //# sourceMappingURL=list-DPbF2uMB.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"list-Df4ngZjL.mjs","names":["Runtime.handler"],"sources":["../../src/cli/cmd/handlers/plugin/list.ts"],"sourcesContent":["import { Plugin } from \"@codeworksh/harness/effect\";\nimport { Effect, Schema } from \"effect\";\nimport { Runtime } from \"../../../../framework/runtime.ts\";\nimport { reportFailure } from \"../../../error.ts\";\nimport { writeOut } from \"../../../output.ts\";\nimport { Cmd } from \"../../cmd.ts\";\nimport { read } from \"./entries.ts\";\n\n/**\n * Two columns: what was written, and what it turned out to be.\n *\n * **The second column doubles as the state, for free.** An ID cannot be known without importing\n * the module -- the store records nothing about the plugin inside a package -- so printing one is\n * proof that everything worked: the entry parsed, the store had it, the import succeeded, and the\n * definition validated. When any of that fails there is no ID to print, and the reason goes in its\n * place.\n *\n * **Nothing is stored to make that work.** The reason is the live error from this run, not a\n * record of an older one: a stored failure goes stale the moment someone fixes the cause, and a\n * list still printing `plugin-import-failed` after you installed the missing dependency is worse\n * than one that says nothing. The work is cheap and local -- a parse, a lookup and an import.\n *\n * (`checkedAt`/`outdated` are stored, for the opposite reason: those come from the network, so\n * re-obtaining them is expensive and a slightly stale answer is the right trade. Local facts are\n * recomputed; remote facts are cached.)\n */\nconst isSourceError = Schema.is(Plugin.SourceError);\nconst isInstallError = Schema.is(Plugin.InstallError);\nconst isStoreError = Schema.is(Plugin.StoreError);\nconst isLoadError = Schema.is(Plugin.LoadError);\n\n/** The §5.5 reason slug, which is the same string the CLI prints and a log line carries. */\nconst reasonOf = (error: unknown): { readonly reason: string; readonly message: string } =>\n\tisSourceError(error) || isInstallError(error) || isStoreError(error) || isLoadError(error)\n\t\t? { reason: error.reason, message: error.message }\n\t\t: { reason: \"plugin-load-failed\", message: String(error) };\n\nexport default Runtime.handler(\n\tCmd.commands.plugin.commands.list,\n\tEffect.fn(\"CLI.plugin.list\")(function* ({ verbose }) {\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\t\t\tif (entries.length === 0) {\n\t\t\t\tyield* writeOut(\"No plugins are configured.\\n\");\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst rows: Array<{ written: string; file: string; state: string; detail?: string }> = [];\n\t\t\tfor (const entry of entries) {\n\t\t\t\t// Resolve-only: listing what is configured must never install anything.\n\t\t\t\tconst inspected = yield* Plugin.inspect(entry.reference, {\n\t\t\t\t\tcache,\n\t\t\t\t\thostDir: entry.from,\n\t\t\t\t\tfile: entry.file,\n\t\t\t\t\tinstall: Plugin.resolveCached,\n\t\t\t\t}).pipe(Effect.result);\n\t\t\t\trows.push(\n\t\t\t\t\tinspected._tag === \"Success\"\n\t\t\t\t\t\t? { written: entry.written, file: entry.file, state: inspected.success.id }\n\t\t\t\t\t\t: {\n\t\t\t\t\t\t\t\twritten: entry.written,\n\t\t\t\t\t\t\t\tfile: entry.file,\n\t\t\t\t\t\t\t\tstate: reasonOf(inspected.failure).reason,\n\t\t\t\t\t\t\t\tdetail: reasonOf(inspected.failure).message,\n\t\t\t\t\t\t\t},\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// The left column is the reference exactly as the entry spells it, because that is the\n\t\t\t// string a person will search their settings for.\n\t\t\tconst width = Math.max(...rows.map((row) => row.written.length));\n\t\t\tfor (const row of rows) {\n\t\t\t\tyield* writeOut(`${row.written.padEnd(width)} ${row.state}\\n`);\n\t\t\t\tif (verbose) {\n\t\t\t\t\tif (row.detail !== undefined) yield* writeOut(`${\" \".repeat(width)} ${row.detail}\\n`);\n\t\t\t\t\tyield* writeOut(`${\" \".repeat(width)} declared in: ${row.file}\\n`);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\treturn yield* program.pipe(Effect.catch(reportFailure));\n\t}),\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AA0BA,MAAM,gBAAgB,OAAO,GAAG,OAAO,WAAW;AAClD,MAAM,iBAAiB,OAAO,GAAG,OAAO,YAAY;AACpD,MAAM,eAAe,OAAO,GAAG,OAA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AA,GAAW,OAAO,SAAS,GAAG,IAAI,OAAO,KAAK,EAAE,IAAI,IAAI,OAAO,GAAG;IACrF,OAAO,SAAS,GAAG,IAAI,OAAO,KAAK,EAAE,iBAAiB,IAAI,KAAK,GAAG;GACnE;EACD;CACD,CAEoB,CAAC,CAAC,KAAK,OAAO,MAAM,aAAa,CAAC;AACvD,CAAC,CACF"}
1
+ {"version":3,"file":"list-DPbF2uMB.mjs","names":["Runtime.handler"],"sources":["../../src/cli/cmd/handlers/plugin/list.ts"],"sourcesContent":["import { Plugin } from \"@codeworksh/harness/effect\";\nimport { Effect, Schema } from \"effect\";\nimport { Runtime } from \"../../../../framework/runtime.ts\";\nimport { reportFailure } from \"../../../error.ts\";\nimport { writeOut } from \"../../../output.ts\";\nimport { Cmd } from \"../../cmd.ts\";\nimport { read } from \"./entries.ts\";\n\n/**\n * Two columns: what was written, and what it turned out to be.\n *\n * **The second column doubles as the state, for free.** An ID cannot be known without importing\n * the module -- the store records nothing about the plugin inside a package -- so printing one is\n * proof that everything worked: the entry parsed, the store had it, the import succeeded, and the\n * definition validated. When any of that fails there is no ID to print, and the reason goes in its\n * place.\n *\n * **Nothing is stored to make that work.** The reason is the live error from this run, not a\n * record of an older one: a stored failure goes stale the moment someone fixes the cause, and a\n * list still printing `plugin-import-failed` after you installed the missing dependency is worse\n * than one that says nothing. The work is cheap and local -- a parse, a lookup and an import.\n *\n * (`checkedAt`/`outdated` are stored, for the opposite reason: those come from the network, so\n * re-obtaining them is expensive and a slightly stale answer is the right trade. Local facts are\n * recomputed; remote facts are cached.)\n */\nconst isSourceError = Schema.is(Plugin.SourceError);\nconst isInstallError = Schema.is(Plugin.InstallError);\nconst isStoreError = Schema.is(Plugin.StoreError);\nconst isLoadError = Schema.is(Plugin.LoadError);\n\n/** The §5.5 reason slug, which is the same string the CLI prints and a log line carries. */\nconst reasonOf = (error: unknown): { readonly reason: string; readonly message: string } =>\n\tisSourceError(error) || isInstallError(error) || isStoreError(error) || isLoadError(error)\n\t\t? { reason: error.reason, message: error.message }\n\t\t: { reason: \"plugin-load-failed\", message: String(error) };\n\nexport default Runtime.handler(\n\tCmd.commands.plugin.commands.list,\n\tEffect.fn(\"CLI.plugin.list\")(function* ({ verbose }) {\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\t\t\tif (entries.length === 0) {\n\t\t\t\tyield* writeOut(\"No plugins are configured.\\n\");\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst rows: Array<{ written: string; file: string; state: string; detail?: string }> = [];\n\t\t\tfor (const entry of entries) {\n\t\t\t\t// Resolve-only: listing what is configured must never install anything.\n\t\t\t\tconst inspected = yield* Plugin.inspect(entry.reference, {\n\t\t\t\t\tcache,\n\t\t\t\t\thostDir: entry.from,\n\t\t\t\t\tfile: entry.file,\n\t\t\t\t\tinstall: Plugin.resolveCached,\n\t\t\t\t}).pipe(Effect.result);\n\t\t\t\trows.push(\n\t\t\t\t\tinspected._tag === \"Success\"\n\t\t\t\t\t\t? { written: entry.written, file: entry.file, state: inspected.success.id }\n\t\t\t\t\t\t: {\n\t\t\t\t\t\t\t\twritten: entry.written,\n\t\t\t\t\t\t\t\tfile: entry.file,\n\t\t\t\t\t\t\t\tstate: reasonOf(inspected.failure).reason,\n\t\t\t\t\t\t\t\tdetail: reasonOf(inspected.failure).message,\n\t\t\t\t\t\t\t},\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// The left column is the reference exactly as the entry spells it, because that is the\n\t\t\t// string a person will search their settings for.\n\t\t\tconst width = Math.max(...rows.map((row) => row.written.length));\n\t\t\tfor (const row of rows) {\n\t\t\t\tyield* writeOut(`${row.written.padEnd(width)} ${row.state}\\n`);\n\t\t\t\tif (verbose) {\n\t\t\t\t\tif (row.detail !== undefined) yield* writeOut(`${\" \".repeat(width)} ${row.detail}\\n`);\n\t\t\t\t\tyield* writeOut(`${\" \".repeat(width)} declared in: ${row.file}\\n`);\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;EACD;EAIA,MAAM,QAAQ,KAAK,IAAI,GAAG,KAAK,KAAK,QAAQ,IAAI,QAAQ,MAAM,CAAC;EAC/D,KAAK,MAAM,OAAO,MAAM;GACvB,OAAO,SAAS,GAAG,IAAI,QAAQ,OAAO,KAAK,EAAE,IAAI,IAAI,MAAM,GAAG;GAC9D,IAAI,SAAS;IACZ,IAAI,IAAI,WAAW,KAAA,GAAW,OAAO,SAAS,GAAG,IAAI,OAAO,KAAK,EAAE,IAAI,IAAI,OAAO,GAAG;IACrF,OAAO,SAAS,GAAG,IAAI,OAAO,KAAK,EAAE,iBAAiB,IAAI,KAAK,GAAG;GACnE;EACD;CACD,CAEoB,CAAC,CAAC,KAAK,OAAO,MAAM,aAAa,CAAC;AACvD,CAAC,CACF"}
@@ -1,6 +1,6 @@
1
1
  import { i as Cmd, t as handler } from "./runtime-CK2CunDw.mjs";
2
- import { f as writeOut, i as reportFailure, m as make, t as InvalidInputError, u as writeError } from "./error--BWou73I.mjs";
3
- import { a as oauthProviderLabel, i as makeOps, n as attempt, o as selectProvider, r as localOps, s as withServer, t as assertServerScope } from "./shared-BU8-Q5m8.mjs";
2
+ import { f as writeOut, i as reportFailure, m as make, t as InvalidInputError, u as writeError } from "./error-CPyvkO4x.mjs";
3
+ import { a as oauthProviderLabel, i as makeOps, n as attempt, o as selectProvider, r as localOps, s as withServer, t as assertServerScope } from "./shared-CiSbTY59.mjs";
4
4
  import { Effect, Option } from "effect";
5
5
  import { formatOAuthSummary, oauthLoginIssue, oauthNotice } from "@codeworksh/aikit/oauth/summary";
6
6
  //#region src/cli/cmd/handlers/auth/login.ts
@@ -42,4 +42,4 @@ var login_default = handler(Cmd.commands.auth.commands.login, Effect.fn("CLI.aut
42
42
  //#endregion
43
43
  export { login_default as default };
44
44
 
45
- //# sourceMappingURL=login-oWLqnAQK.mjs.map
45
+ //# sourceMappingURL=login-BtuROCPJ.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"login-oWLqnAQK.mjs","names":["Runtime.handler","Client.make"],"sources":["../../src/cli/cmd/handlers/auth/login.ts"],"sourcesContent":["import { formatOAuthSummary, oauthLoginIssue, oauthNotice } from \"@codeworksh/aikit/oauth/summary\";\nimport { Effect, Option } from \"effect\";\nimport { Runtime } from \"../../../../framework/runtime.ts\";\nimport { InvalidInputError, reportFailure } from \"../../../error.ts\";\nimport { writeError, writeOut } from \"../../../output.ts\";\nimport { Cmd } from \"../../cmd.ts\";\nimport {\n\tassertServerScope,\n\tattempt,\n\tClient,\n\tlocalOps,\n\tmakeOps,\n\toauthProviderLabel,\n\tselectProvider,\n\twithServer,\n\ttype LoginOptions,\n} from \"./shared.ts\";\n\nexport default Runtime.handler(\n\tCmd.commands.auth.commands.login,\n\tEffect.fn(\"CLI.auth.login\")(function* ({\n\t\tserver,\n\t\topenaiCodex,\n\t\tgithubCopilot,\n\t\tauthFile,\n\t\tbrowser,\n\t\tdevice,\n\t\tenterprise,\n\t\tenableModels,\n\t\tjson,\n\t}) {\n\t\tconst program = Effect.gen(function* () {\n\t\t\tconst provider = yield* selectProvider({ openaiCodex, githubCopilot });\n\t\t\tconst issue = oauthLoginIssue(provider, {\n\t\t\t\tdevice,\n\t\t\t\tenableModels,\n\t\t\t\t...(Option.isSome(enterprise) && { enterprise: enterprise.value }),\n\t\t\t});\n\t\t\tif (issue !== undefined) return yield* new InvalidInputError({ message: issue });\n\n\t\t\tconst name = oauthProviderLabel(provider);\n\t\t\tconst options: LoginOptions = { browser, device, enterprise, enableModels };\n\n\t\t\tif (Option.isSome(server)) {\n\t\t\t\tyield* assertServerScope(authFile);\n\t\t\t\treturn yield* withServer(\n\t\t\t\t\tserver.value,\n\t\t\t\t\tEffect.gen(function* () {\n\t\t\t\t\t\tconst rpc = yield* Client.make;\n\t\t\t\t\t\t// The browser callback and the device prompt both need this\n\t\t\t\t\t\t// terminal, so the login runs here and only the result travels.\n\t\t\t\t\t\tconst { wire } = yield* attempt(`${name} login failed`, () =>\n\t\t\t\t\t\t\tmakeOps(provider, { persist: false }).login(options),\n\t\t\t\t\t\t);\n\t\t\t\t\t\tconst info = yield* rpc[\"auth.save\"]({ credentials: wire });\n\t\t\t\t\t\tyield* writeError(`${oauthNotice(\"saved\", provider, \"the server\")}\\n`);\n\t\t\t\t\t\tyield* writeOut(formatOAuthSummary(info, { json }));\n\t\t\t\t\t}),\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tconst ops = yield* localOps(provider, authFile);\n\t\t\tconst { summary } = yield* attempt(`${name} login failed`, () => ops.login(options));\n\t\t\tyield* writeError(`${oauthNotice(\"saved\", provider, ops.path)}\\n`);\n\t\t\tyield* writeOut(formatOAuthSummary(summary, { json }));\n\t\t});\n\n\t\treturn yield* program.pipe(Effect.catch(reportFailure));\n\t}),\n);\n"],"mappings":";;;;;;AAkBA,IAAA,gBAAeA,QACd,IAAI,SAAS,KAAK,SAAS,OAC3B,OAAO,GAAG,gBAAgB,CAAC,CAAC,WAAW,EACtC,QACA,aACA,eACA,UACA,SACA,QACA,YACA,cACA,QACE;CAqCF,OAAO,OApCS,OAAO,IAAI,aAAa;EACvC,MAAM,WAAW,OAAO,eAAe;GAAE;GAAa;EAAc,CAAC;EACrE,MAAM,QAAQ,gBAAgB,UAAU;GACvC;GACA;GACA,GAAI,OAAO,OAAO,UAAU,KAAK,EAAE,YAAY,WAAW,MAAM;EACjE,CAAC;EACD,IAAI,UAAU,KAAA,GAAW,OAAO,OAAO,IAAI,kBAAkB,EAAE,SAAS,MAAM,CAAC;EAE/E,MAAM,OAAO,mBAAmB,QAAQ;EACxC,MAAM,UAAwB;GAAE;GAAS;GAAQ;GAAY;EAAa;EAE1E,IAAI,OAAO,OAAO,MAAM,GAAG;GAC1B,OAAO,kBAAkB,QAAQ;GACjC,OAAO,OAAO,WACb,OAAO,OACP,OAAO,IAAI,aAAa;IACvB,MAAM,MAAM,OAAOC;IAGnB,MAAM,EAAE,SAAS,OAAO,QAAQ,GAAG,KAAK,sBACvC,QAAQ,UAAU,EAAE,SAAS,MAAM,CAAC,CAAC,CAAC,MAAM,OAAO,CACpD;IACA,MAAM,OAAO,OAAO,IAAI,YAAY,CAAC,EAAE,aAAa,KAAK,CAAC;IAC1D,OAAO,WAAW,GAAG,YAAY,SAAS,UAAU,YAAY,EAAE,GAAG;IACrE,OAAO,SAAS,mBAAmB,MAAM,EAAE,KAAK,CAAC,CAAC;GACnD,CAAC,CACF;EACD;EAEA,MAAM,MAAM,OAAO,SAAS,UAAU,QAAQ;EAC9C,MAAM,EAAE,YAAY,OAAO,QAAQ,GAAG,KAAK,sBAAsB,IAAI,MAAM,OAAO,CAAC;EACnF,OAAO,WAAW,GAAG,YAAY,SAAS,UAAU,IAAI,IAAI,EAAE,GAAG;EACjE,OAAO,SAAS,mBAAmB,SAAS,EAAE,KAAK,CAAC,CAAC;CACtD,CAEoB,CAAC,CAAC,KAAK,OAAO,MAAM,aAAa,CAAC;AACvD,CAAC,CACF"}
1
+ {"version":3,"file":"login-BtuROCPJ.mjs","names":["Runtime.handler","Client.make"],"sources":["../../src/cli/cmd/handlers/auth/login.ts"],"sourcesContent":["import { formatOAuthSummary, oauthLoginIssue, oauthNotice } from \"@codeworksh/aikit/oauth/summary\";\nimport { Effect, Option } from \"effect\";\nimport { Runtime } from \"../../../../framework/runtime.ts\";\nimport { InvalidInputError, reportFailure } from \"../../../error.ts\";\nimport { writeError, writeOut } from \"../../../output.ts\";\nimport { Cmd } from \"../../cmd.ts\";\nimport {\n\tassertServerScope,\n\tattempt,\n\tClient,\n\tlocalOps,\n\tmakeOps,\n\toauthProviderLabel,\n\tselectProvider,\n\twithServer,\n\ttype LoginOptions,\n} from \"./shared.ts\";\n\nexport default Runtime.handler(\n\tCmd.commands.auth.commands.login,\n\tEffect.fn(\"CLI.auth.login\")(function* ({\n\t\tserver,\n\t\topenaiCodex,\n\t\tgithubCopilot,\n\t\tauthFile,\n\t\tbrowser,\n\t\tdevice,\n\t\tenterprise,\n\t\tenableModels,\n\t\tjson,\n\t}) {\n\t\tconst program = Effect.gen(function* () {\n\t\t\tconst provider = yield* selectProvider({ openaiCodex, githubCopilot });\n\t\t\tconst issue = oauthLoginIssue(provider, {\n\t\t\t\tdevice,\n\t\t\t\tenableModels,\n\t\t\t\t...(Option.isSome(enterprise) && { enterprise: enterprise.value }),\n\t\t\t});\n\t\t\tif (issue !== undefined) return yield* new InvalidInputError({ message: issue });\n\n\t\t\tconst name = oauthProviderLabel(provider);\n\t\t\tconst options: LoginOptions = { browser, device, enterprise, enableModels };\n\n\t\t\tif (Option.isSome(server)) {\n\t\t\t\tyield* assertServerScope(authFile);\n\t\t\t\treturn yield* withServer(\n\t\t\t\t\tserver.value,\n\t\t\t\t\tEffect.gen(function* () {\n\t\t\t\t\t\tconst rpc = yield* Client.make;\n\t\t\t\t\t\t// The browser callback and the device prompt both need this\n\t\t\t\t\t\t// terminal, so the login runs here and only the result travels.\n\t\t\t\t\t\tconst { wire } = yield* attempt(`${name} login failed`, () =>\n\t\t\t\t\t\t\tmakeOps(provider, { persist: false }).login(options),\n\t\t\t\t\t\t);\n\t\t\t\t\t\tconst info = yield* rpc[\"auth.save\"]({ credentials: wire });\n\t\t\t\t\t\tyield* writeError(`${oauthNotice(\"saved\", provider, \"the server\")}\\n`);\n\t\t\t\t\t\tyield* writeOut(formatOAuthSummary(info, { json }));\n\t\t\t\t\t}),\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tconst ops = yield* localOps(provider, authFile);\n\t\t\tconst { summary } = yield* attempt(`${name} login failed`, () => ops.login(options));\n\t\t\tyield* writeError(`${oauthNotice(\"saved\", provider, ops.path)}\\n`);\n\t\t\tyield* writeOut(formatOAuthSummary(summary, { json }));\n\t\t});\n\n\t\treturn yield* program.pipe(Effect.catch(reportFailure));\n\t}),\n);\n"],"mappings":";;;;;;AAkBA,IAAA,gBAAeA,QACd,IAAI,SAAS,KAAK,SAAS,OAC3B,OAAO,GAAG,gBAAgB,CAAC,CAAC,WAAW,EACtC,QACA,aACA,eACA,UACA,SACA,QACA,YACA,cAC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Dw.mjs";
2
- import { f as writeOut, i as reportFailure, n as OAuthError, u as writeError } from "./error--BWou73I.mjs";
3
- import { i as oauthServer } from "./shared-BnR3BFZM.mjs";
2
+ import { f as writeOut, i as reportFailure, n as OAuthError, u as writeError } from "./error-CPyvkO4x.mjs";
3
+ import { i as oauthServer } from "./shared-CDyNsYBy.mjs";
4
4
  import { Duration, Effect, Logger } from "effect";
5
5
  import { McpOAuth } from "@codeworksh/harness/effect";
6
6
  import { openBrowser } from "@codeworksh/aikit/oauth/interactive";
@@ -56,4 +56,4 @@ var login_default = handler(Cmd.commands.mcp.commands.login, Effect.fn("CLI.mcp.
56
56
  //#endregion
57
57
  export { login_default as default };
58
58
 
59
- //# sourceMappingURL=login-BJ3d7FM_.mjs.map
59
+ //# sourceMappingURL=login-CGXU21AK.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"login-BJ3d7FM_.mjs","names":["Runtime.handler"],"sources":["../../src/cli/cmd/handlers/mcp/login.ts"],"sourcesContent":["/* @effect-diagnostics nodeBuiltinImport:off -- the pasted redirect URL is read from standard input. */\nimport { createInterface } from \"node:readline\";\nimport { openBrowser } from \"@codeworksh/aikit/oauth/interactive\";\nimport { McpOAuth } from \"@codeworksh/harness/effect\";\nimport { Duration, Effect, Logger } from \"effect\";\nimport { Runtime } from \"../../../../framework/runtime.ts\";\nimport { OAuthError, reportFailure } from \"../../../error.ts\";\nimport { writeError, writeOut } from \"../../../output.ts\";\nimport { Cmd } from \"../../cmd.ts\";\nimport { oauthServer } from \"./shared.ts\";\n\n/**\n * The redirected URL, typed or piped in when the browser cannot reach this machine's callback (over\n * SSH, say). Piped input that ends without a line leaves the callback to finish the sign-in; a\n * terminal that closes (Ctrl+C, Ctrl+D) cancels it.\n */\nconst paste: Effect.Effect<string> = Effect.acquireUseRelease(\n\tEffect.sync(() => ({\n\t\treadline: createInterface({ input: process.stdin, output: process.stderr }),\n\t\tanswered: false,\n\t})),\n\t(asking) =>\n\t\tEffect.callback<string>((resume) => {\n\t\t\tconst answer = (line: string) => {\n\t\t\t\tasking.answered = true;\n\t\t\t\tresume(Effect.succeed(line));\n\t\t\t};\n\t\t\tasking.readline.question(\"Or paste the URL the browser was redirected to: \", answer);\n\t\t\t// An empty answer cancels the sign-in.\n\t\t\tif (process.stdin.isTTY) asking.readline.once(\"close\", () => answer(\"\"));\n\t\t}),\n\t(asking) =>\n\t\tEffect.sync(() => {\n\t\t\tconst unanswered = !asking.answered;\n\t\t\tasking.readline.close();\n\t\t\t// A pipe still open would keep the process alive after the sign-in.\n\t\t\tprocess.stdin.destroy();\n\t\t\t// What follows starts on its own line, not after the prompt.\n\t\t\tif (unanswered) process.stderr.write(\"\\n\");\n\t\t}),\n);\n\nexport default Runtime.handler(\n\tCmd.commands.mcp.commands.login,\n\tEffect.fn(\"CLI.mcp.login\")(function* ({ name, browser, timeout }) {\n\t\tconst program = Effect.gen(function* () {\n\t\t\tconst { store, config } = yield* oauthServer(name);\n\t\t\tconst limit = Duration.seconds(timeout);\n\t\t\tconst result = yield* McpOAuth.login({\n\t\t\t\tstore,\n\t\t\t\tname,\n\t\t\t\tconfig,\n\t\t\t\tprompt: {\n\t\t\t\t\tshow: (url) =>\n\t\t\t\t\t\tEffect.gen(function* () {\n\t\t\t\t\t\t\tyield* writeError(`Sign in to MCP server \"${name}\" in your browser:\\n${url.href}\\n`);\n\t\t\t\t\t\t\tif (browser)\n\t\t\t\t\t\t\t\tyield* Effect.sync(\n\t\t\t\t\t\t\t\t\t() =>\n\t\t\t\t\t\t\t\t\t\tvoid openBrowser(url.href, (error) =>\n\t\t\t\t\t\t\t\t\t\t\tprocess.stderr.write(`Failed to open browser: ${error.message}\\n`),\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}),\n\t\t\t\t\tpaste,\n\t\t\t\t},\n\t\t\t}).pipe(\n\t\t\t\tEffect.timeoutOrElse({\n\t\t\t\t\tduration: limit,\n\t\t\t\t\torElse: () =>\n\t\t\t\t\t\tEffect.fail(new OAuthError({ message: `sign-in timed out after ${Duration.format(limit)}` })),\n\t\t\t\t}),\n\t\t\t);\n\t\t\tconst tools = `${result.tools} tool${result.tools === 1 ? \"\" : \"s\"}`;\n\t\t\tyield* writeOut(\n\t\t\t\tresult.signedIn\n\t\t\t\t\t? `Signed in to MCP server \"${name}\" (${tools}).\\n`\n\t\t\t\t\t: `Already signed in to MCP server \"${name}\" (${tools}).\\n`,\n\t\t\t);\n\t\t});\n\t\t// Stdout carries only the outcome; harness logs go with the rest of the diagnostics.\n\t\treturn yield* program.pipe(Effect.provideService(Logger.LogToStderr, true), Effect.catch(reportFailure));\n\t}),\n);\n"],"mappings":";;;;;;;;;;;;;AAgBA,MAAM,QAA+B,OAAO,kBAC3C,OAAO,YAAY;CAClB,UAAU,gBAAgB;EAAE,OAAO,QAAQ;EAAO,QAAQ,QAAQ;CAAO,CAAC;CAC1E,UAAU;AACX,EAAE,IACD,WACA,OAAO,UAAkB,WAAW;CACnC,MAAM,UAAU,SAAiB;EAChC,OAAO,WAAW;EAClB,OAAO,OAAO,QAAQ,IAAI,CAAC;CAC5B;CACA,OAAO,SAAS,SAAS,oDAAoD,MAAM;CAEnF,IAAI,QAAQ,MAAM,OAAO,OAAO,SAAS,KAAK,eAAe,OAAO,EAAE,CAAC;AACxE,CAAC,IACD,WACA,OAAO,WAAW;CACjB,MAAM,aAAa,CAAC,OAAO;CAC3B,OAAO,SAAS,MAAM;CAEtB,QAAQ,MAAM,QAAQ;CAEtB,IAAI,YAAY,QAAQ,OAAO,MAAM,IAAI;AAC1C,CAAC,CACH;AAEA,IAAA,gBAAeA,QACd,IAAI,SAAS,IAAI,SAAS,OAC1B,OAAO,GAAG,eAAe,CAAC,CAAC,WAAW,EAAE,MAAM,SAAS,WAAW;CAqCjE,OAAO,OApCS,OAAO,IAAI,aAAa;EACvC,MAAM,EAAE,OAAO,WAAW,OAAO,YAAY,IAAI;EACjD,MAAM,QAAQ,SAAS,QAAQ,OAAO;EACtC,MAAM,SAAS,OAAO,SAAS,MAAM;GACpC;GACA;GACA;GACA,QAAQ;IACP,OAAO,QACN,OAAO,IAAI,aAAa;KACvB,OAAO,WAAW,0BAA0B,KAAK,sBAAsB,IAAI,KAAK,GAAG;KACnF,IAAI,SACH,OAAO,OAAO,WAEZ,KAAK,YAAY,IAAI,OAAO,UAC3B,QAAQ,OAAO,MAAM,2BAA2B,MAAM,QAAQ,GAAG,CAClE,CACF;IACF,CAAC;IACF;GACD;EACD,CAAC,CAAC,CAAC,KACF,OAAO,cAAc;GACpB,UAAU;GACV,cACC,OAAO,KAAK,IAAI,WAAW,EAAE,SAAS,2BAA2B,SAAS,OAAO,KAAK,IAAI,CAAC,CAAC;EAC9F,CAAC,CACF;EACA,MAAM,QAAQ,GAAG,OAAO,MAAM,OAAO,OAAO,UAAU,IAAI,KAAK;EAC/D,OAAO,SACN,OAAO,WACJ,4BAA4B,KAAK,KAAK,MAAM,QAC5C,oCAAoC,KAAK,KAAK,MAAM,KACxD;CACD,CAEoB,CAAC,CAAC,KAAK,OAAO,eAAe,OAAO,aAAa,IAAI,GAAG,OAAO,MAAM,aAAa,CAAC;AACxG,CAAC,CACF"}
1
+ {"version":3,"file":"login-CGXU21AK.mjs","names":["Runtime.handler"],"sources":["../../src/cli/cmd/handlers/mcp/login.ts"],"sourcesContent":["/* @effect-diagnostics nodeBuiltinImport:off -- the pasted redirect URL is read from standard input. */\nimport { createInterface } from \"node:readline\";\nimport { openBrowser } from \"@codeworksh/aikit/oauth/interactive\";\nimport { McpOAuth } from \"@codeworksh/harness/effect\";\nimport { Duration, Effect, Logger } from \"effect\";\nimport { Runtime } from \"../../../../framework/runtime.ts\";\nimport { OAuthError, reportFailure } from \"../../../error.ts\";\nimport { writeError, writeOut } from \"../../../output.ts\";\nimport { Cmd } from \"../../cmd.ts\";\nimport { oauthServer } from \"./shared.ts\";\n\n/**\n * The redirected URL, typed or piped in when the browser cannot reach this machine's callback (over\n * SSH, say). Piped input that ends without a line leaves the callback to finish the sign-in; a\n * terminal that closes (Ctrl+C, Ctrl+D) cancels it.\n */\nconst paste: Effect.Effect<string> = Effect.acquireUseRelease(\n\tEffect.sync(() => ({\n\t\treadline: createInterface({ input: process.stdin, output: process.stderr }),\n\t\tanswered: false,\n\t})),\n\t(asking) =>\n\t\tEffect.callback<string>((resume) => {\n\t\t\tconst answer = (line: string) => {\n\t\t\t\tasking.answered = true;\n\t\t\t\tresume(Effect.succeed(line));\n\t\t\t};\n\t\t\tasking.readline.question(\"Or paste the URL the browser was redirected to: \", answer);\n\t\t\t// An empty answer cancels the sign-in.\n\t\t\tif (process.stdin.isTTY) asking.readline.once(\"close\", () => answer(\"\"));\n\t\t}),\n\t(asking) =>\n\t\tEffect.sync(() => {\n\t\t\tconst unanswered = !asking.answered;\n\t\t\tasking.readline.close();\n\t\t\t// A pipe still open would keep the process alive after the sign-in.\n\t\t\tprocess.stdin.destroy();\n\t\t\t// What follows starts on its own line, not after the prompt.\n\t\t\tif (unanswered) process.stderr.write(\"\\n\");\n\t\t}),\n);\n\nexport default Runtime.handler(\n\tCmd.commands.mcp.commands.login,\n\tEffect.fn(\"CLI.mcp.login\")(function* ({ name, browser, timeout }) {\n\t\tconst program = Effect.gen(function* () {\n\t\t\tconst { store, config } = yield* oauthServer(name);\n\t\t\tconst limit = Duration.seconds(timeout);\n\t\t\tconst result = yield* McpOAuth.login({\n\t\t\t\tstore,\n\t\t\t\tname,\n\t\t\t\tconfig,\n\t\t\t\tprompt: {\n\t\t\t\t\tshow: (url) =>\n\t\t\t\t\t\tEffect.gen(function* () {\n\t\t\t\t\t\t\tyield* writeError(`Sign in to MCP server \"${name}\" in your browser:\\n${url.href}\\n`);\n\t\t\t\t\t\t\tif (browser)\n\t\t\t\t\t\t\t\tyield* Effect.sync(\n\t\t\t\t\t\t\t\t\t() =>\n\t\t\t\t\t\t\t\t\t\tvoid openBrowser(url.href, (error) =>\n\t\t\t\t\t\t\t\t\t\t\tprocess.stderr.write(`Failed to open browser: ${error.message}\\n`),\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}),\n\t\t\t\t\tpaste,\n\t\t\t\t},\n\t\t\t}).pipe(\n\t\t\t\tEffect.timeoutOrElse({\n\t\t\t\t\tduration: limit,\n\t\t\t\t\torElse: () =>\n\t\t\t\t\t\tEffect.fail(new OAuthError({ message: `sign-in timed out after ${Duration.format(limit)}` })),\n\t\t\t\t}),\n\t\t\t);\n\t\t\tconst tools = `${result.tools} tool${result.tools === 1 ? \"\" : \"s\"}`;\n\t\t\tyield* writeOut(\n\t\t\t\tresult.signedIn\n\t\t\t\t\t? `Signed in to MCP server \"${name}\" (${tools}).\\n`\n\t\t\t\t\t: `Already signed in to MCP server \"${name}\" (${tools}).\\n`,\n\t\t\t);\n\t\t});\n\t\t// Stdout carries only the outcome; harness logs go with the rest of the diagnostics.\n\t\treturn yield* program.pipe(Effect.provideService(Logger.LogToStderr, true), Effect.catch(reportFailure));\n\t}),\n);\n"],"mappings":";;;;;;;;;;;;;AAgBA,MAAM,QAA+B,OAAO,kBAC3C,OAAO,YAAY;CAClB,UAAU,gBAAgB;EAAE,OAAO,QAAQ;EAAO,QAAQ,QAAQ;CAAO,CAAC;CAC1E,UAAU;AACX,EAAE,IACD,WACA,OAAO,UAAkB,WAAW;CACnC,MAAM,UAAU,SAAiB;EAChC,OAAO,WAAW;EAClB,OAAO,OAAO,QAAQ,IAAI,CAAC;CAC5B;CACA,OAAO,SAAS,SAAS,oDAAoD,MAAM;CAEnF,IAAI,QAAQ,MAAM,OAAO,OAAO,SAAS,KAAK,eAAe,OAAO,EAAE,CAAC;AACxE,CAAC,IACD,WACA,OAAO,WAAW;CACjB,MAAM,aAAa,CAAC,OAAO;CAC3B,OAAO,SAAS,MAAM;CAEtB,QAAQ,MAAM,QAAQ;CAEtB,IAAI,YAAY,QAAQ,OAAO,MAAM,IAAI;AAC1C,CAAC,CACH;AAEA,IAAA,gBAAeA,QACd,IAAI,SAAS,IAAI,SAAS,OAC1B,OAAO,GAAG,eAAe,CAAC,CAAC,WAAW,EAAE,MAAM,SAAS,WAAW;CAqCjE,OAAO,OApCS,OAAO,IAAI,aAAa;EACvC,MAAM,EAAE,OAAO,WAAW,OAAO,YAAY,IAAI;EACjD,MAAM,QAAQ,SAAS,QAAQ,OAAO;EACtC,MAAM,SAAS,OAAO,SAAS,MAAM;GACpC;GACA;GACA;GACA,QAAQ;IACP,OAAO,QACN,OAAO,IAAI,aAAa;KACvB,OAAO,WAAW,0BAA0B,KAAK,sBAAsB,IAAI,KAAK,GAAG;KACnF,IAAI,SACH,OAAO,OAAO,WAEZ,KAAK,YAAY,IAAI,OAAO,UAC3B,QAAQ,OAAO,MAAM,2BAA2B,MAAM,QAAQ,GAAG,CAClE,CACF;IACF,CAAC;IACF;GACD;EACD,CAAC,CAAC,CAAC,KACF,OAAO,cAAc;GACpB,UAAU;GACV,cACC,OAAO,KAAK,IAAI,WAAW,EAAE,SAAS,2BAA2B,SAAS,OAAO,KAAK,IAAI,CAAC,CAAC;EAC9F,CAAC,CACF;EACA,MAAM,QAAQ,GAAG,OAAO,MAAM,OAAO,OAAO,UAAU,IAAI,KAAK;EAC/D,OAAO,SACN,OAAO,WACJ,4BAA4B,KAAK,KAAK,MAAM,QAC5C,oCAAoC,KAAK,KAAK,MAAM,KACxD;CACD,CAEoB,CAAC,CAAC,KAAK,OAAO,eAAe,OAAO,aAAa,IAAI,GAAG,OAAO,MAAM,aAAa,CAAC;AACxG,CAAC,CACF"}
@@ -1,6 +1,6 @@
1
1
  import { i as Cmd, t as handler } from "./runtime-CK2CunDw.mjs";
2
- import { f as writeOut, i as reportFailure } from "./error--BWou73I.mjs";
3
- import { i as oauthServer } from "./shared-BnR3BFZM.mjs";
2
+ import { f as writeOut, i as reportFailure } from "./error-CPyvkO4x.mjs";
3
+ import { i as oauthServer } from "./shared-CDyNsYBy.mjs";
4
4
  import { Effect } from "effect";
5
5
  import { McpOAuth } from "@codeworksh/harness/effect";
6
6
  //#region src/cli/cmd/handlers/mcp/logout.ts
@@ -14,4 +14,4 @@ var logout_default = handler(Cmd.commands.mcp.commands.logout, Effect.fn("CLI.mc
14
14
  //#endregion
15
15
  export { logout_default as default };
16
16
 
17
- //# sourceMappingURL=logout-D44pgH6b.mjs.map
17
+ //# sourceMappingURL=logout-Bnk2hxfZ.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"logout-D44pgH6b.mjs","names":["Runtime.handler"],"sources":["../../src/cli/cmd/handlers/mcp/logout.ts"],"sourcesContent":["import { McpOAuth } 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 { oauthServer } from \"./shared.ts\";\n\nexport default Runtime.handler(\n\tCmd.commands.mcp.commands.logout,\n\tEffect.fn(\"CLI.mcp.logout\")(function* ({ name }) {\n\t\tconst program = Effect.gen(function* () {\n\t\t\tconst { store, server } = yield* oauthServer(name);\n\t\t\tconst removed = yield* McpOAuth.signOut(store, server);\n\t\t\tyield* writeOut(\n\t\t\t\tremoved ? `Signed out of MCP server \"${name}\".\\n` : `MCP server \"${name}\" has no stored sign-in.\\n`,\n\t\t\t);\n\t\t});\n\t\treturn yield* program.pipe(Effect.catch(reportFailure));\n\t}),\n);\n"],"mappings":";;;;;;AAQA,IAAA,iBAAeA,QACd,IAAI,SAAS,IAAI,SAAS,QAC1B,OAAO,GAAG,gBAAgB,CAAC,CAAC,WAAW,EAAE,QAAQ;CAQhD,OAAO,OAPS,OAAO,IAAI,aAAa;EACvC,MAAM,EAAE,OAAO,WAAW,OAAO,YAAY,IAAI;EACjD,MAAM,UAAU,OAAO,SAAS,QAAQ,OAAO,MAAM;EACrD,OAAO,SACN,UAAU,6BAA6B,KAAK,QAAQ,eAAe,KAAK,2BACzE;CACD,CACoB,CAAC,CAAC,KAAK,OAAO,MAAM,aAAa,CAAC;AACvD,CAAC,CACF"}
1
+ {"version":3,"file":"logout-Bnk2hxfZ.mjs","names":["Runtime.handler"],"sources":["../../src/cli/cmd/handlers/mcp/logout.ts"],"sourcesContent":["import { McpOAuth } 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 { oauthServer } from \"./shared.ts\";\n\nexport default Runtime.handler(\n\tCmd.commands.mcp.commands.logout,\n\tEffect.fn(\"CLI.mcp.logout\")(function* ({ name }) {\n\t\tconst program = Effect.gen(function* () {\n\t\t\tconst { store, server } = yield* oauthServer(name);\n\t\t\tconst removed = yield* McpOAuth.signOut(store, server);\n\t\t\tyield* writeOut(\n\t\t\t\tremoved ? `Signed out of MCP server \"${name}\".\\n` : `MCP server \"${name}\" has no stored sign-in.\\n`,\n\t\t\t);\n\t\t});\n\t\treturn yield* program.pipe(Effect.catch(reportFailure));\n\t}),\n);\n"],"mappings":";;;;;;AAQA,IAAA,iBAAeA,QACd,IAAI,SAAS,IAAI,SAAS,QAC1B,OAAO,GAAG,gBAAgB,CAAC,CAAC,WAAW,EAAE,QAAQ;CAQhD,OAAO,OAPS,OAAO,IAAI,aAAa;EACvC,MAAM,EAAE,OAAO,WAAW,OAAO,YAAY,IAAI;EACjD,MAAM,UAAU,OAAO,SAAS,QAAQ,OAAO,MAAM;EACrD,OAAO,SACN,UAAU,6BAA6B,KAAK,QAAQ,eAAe,KAAK,2BACzE;CACD,CACoB,CAAC,CAAC,KAAK,OAAO,MAAM,aAAa,CAAC;AACvD,CAAC,CACF"}
@@ -1,6 +1,6 @@
1
1
  import { i as Cmd, t as handler } from "./runtime-CK2CunDw.mjs";
2
- import { i as reportFailure, m as make, u as writeError } from "./error--BWou73I.mjs";
3
- import { a as oauthProviderLabel, n as attempt, o as selectProvider, r as localOps, s as withServer, t as assertServerScope } from "./shared-BU8-Q5m8.mjs";
2
+ import { i as reportFailure, m as make, u as writeError } from "./error-CPyvkO4x.mjs";
3
+ import { a as oauthProviderLabel, n as attempt, o as selectProvider, r as localOps, s as withServer, t as assertServerScope } from "./shared-CiSbTY59.mjs";
4
4
  import { Effect, Option } from "effect";
5
5
  import { oauthNotice } from "@codeworksh/aikit/oauth/summary";
6
6
  //#region src/cli/cmd/handlers/auth/logout.ts
@@ -26,4 +26,4 @@ var logout_default = handler(Cmd.commands.auth.commands.logout, Effect.fn("CLI.a
26
26
  //#endregion
27
27
  export { logout_default as default };
28
28
 
29
- //# sourceMappingURL=logout-ClrNQ8LO.mjs.map
29
+ //# sourceMappingURL=logout-DUn8KSjX.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"logout-ClrNQ8LO.mjs","names":["Runtime.handler","Client.make"],"sources":["../../src/cli/cmd/handlers/auth/logout.ts"],"sourcesContent":["import { oauthNotice } from \"@codeworksh/aikit/oauth/summary\";\nimport { Effect, Option } from \"effect\";\nimport { Runtime } from \"../../../../framework/runtime.ts\";\nimport { reportFailure } from \"../../../error.ts\";\nimport { writeError } from \"../../../output.ts\";\nimport { Cmd } from \"../../cmd.ts\";\nimport {\n\tassertServerScope,\n\tattempt,\n\tClient,\n\tlocalOps,\n\toauthProviderLabel,\n\tselectProvider,\n\twithServer,\n} from \"./shared.ts\";\n\nexport default Runtime.handler(\n\tCmd.commands.auth.commands.logout,\n\tEffect.fn(\"CLI.auth.logout\")(function* ({ server, openaiCodex, githubCopilot, authFile }) {\n\t\tconst program = Effect.gen(function* () {\n\t\t\tconst provider = yield* selectProvider({ openaiCodex, githubCopilot });\n\t\t\tconst name = oauthProviderLabel(provider);\n\n\t\t\tif (Option.isSome(server)) {\n\t\t\t\tyield* assertServerScope(authFile);\n\t\t\t\treturn yield* withServer(\n\t\t\t\t\tserver.value,\n\t\t\t\t\tEffect.gen(function* () {\n\t\t\t\t\t\tconst rpc = yield* Client.make;\n\t\t\t\t\t\tyield* rpc[\"auth.logout\"]({ provider });\n\t\t\t\t\t\tyield* writeError(`${oauthNotice(\"cleared\", provider, \"the server\")}\\n`);\n\t\t\t\t\t}),\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tconst ops = yield* localOps(provider, authFile);\n\t\t\tyield* attempt(`failed to clear ${name} credentials`, () => ops.logout());\n\t\t\tyield* writeError(`${oauthNotice(\"cleared\", provider, ops.path)}\\n`);\n\t\t});\n\n\t\treturn yield* program.pipe(Effect.catch(reportFailure));\n\t}),\n);\n"],"mappings":";;;;;;AAgBA,IAAA,iBAAeA,QACd,IAAI,SAAS,KAAK,SAAS,QAC3B,OAAO,GAAG,iBAAiB,CAAC,CAAC,WAAW,EAAE,QAAQ,aAAa,eAAe,YAAY;CAsBzF,OAAO,OArBS,OAAO,IAAI,aAAa;EACvC,MAAM,WAAW,OAAO,eAAe;GAAE;GAAa;EAAc,CAAC;EACrE,MAAM,OAAO,mBAAmB,QAAQ;EAExC,IAAI,OAAO,OAAO,MAAM,GAAG;GAC1B,OAAO,kBAAkB,QAAQ;GACjC,OAAO,OAAO,WACb,OAAO,OACP,OAAO,IAAI,aAAa;IAEvB,QAAO,OADYC,KAAAA,CACR,cAAc,CAAC,EAAE,SAAS,CAAC;IACtC,OAAO,WAAW,GAAG,YAAY,WAAW,UAAU,YAAY,EAAE,GAAG;GACxE,CAAC,CACF;EACD;EAEA,MAAM,MAAM,OAAO,SAAS,UAAU,QAAQ;EAC9C,OAAO,QAAQ,mBAAmB,KAAK,qBAAqB,IAAI,OAAO,CAAC;EACxE,OAAO,WAAW,GAAG,YAAY,WAAW,UAAU,IAAI,IAAI,EAAE,GAAG;CACpE,CAEoB,CAAC,CAAC,KAAK,OAAO,MAAM,aAAa,CAAC;AACvD,CAAC,CACF"}
1
+ {"version":3,"file":"logout-DUn8KSjX.mjs","names":["Runtime.handler","Client.make"],"sources":["../../src/cli/cmd/handlers/auth/logout.ts"],"sourcesContent":["import { oauthNotice } from \"@codeworksh/aikit/oauth/summary\";\nimport { Effect, Option } from \"effect\";\nimport { Runtime } from \"../../../../framework/runtime.ts\";\nimport { reportFailure } from \"../../../error.ts\";\nimport { writeError } from \"../../../output.ts\";\nimport { Cmd } from \"../../cmd.ts\";\nimport {\n\tassertServerScope,\n\tattempt,\n\tClient,\n\tlocalOps,\n\toauthProviderLabel,\n\tselectProvider,\n\twithServer,\n} from \"./shared.ts\";\n\nexport default Runtime.handler(\n\tCmd.commands.auth.commands.logout,\n\tEffect.fn(\"CLI.auth.logout\")(function* ({ server, openaiCodex, githubCopilot, authFile }) {\n\t\tconst program = Effect.gen(function* () {\n\t\t\tconst provider = yield* selectProvider({ openaiCodex, githubCopilot });\n\t\t\tconst name = oauthProviderLabel(provider);\n\n\t\t\tif (Option.isSome(server)) {\n\t\t\t\tyield* assertServerScope(authFile);\n\t\t\t\treturn yield* withServer(\n\t\t\t\t\tserver.value,\n\t\t\t\t\tEffect.gen(function* () {\n\t\t\t\t\t\tconst rpc = yield* Client.make;\n\t\t\t\t\t\tyield* rpc[\"auth.logout\"]({ provider });\n\t\t\t\t\t\tyield* writeError(`${oauthNotice(\"cleared\", provider, \"the server\")}\\n`);\n\t\t\t\t\t}),\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tconst ops = yield* localOps(provider, authFile);\n\t\t\tyield* attempt(`failed to clear ${name} credentials`, () => ops.logout());\n\t\t\tyield* writeError(`${oauthNotice(\"cleared\", provider, ops.path)}\\n`);\n\t\t});\n\n\t\treturn yield* program.pipe(Effect.catch(reportFailure));\n\t}),\n);\n"],"mappings":";;;;;;AAgBA,IAAA,iBAAeA,QACd,IAAI,SAAS,KAAK,SAAS,QAC3B,OAAO,GAAG,iBAAiB,CAAC,CAAC,WAAW,EAAE,QAAQ,aAAa,eAAe,YAAY;CAsBzF,OAAO,OArBS,OAAO,IAAI,aAAa;EACvC,MAAM,WAAW,OAAO,eAAe;GAAE;GAAa;EAAc,CAAC;EACrE,MAAM,OAAO,mBAAmB,QAAQ;EAExC,IAAI,OAAO,OAAO,MAAM,GAAG;GAC1B,OAAO,kBAAkB,QAAQ;GACjC,OAAO,OAAO,WACb,OAAO,OACP,OAAO,IAAI,aAAa;IAEvB,QAAO,OADYC,KAAAA,CACR,cAAc,CAAC,EAAE,SAAS,CAAC;IACtC,OAAO,WAAW,GAAG,YAAY,WAAW,UAAU,YAAY,EAAE,GAAG;GACxE,CAAC,CACF;EACD;EAEA,MAAM,MAAM,OAAO,SAAS,UAAU,QAAQ;EAC9C,OAAO,QAAQ,mBAAmB,KAAK,qBAAqB,IAAI,OAAO,CAAC;EACxE,OAAO,WAAW,GAAG,YAAY,WAAW,UAAU,IAAI,IAAI,EAAE,GAAG;CACpE,CAEoB,CAAC,CAAC,KAAK,OAAO,MAAM,aAAa,CAAC;AACvD,CAAC,CACF"}
@@ -0,0 +1,6 @@
1
+ //#region package.json
2
+ var version = "0.8.0-dev.20261106090116";
3
+ //#endregion
4
+ export { version as t };
5
+
6
+ //# sourceMappingURL=package-b1hY7JGl.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"package-b1hY7JGl.mjs","names":[],"sources":["../../package.json"],"sourcesContent":[""],"mappings":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codeworksh/cli",
3
- "version": "0.7.0",
3
+ "version": "0.8.0-dev.20261106090116",
4
4
  "description": "CLI for running CodeWork coding agent harness.",
5
5
  "keywords": [
6
6
  "agent",
@@ -40,8 +40,8 @@
40
40
  },
41
41
  "dependencies": {
42
42
  "@agentclientprotocol/sdk": "1.5.1",
43
- "@codeworksh/aikit": "^0.13.0",
44
- "@codeworksh/harness": "0.7.0",
43
+ "@codeworksh/aikit": "0.14.0-dev.20261106090116",
44
+ "@codeworksh/harness": "0.8.0-dev.20261106090116",
45
45
  "@effect/platform-node": "4.0.5",
46
46
  "@effect/platform-node-shared": "4.0.5",
47
47
  "effect": "4.0.5",
@@ -1,5 +1,5 @@
1
1
  import { i as Cmd, t as handler } from "./runtime-CK2CunDw.mjs";
2
- import { f as writeOut, i as reportFailure } from "./error--BWou73I.mjs";
2
+ import { f as writeOut, i as reportFailure } from "./error-CPyvkO4x.mjs";
3
3
  import { n as synced } from "./catalog-XfqtqMDz.mjs";
4
4
  import { Effect } from "effect";
5
5
  import { ModelCatalog } from "@codeworksh/harness/effect";
@@ -14,4 +14,4 @@ var providers_default = handler(Cmd.commands.models.commands.providers, Effect.f
14
14
  //#endregion
15
15
  export { providers_default as default };
16
16
 
17
- //# sourceMappingURL=providers-ozcPo-AJ.mjs.map
17
+ //# sourceMappingURL=providers-GEdlDJHp.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"providers-ozcPo-AJ.mjs","names":["Runtime.handler"],"sources":["../../src/cli/cmd/handlers/models/providers.ts"],"sourcesContent":["import { ModelCatalog } 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 { synced } from \"./catalog.ts\";\n\nexport default Runtime.handler(\n\tCmd.commands.models.commands.providers,\n\tEffect.fn(\"CLI.models.providers\")(function* () {\n\t\tconst program = Effect.gen(function* () {\n\t\t\tyield* synced;\n\t\t\tconst providers = yield* ModelCatalog.providers;\n\t\t\tconst sorted = [...providers].sort((a, b) => a.localeCompare(b));\n\t\t\tyield* writeOut(sorted.map((providerId) => `${providerId}\\n`).join(\"\"));\n\t\t});\n\n\t\treturn yield* program.pipe(Effect.catch(reportFailure));\n\t}),\n);\n"],"mappings":";;;;;;AAQA,IAAA,oBAAeA,QACd,IAAI,SAAS,OAAO,SAAS,WAC7B,OAAO,GAAG,sBAAsB,CAAC,CAAC,aAAa;CAQ9C,OAAO,OAPS,OAAO,IAAI,aAAa;EACvC,OAAO;EAEP,MAAM,SAAS,CAAC,GAAG,OADM,aAAa,SACV,CAAC,CAAC,MAAM,GAAG,MAAM,EAAE,cAAc,CAAC,CAAC;EAC/D,OAAO,SAAS,OAAO,KAAK,eAAe,GAAG,WAAW,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC;CACvE,CAEoB,CAAC,CAAC,KAAK,OAAO,MAAM,aAAa,CAAC;AACvD,CAAC,CACF"}
1
+ {"version":3,"file":"providers-GEdlDJHp.mjs","names":["Runtime.handler"],"sources":["../../src/cli/cmd/handlers/models/providers.ts"],"sourcesContent":["import { ModelCatalog } 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 { synced } from \"./catalog.ts\";\n\nexport default Runtime.handler(\n\tCmd.commands.models.commands.providers,\n\tEffect.fn(\"CLI.models.providers\")(function* () {\n\t\tconst program = Effect.gen(function* () {\n\t\t\tyield* synced;\n\t\t\tconst providers = yield* ModelCatalog.providers;\n\t\t\tconst sorted = [...providers].sort((a, b) => a.localeCompare(b));\n\t\t\tyield* writeOut(sorted.map((providerId) => `${providerId}\\n`).join(\"\"));\n\t\t});\n\n\t\treturn yield* program.pipe(Effect.catch(reportFailure));\n\t}),\n);\n"],"mappings":";;;;;;AAQA,IAAA,oBAAeA,QACd,IAAI,SAAS,OAAO,SAAS,WAC7B,OAAO,GAAG,sBAAsB,CAAC,CAAC,aAAa;CAQ9C,OAAO,OAPS,OAAO,IAAI,aAAa;EACvC,OAAO;EAEP,MAAM,SAAS,CAAC,GAAG,OADM,aAAa,SACV,CAAC,CAAC,MAAM,GAAG,MAAM,EAAE,cAAc,CAAC,CAAC;EAC/D,OAAO,SAAS,OAAO,KAAK,eAAe,GAAG,WAAW,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC;CACvE,CAEoB,CAAC,CAAC,KAAK,OAAO,MAAM,aAAa,CAAC;AACvD,CAAC,CACF"}
@@ -0,0 +1,2 @@
1
+ import { n as reconnect } from "./control-CQxWGS4k.mjs";
2
+ export { reconnect as default };
@@ -1,5 +1,5 @@
1
1
  import { i as Cmd, t as handler } from "./runtime-CK2CunDw.mjs";
2
- import { f as writeOut, i as reportFailure, u as writeError } from "./error--BWou73I.mjs";
2
+ import { f as writeOut, i as reportFailure, u as writeError } from "./error-CPyvkO4x.mjs";
3
3
  import { t as home } from "./catalog-XfqtqMDz.mjs";
4
4
  import { Effect } from "effect";
5
5
  import { ModelCatalog } from "@codeworksh/harness/effect";
@@ -14,4 +14,4 @@ var refresh_default = handler(Cmd.commands.models.commands.refresh, Effect.fn("C
14
14
  //#endregion
15
15
  export { refresh_default as default };
16
16
 
17
- //# sourceMappingURL=refresh-B6iT5eWN.mjs.map
17
+ //# sourceMappingURL=refresh-93t2pSpb.mjs.map