@codeworksh/cli 0.9.0-canary.167.1.g6ddcc8db → 0.9.0-canary.168.1.ge6d0f923
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{acp-CmtcmhuX.mjs → acp-C2GCSrJd.mjs} +6 -5
- package/acp-C2GCSrJd.mjs.map +1 -0
- package/{add-Bmholf85.mjs → add-Be7-HfBj.mjs} +2 -2
- package/{add-Bmholf85.mjs.map → add-Be7-HfBj.mjs.map} +1 -1
- package/{add-Ct20ZUEC.mjs → add-D2ly9-x3.mjs} +3 -3
- package/{add-Ct20ZUEC.mjs.map → add-D2ly9-x3.mjs.map} +1 -1
- package/{catalog-BJScfJLW.mjs → catalog-Dzi9__Rq.mjs} +2 -2
- package/{catalog-BJScfJLW.mjs.map → catalog-Dzi9__Rq.mjs.map} +1 -1
- package/categories-DYD_3Pt8.mjs +19 -0
- package/categories-DYD_3Pt8.mjs.map +1 -0
- package/{check-ki1450h-.mjs → check-DzxfN43i.mjs} +2 -2
- package/{check-ki1450h-.mjs.map → check-DzxfN43i.mjs.map} +1 -1
- package/{connect-KX-A0EzQ.mjs → connect-D4w0dmRc.mjs} +5 -5
- package/{connect-KX-A0EzQ.mjs.map → connect-D4w0dmRc.mjs.map} +1 -1
- package/{control-Cotypk4e.mjs → control-CFQeKIKx.mjs} +4 -4
- package/{control-Cotypk4e.mjs.map → control-CFQeKIKx.mjs.map} +1 -1
- package/create-Bt56MHKu.mjs +35 -0
- package/create-Bt56MHKu.mjs.map +1 -0
- package/{devices-BcuQ11QF.mjs → devices-DNzXKhNy.mjs} +3 -3
- package/{devices-BcuQ11QF.mjs.map → devices-DNzXKhNy.mjs.map} +1 -1
- package/disconnect-CHEHx_ic.mjs +2 -0
- package/{disconnect-CCI1DLJ0.mjs → disconnect-CXha4LTk.mjs} +4 -4
- package/{disconnect-CCI1DLJ0.mjs.map → disconnect-CXha4LTk.mjs.map} +1 -1
- package/disconnect-Cx0sydNl.mjs +19 -0
- package/disconnect-Cx0sydNl.mjs.map +1 -0
- package/discover-wWs8qDQd.mjs +35 -0
- package/discover-wWs8qDQd.mjs.map +1 -0
- package/{discovery-D2ftXE5a.mjs → discovery-C-ploGdg.mjs} +2 -2
- package/{discovery-D2ftXE5a.mjs.map → discovery-C-ploGdg.mjs.map} +1 -1
- package/{fork-DkYRL_nQ.mjs → fork-TUz05qSe.mjs} +3 -3
- package/{fork-DkYRL_nQ.mjs.map → fork-TUz05qSe.mjs.map} +1 -1
- package/{identity-Llk4K_8w.mjs → identity-Cjr43dhQ.mjs} +2 -2
- package/{identity-Llk4K_8w.mjs.map → identity-Cjr43dhQ.mjs.map} +1 -1
- package/index.mjs +49 -39
- package/index.mjs.map +1 -1
- package/{install-hs3tvWLA.mjs → install-BtoWHZoI.mjs} +2 -2
- package/{install-hs3tvWLA.mjs.map → install-BtoWHZoI.mjs.map} +1 -1
- package/{link-BzFGtDKJ.mjs → link-Cd6T22_n.mjs} +3 -3
- package/{link-BzFGtDKJ.mjs.map → link-Cd6T22_n.mjs.map} +1 -1
- package/{list-sLzs2Y7w.mjs → list-Bn5CvS1y.mjs} +3 -3
- package/{list-sLzs2Y7w.mjs.map → list-Bn5CvS1y.mjs.map} +1 -1
- package/{list-D1c5uzCc.mjs → list-CdS1_gFF.mjs} +2 -2
- package/{list-D1c5uzCc.mjs.map → list-CdS1_gFF.mjs.map} +1 -1
- package/list-D6ABpoQC.mjs +27 -0
- package/list-D6ABpoQC.mjs.map +1 -0
- package/{list-DhL_z5v2.mjs → list-DAA92mUG.mjs} +3 -3
- package/{list-DhL_z5v2.mjs.map → list-DAA92mUG.mjs.map} +1 -1
- package/{list-Dt0_ol5P.mjs → list-MiZ6rD_w.mjs} +3 -3
- package/{list-Dt0_ol5P.mjs.map → list-MiZ6rD_w.mjs.map} +1 -1
- package/{login-BxiN8frI.mjs → login-C_tBeHg6.mjs} +3 -3
- package/{login-BxiN8frI.mjs.map → login-C_tBeHg6.mjs.map} +1 -1
- package/login-DnOTWBy8.mjs +26 -0
- package/login-DnOTWBy8.mjs.map +1 -0
- package/{login-S-2L5YYB.mjs → login-Q_ezdpon.mjs} +3 -3
- package/{login-S-2L5YYB.mjs.map → login-Q_ezdpon.mjs.map} +1 -1
- package/{logout-BeMvfZkG.mjs → logout-BjL1W-0I.mjs} +3 -3
- package/{logout-BeMvfZkG.mjs.map → logout-BjL1W-0I.mjs.map} +1 -1
- package/{logout-CKcRACIf.mjs → logout-E_dRjl1L.mjs} +3 -3
- package/{logout-CKcRACIf.mjs.map → logout-E_dRjl1L.mjs.map} +1 -1
- package/package-BsCtRg3n.mjs +6 -0
- package/package-BsCtRg3n.mjs.map +1 -0
- package/package.json +4 -4
- package/{pair-BhGzBBV8.mjs → pair-BBneOJZJ.mjs} +3 -3
- package/{pair-BhGzBBV8.mjs.map → pair-BBneOJZJ.mjs.map} +1 -1
- package/{providers-DdBYxi9t.mjs → providers-BYnMGDs7.mjs} +3 -3
- package/{providers-DdBYxi9t.mjs.map → providers-BYnMGDs7.mjs.map} +1 -1
- package/reconnect-BKpud0ma.mjs +2 -0
- package/{refresh-BgQfD2zv.mjs → refresh-CvE_f1Fa.mjs} +3 -3
- package/{refresh-BgQfD2zv.mjs.map → refresh-CvE_f1Fa.mjs.map} +1 -1
- package/{refresh-Cy6abMk_.mjs → refresh-Dy9kI2El.mjs} +3 -3
- package/{refresh-Cy6abMk_.mjs.map → refresh-Dy9kI2El.mjs.map} +1 -1
- package/{relay-BmHXs1yg.mjs → relay-CO46Wh73.mjs} +3 -3
- package/{relay-BmHXs1yg.mjs.map → relay-CO46Wh73.mjs.map} +1 -1
- package/{relink-Dxg1kstB.mjs → relink-DxftNq9n.mjs} +3 -3
- package/{relink-Dxg1kstB.mjs.map → relink-DxftNq9n.mjs.map} +1 -1
- package/{reload-CUyG343t.mjs → reload-DRp3UlHQ.mjs} +3 -3
- package/{reload-CUyG343t.mjs.map → reload-DRp3UlHQ.mjs.map} +1 -1
- package/remove-Bad0ln8h.mjs +22 -0
- package/remove-Bad0ln8h.mjs.map +1 -0
- package/{remove-BXmNNX2f.mjs → remove-C0e5sHqb.mjs} +3 -3
- package/{remove-BXmNNX2f.mjs.map → remove-C0e5sHqb.mjs.map} +1 -1
- package/{remove-CJ__oofS.mjs → remove-CdcoheOp.mjs} +2 -2
- package/{remove-CJ__oofS.mjs.map → remove-CdcoheOp.mjs.map} +1 -1
- package/{restart-CMDZZJ4N.mjs → restart-CvkGtFq2.mjs} +4 -4
- package/{restart-CMDZZJ4N.mjs.map → restart-CvkGtFq2.mjs.map} +1 -1
- package/{revoke-DigrkMoL.mjs → revoke-DoMHa1vL.mjs} +3 -3
- package/{revoke-DigrkMoL.mjs.map → revoke-DoMHa1vL.mjs.map} +1 -1
- package/{run-BN0xfxh_.mjs → run-n_t47yPB.mjs} +8 -5
- package/run-n_t47yPB.mjs.map +1 -0
- package/{runtime-Q4G4z83G.mjs → runtime-CyXV7HH_.mjs} +152 -9
- package/runtime-CyXV7HH_.mjs.map +1 -0
- package/{serve-CfjS09-r.mjs → serve-BaNbYK1f.mjs} +27 -11
- package/serve-BaNbYK1f.mjs.map +1 -0
- package/service-CA6VAOdR.mjs +1652 -0
- package/service-CA6VAOdR.mjs.map +1 -0
- package/{service-B0O4PjbL.mjs → service-YVNwFMNf.mjs} +2 -2
- package/{service-B0O4PjbL.mjs.map → service-YVNwFMNf.mjs.map} +1 -1
- package/shared-CA47qIai.mjs +212 -0
- package/shared-CA47qIai.mjs.map +1 -0
- package/{shared-C2sMimyK.mjs → shared-CDJQxUb9.mjs} +4 -4
- package/{shared-C2sMimyK.mjs.map → shared-CDJQxUb9.mjs.map} +1 -1
- package/{shared-C4j4rGe4.mjs → shared-D_MVXtOf.mjs} +3 -3
- package/{shared-C4j4rGe4.mjs.map → shared-D_MVXtOf.mjs.map} +1 -1
- package/{start-DbCTFswo.mjs → start-D3lqmljh.mjs} +4 -4
- package/{start-DbCTFswo.mjs.map → start-D3lqmljh.mjs.map} +1 -1
- package/{status-CR_E6RiI.mjs → status-BoTZqXwd.mjs} +3 -3
- package/{status-CR_E6RiI.mjs.map → status-BoTZqXwd.mjs.map} +1 -1
- package/{status-Dcbdl6Sv.mjs → status-P0hOBrM6.mjs} +4 -4
- package/{status-Dcbdl6Sv.mjs.map → status-P0hOBrM6.mjs.map} +1 -1
- package/status-tYcs05sk.mjs +23 -0
- package/status-tYcs05sk.mjs.map +1 -0
- package/{stop-ML5Yeo_s.mjs → stop-BuDB-rqB.mjs} +4 -4
- package/{stop-ML5Yeo_s.mjs.map → stop-BuDB-rqB.mjs.map} +1 -1
- package/{update-BK_LdUUv.mjs → update-mWc5cR7q.mjs} +2 -2
- package/{update-BK_LdUUv.mjs.map → update-mWc5cR7q.mjs.map} +1 -1
- package/acp-CmtcmhuX.mjs.map +0 -1
- package/disconnect-DKi3PmC2.mjs +0 -2
- package/package-D_TWKUKk.mjs +0 -6
- package/package-D_TWKUKk.mjs.map +0 -1
- package/reconnect-DgUK2fwU.mjs +0 -2
- package/run-BN0xfxh_.mjs.map +0 -1
- package/runtime-Q4G4z83G.mjs.map +0 -1
- package/serve-CfjS09-r.mjs.map +0 -1
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { a as reportFailure, m as writeOut } from "./error-BsI8iNna.mjs";
|
|
2
|
+
import { i as Cmd, t as handler } from "./runtime-CyXV7HH_.mjs";
|
|
3
|
+
import { i as withConnectApi, r as printJson } from "./shared-CA47qIai.mjs";
|
|
4
|
+
import { Effect } from "effect";
|
|
5
|
+
//#region src/cli/cmd/handlers/connect/remove.ts
|
|
6
|
+
var remove_default = handler(Cmd.commands.connect.commands.remove, Effect.fn("CLI.connect.remove")(function* ({ ref, server, json }) {
|
|
7
|
+
return yield* withConnectApi(server, (api) => Effect.gen(function* () {
|
|
8
|
+
const removed = yield* api.remove(ref);
|
|
9
|
+
if (json) {
|
|
10
|
+
yield* printJson({
|
|
11
|
+
ref,
|
|
12
|
+
removed
|
|
13
|
+
});
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
yield* writeOut(removed ? `Removed ${ref}\n` : `Connection "${ref}" not found\n`);
|
|
17
|
+
})).pipe(Effect.catch(reportFailure));
|
|
18
|
+
}));
|
|
19
|
+
//#endregion
|
|
20
|
+
export { remove_default as default };
|
|
21
|
+
|
|
22
|
+
//# sourceMappingURL=remove-Bad0ln8h.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remove-Bad0ln8h.mjs","names":["Runtime.handler"],"sources":["../../src/cli/cmd/handlers/connect/remove.ts"],"sourcesContent":["import { Effect } from \"effect\";\nimport * as Runtime from \"../../../../framework/runtime.ts\";\nimport { reportFailure } from \"../../../error.ts\";\nimport { writeOut } from \"../../../output.ts\";\nimport { Cmd } from \"../../cmd.ts\";\nimport { printJson, withConnectApi } from \"./shared.ts\";\n\nexport default Runtime.handler(\n\tCmd.commands.connect.commands.remove,\n\tEffect.fn(\"CLI.connect.remove\")(function* ({ ref, server, json }) {\n\t\tconst program = withConnectApi(server, (api) =>\n\t\t\tEffect.gen(function* () {\n\t\t\t\tconst removed = yield* api.remove(ref);\n\t\t\t\tif (json) {\n\t\t\t\t\tyield* printJson({ ref, removed });\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tyield* writeOut(removed ? `Removed ${ref}\\n` : `Connection \"${ref}\" not found\\n`);\n\t\t\t}),\n\t\t);\n\t\treturn yield* program.pipe(Effect.catch(reportFailure));\n\t}),\n);\n"],"mappings":";;;;;AAOA,IAAA,iBAAeA,QACd,IAAI,SAAS,QAAQ,SAAS,QAC9B,OAAO,GAAG,oBAAoB,CAAC,CAAC,WAAW,EAAE,KAAK,QAAQ,QAAQ;CAWjE,OAAO,OAVS,eAAe,SAAS,QACvC,OAAO,IAAI,aAAa;EACvB,MAAM,UAAU,OAAO,IAAI,OAAO,GAAG;EACrC,IAAI,MAAM;GACT,OAAO,UAAU;IAAE;IAAK;GAAQ,CAAC;GACjC;EACD;EACA,OAAO,SAAS,UAAU,WAAW,IAAI,MAAM,eAAe,IAAI,cAAc;CACjF,CAAC,CAEkB,CAAC,CAAC,KAAK,OAAO,MAAM,aAAa,CAAC;AACvD,CAAC,CACF"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { a as reportFailure, m as writeOut, t as InvalidInputError } from "./error-BsI8iNna.mjs";
|
|
2
|
-
import { i as Cmd, t as handler } from "./runtime-
|
|
2
|
+
import { i as Cmd, t as handler } from "./runtime-CyXV7HH_.mjs";
|
|
3
3
|
import { r as write, t as locked } from "./jsonc-BtRExpz3.mjs";
|
|
4
|
-
import { a as readServers, n as configured } from "./shared-
|
|
4
|
+
import { a as readServers, n as configured } from "./shared-D_MVXtOf.mjs";
|
|
5
5
|
import { Effect, FileSystem } from "effect";
|
|
6
6
|
//#region src/cli/cmd/handlers/mcp/remove.ts
|
|
7
7
|
var remove_default = handler(Cmd.commands.mcp.commands.remove, Effect.fn("CLI.mcp.remove")(function* ({ name, local }) {
|
|
@@ -23,4 +23,4 @@ var remove_default = handler(Cmd.commands.mcp.commands.remove, Effect.fn("CLI.mc
|
|
|
23
23
|
//#endregion
|
|
24
24
|
export { remove_default as default };
|
|
25
25
|
|
|
26
|
-
//# sourceMappingURL=remove-
|
|
26
|
+
//# sourceMappingURL=remove-C0e5sHqb.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remove-
|
|
1
|
+
{"version":3,"file":"remove-C0e5sHqb.mjs","names":["Runtime.handler","Jsonc.locked","Jsonc.write"],"sources":["../../src/cli/cmd/handlers/mcp/remove.ts"],"sourcesContent":["import { Effect, FileSystem } from \"effect\";\nimport * as Runtime from \"../../../../framework/runtime.ts\";\nimport { InvalidInputError, reportFailure } from \"../../../error.ts\";\nimport * as Jsonc from \"../../../jsonc.ts\";\nimport { writeOut } from \"../../../output.ts\";\nimport { Cmd } from \"../../cmd.ts\";\nimport { configured, readServers } from \"./shared.ts\";\n\nexport default Runtime.handler(\n\tCmd.commands.mcp.commands.remove,\n\tEffect.fn(\"CLI.mcp.remove\")(function* ({ name, local }) {\n\t\tconst program = Effect.gen(function* () {\n\t\t\tconst { user, project, servers } = yield* configured();\n\t\t\tconst path = local ? project : user;\n\t\t\tconst level = local ? \"project\" : \"user\";\n\t\t\tconst fs = yield* FileSystem.FileSystem;\n\t\t\t// No file, nothing to remove: locking it would make its directory, and a `.codework/` here.\n\t\t\tconst removed =\n\t\t\t\t(yield* fs.exists(path)) &&\n\t\t\t\t(yield* Jsonc.locked(\n\t\t\t\t\tpath,\n\t\t\t\t\tEffect.gen(function* () {\n\t\t\t\t\t\tconst { source, servers } = yield* readServers(path);\n\t\t\t\t\t\tif (servers[name] === undefined) return false;\n\t\t\t\t\t\tyield* Jsonc.write(path, source, [\"mcpServers\", name], undefined);\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}),\n\t\t\t\t));\n\t\t\tif (removed) return yield* writeOut(`Removed ${level} MCP server \"${name}\" from ${path}.\\n`);\n\t\t\tconst other = servers.find((server) => server.name === name && server.file !== path);\n\t\t\tconst hint =\n\t\t\t\tother === undefined\n\t\t\t\t\t? \"\"\n\t\t\t\t\t: ` It is defined in ${other.file}; ${other.file === project ? \"use --local\" : \"omit --local\"}.`;\n\t\t\treturn yield* new InvalidInputError({\n\t\t\t\tmessage: `no ${level} MCP server named \"${name}\" in ${path}.${hint}`,\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,MAAM,SAAS;CA4BvD,OAAO,OA3BS,OAAO,IAAI,aAAa;EACvC,MAAM,EAAE,MAAM,SAAS,YAAY,OAAO,WAAW;EACrD,MAAM,OAAO,QAAQ,UAAU;EAC/B,MAAM,QAAQ,QAAQ,YAAY;EAclC,KAVE,QAAO,OAHS,WAAW,WAAA,CAGjB,OAAO,IAAI,OACrB,OAAOC,OACP,MACA,OAAO,IAAI,aAAa;GACvB,MAAM,EAAE,QAAQ,YAAY,OAAO,YAAY,IAAI;GACnD,IAAI,QAAQ,UAAU,KAAA,GAAW,OAAO;GACxC,OAAOC,MAAY,MAAM,QAAQ,CAAC,cAAc,IAAI,GAAG,KAAA,CAAS;GAChE,OAAO;EACR,CAAC,CACF,IACY,OAAO,OAAO,SAAS,WAAW,MAAM,eAAe,KAAK,SAAS,KAAK,IAAI;EAC3F,MAAM,QAAQ,QAAQ,MAAM,WAAW,OAAO,SAAS,QAAQ,OAAO,SAAS,IAAI;EACnF,MAAM,OACL,UAAU,KAAA,IACP,KACA,qBAAqB,MAAM,KAAK,IAAI,MAAM,SAAS,UAAU,gBAAgB,eAAe;EAChG,OAAO,OAAO,IAAI,kBAAkB,EACnC,SAAS,MAAM,MAAM,qBAAqB,KAAK,OAAO,KAAK,GAAG,OAC/D,CAAC;CACF,CACoB,CAAC,CAAC,KAAK,OAAO,MAAM,aAAa,CAAC;AACvD,CAAC,CACF"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as reportFailure, m as writeOut } from "./error-BsI8iNna.mjs";
|
|
2
|
-
import { i as Cmd, t as handler } from "./runtime-
|
|
2
|
+
import { i as Cmd, t as handler } from "./runtime-CyXV7HH_.mjs";
|
|
3
3
|
import { a as resolveTarget, c as withPluginsLock, i as readPlugins, l as writePlugins, o as spellings, r as matching, t as identify } from "./settings-C-NXp4yB.mjs";
|
|
4
4
|
import { Effect, FileSystem, Option, Path } from "effect";
|
|
5
5
|
import { Global } from "@codeworksh/harness/effect";
|
|
@@ -34,4 +34,4 @@ var remove_default = handler(Cmd.commands.plugin.commands.remove, Effect.fn("CLI
|
|
|
34
34
|
//#endregion
|
|
35
35
|
export { remove_default as default };
|
|
36
36
|
|
|
37
|
-
//# sourceMappingURL=remove-
|
|
37
|
+
//# sourceMappingURL=remove-CdcoheOp.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remove-
|
|
1
|
+
{"version":3,"file":"remove-CdcoheOp.mjs","names":["Runtime.handler"],"sources":["../../src/cli/cmd/handlers/plugin/remove.ts"],"sourcesContent":["import { Global } from \"@codeworksh/harness/effect\";\nimport { Effect, FileSystem, Option, Path } from \"effect\";\nimport * as Runtime from \"../../../../framework/runtime.ts\";\nimport { reportFailure } from \"../../../error.ts\";\nimport { writeOut } from \"../../../output.ts\";\nimport { Cmd } from \"../../cmd.ts\";\nimport {\n\tidentify,\n\tmatching,\n\treadPlugins,\n\tresolveTarget,\n\tspellings,\n\twithPluginsLock,\n\twritePlugins,\n} from \"./settings.ts\";\n\nexport default Runtime.handler(\n\tCmd.commands.plugin.commands.remove,\n\tEffect.fn(\"CLI.plugin.remove\")(function* ({ package: reference, global: userWide }) {\n\t\tconst program = Effect.gen(function* () {\n\t\t\tconst shared = yield* Cmd.spec;\n\t\t\tconst path = yield* Path.Path;\n\t\t\tconst fs = yield* FileSystem.FileSystem;\n\t\t\tconst paths = yield* Global.resolve(Option.isNone(shared.home) ? {} : { home: shared.home.value });\n\t\t\tconst target = yield* resolveTarget(shared, userWide, undefined, false);\n\t\t\t// Removing from a directory that is not a project is a read-only no-op. In particular, it\n\t\t\t// must not create the marker that would make this directory shadow a real project later.\n\t\t\tif (!(yield* fs.exists(path.dirname(target.path)))) {\n\t\t\t\tyield* writeOut(`Plugin \"${reference}\" is not configured in ${target.path}\\n`);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst spelled = yield* spellings(reference, path.resolve(\".\"));\n\t\t\tyield* withPluginsLock(\n\t\t\t\ttarget.path,\n\t\t\t\tEffect.gen(function* () {\n\t\t\t\t\tconst { source, plugins } = yield* readPlugins(target.path);\n\t\t\t\t\t// Both the module entry and any configuration written against it: the package it was\n\t\t\t\t\t// added as, the path or version it was written with, and the ID it declares all name\n\t\t\t\t\t// the one plugin being removed.\n\t\t\t\t\tconst entries = yield* identify(plugins, target.path, paths.cache);\n\t\t\t\t\tconst selected = matching(entries, spelled);\n\t\t\t\t\tconst kept = entries.filter((entry) => !selected.has(entry)).map((entry) => entry.value);\n\t\t\t\t\tif (kept.length === plugins.length) {\n\t\t\t\t\t\tyield* writeOut(`Plugin \"${reference}\" is not configured in ${target.path}\\n`);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tyield* writePlugins(target.path, source, kept);\n\t\t\t\t\tconst dropped = plugins.length - kept.length;\n\t\t\t\t\tyield* writeOut(\n\t\t\t\t\t\t`Removed ${dropped} ${dropped === 1 ? \"entry\" : \"entries\"} for \"${reference}\" from ${target.path}\\n`,\n\t\t\t\t\t);\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":";;;;;;AAgBA,IAAA,iBAAeA,QACd,IAAI,SAAS,OAAO,SAAS,QAC7B,OAAO,GAAG,mBAAmB,CAAC,CAAC,WAAW,EAAE,SAAS,WAAW,QAAQ,YAAY;CAqCnF,OAAO,OApCS,OAAO,IAAI,aAAa;EACvC,MAAM,SAAS,OAAO,IAAI;EAC1B,MAAM,OAAO,OAAO,KAAK;EACzB,MAAM,KAAK,OAAO,WAAW;EAC7B,MAAM,QAAQ,OAAO,OAAO,QAAQ,OAAO,OAAO,OAAO,IAAI,IAAI,CAAC,IAAI,EAAE,MAAM,OAAO,KAAK,MAAM,CAAC;EACjG,MAAM,SAAS,OAAO,cAAc,QAAQ,UAAU,KAAA,GAAW,KAAK;EAGtE,IAAI,EAAE,OAAO,GAAG,OAAO,KAAK,QAAQ,OAAO,IAAI,CAAC,IAAI;GACnD,OAAO,SAAS,WAAW,UAAU,yBAAyB,OAAO,KAAK,GAAG;GAC7E;EACD;EACA,MAAM,UAAU,OAAO,UAAU,WAAW,KAAK,QAAQ,GAAG,CAAC;EAC7D,OAAO,gBACN,OAAO,MACP,OAAO,IAAI,aAAa;GACvB,MAAM,EAAE,QAAQ,YAAY,OAAO,YAAY,OAAO,IAAI;GAI1D,MAAM,UAAU,OAAO,SAAS,SAAS,OAAO,MAAM,MAAM,KAAK;GACjE,MAAM,WAAW,SAAS,SAAS,OAAO;GAC1C,MAAM,OAAO,QAAQ,QAAQ,UAAU,CAAC,SAAS,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,UAAU,MAAM,KAAK;GACvF,IAAI,KAAK,WAAW,QAAQ,QAAQ;IACnC,OAAO,SAAS,WAAW,UAAU,yBAAyB,OAAO,KAAK,GAAG;IAC7E;GACD;GACA,OAAO,aAAa,OAAO,MAAM,QAAQ,IAAI;GAC7C,MAAM,UAAU,QAAQ,SAAS,KAAK;GACtC,OAAO,SACN,WAAW,QAAQ,GAAG,YAAY,IAAI,UAAU,UAAU,QAAQ,UAAU,SAAS,OAAO,KAAK,GAClG;EACD,CAAC,CACF;CACD,CAEoB,CAAC,CAAC,KAAK,OAAO,MAAM,aAAa,CAAC;AACvD,CAAC,CACF"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { a as reportFailure, m as writeOut } from "./error-BsI8iNna.mjs";
|
|
2
|
-
import { i as Cmd, t as handler } from "./runtime-
|
|
3
|
-
import { r as options } from "./service-
|
|
4
|
-
import { n as ensure, r as stop } from "./discovery-
|
|
2
|
+
import { i as Cmd, t as handler } from "./runtime-CyXV7HH_.mjs";
|
|
3
|
+
import { r as options } from "./service-YVNwFMNf.mjs";
|
|
4
|
+
import { n as ensure, r as stop } from "./discovery-C-ploGdg.mjs";
|
|
5
5
|
import { Effect } from "effect";
|
|
6
6
|
//#region src/cli/cmd/handlers/service/restart.ts
|
|
7
7
|
var restart_default = handler(Cmd.commands.service.commands.restart, Effect.fn("CLI.service.restart")(function* ({ host, port }) {
|
|
@@ -19,4 +19,4 @@ var restart_default = handler(Cmd.commands.service.commands.restart, Effect.fn("
|
|
|
19
19
|
//#endregion
|
|
20
20
|
export { restart_default as default };
|
|
21
21
|
|
|
22
|
-
//# sourceMappingURL=restart-
|
|
22
|
+
//# sourceMappingURL=restart-CvkGtFq2.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"restart-
|
|
1
|
+
{"version":3,"file":"restart-CvkGtFq2.mjs","names":["Runtime.handler","options","Service.options","Discovery.stop","Discovery.ensure"],"sources":["../../src/cli/cmd/handlers/service/restart.ts"],"sourcesContent":["import { Effect } from \"effect\";\nimport * as Runtime from \"../../../../framework/runtime.ts\";\nimport * as Discovery from \"../../../../server/discovery.ts\";\nimport { reportFailure } from \"../../../error.ts\";\nimport { writeOut } from \"../../../output.ts\";\nimport * as Service from \"../../../service.ts\";\nimport { Cmd } from \"../../cmd.ts\";\n\nexport default Runtime.handler(\n\tCmd.commands.service.commands.restart,\n\tEffect.fn(\"CLI.service.restart\")(function* ({ host, port }) {\n\t\tconst options = yield* Service.options(yield* Cmd.spec, { host, port });\n\t\tyield* Discovery.stop(options.home);\n\t\tconst server = yield* Discovery.ensure({ ...options, replace: true });\n\t\tyield* writeOut(`${server.url}\\n`);\n\t}, Effect.catch(reportFailure)),\n);\n"],"mappings":";;;;;;AAQA,IAAA,kBAAeA,QACd,IAAI,SAAS,QAAQ,SAAS,SAC9B,OAAO,GAAG,qBAAqB,CAAC,CAAC,WAAW,EAAE,MAAM,QAAQ;CAC3D,MAAMC,YAAU,OAAOC,QAAgB,OAAO,IAAI,MAAM;EAAE;EAAM;CAAK,CAAC;CACtE,OAAOC,KAAeF,UAAQ,IAAI;CAClC,MAAM,SAAS,OAAOG,OAAiB;EAAE,GAAGH;EAAS,SAAS;CAAK,CAAC;CACpE,OAAO,SAAS,GAAG,OAAO,IAAI,GAAG;AAClC,GAAG,OAAO,MAAM,aAAa,CAAC,CAC/B"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as reportFailure, g as make, t as InvalidInputError } from "./error-BsI8iNna.mjs";
|
|
2
|
-
import { i as Cmd, t as handler } from "./runtime-
|
|
3
|
-
import { t as connect } from "./service-
|
|
2
|
+
import { i as Cmd, t as handler } from "./runtime-CyXV7HH_.mjs";
|
|
3
|
+
import { t as connect } from "./service-YVNwFMNf.mjs";
|
|
4
4
|
import { Effect } from "effect";
|
|
5
5
|
//#region src/cli/cmd/handlers/service/revoke.ts
|
|
6
6
|
var revoke_default = handler(Cmd.commands.service.commands.revoke, Effect.fn("CLI.service.revoke")(function* ({ id }) {
|
|
@@ -10,4 +10,4 @@ var revoke_default = handler(Cmd.commands.service.commands.revoke, Effect.fn("CL
|
|
|
10
10
|
//#endregion
|
|
11
11
|
export { revoke_default as default };
|
|
12
12
|
|
|
13
|
-
//# sourceMappingURL=revoke-
|
|
13
|
+
//# sourceMappingURL=revoke-DoMHa1vL.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"revoke-
|
|
1
|
+
{"version":3,"file":"revoke-DoMHa1vL.mjs","names":["Runtime.handler","Client.make","Service.connect"],"sources":["../../src/cli/cmd/handlers/service/revoke.ts"],"sourcesContent":["import { Effect } from \"effect\";\nimport * as Runtime from \"../../../../framework/runtime.ts\";\nimport * as Client from \"../../../../server/client.ts\";\nimport { InvalidInputError, reportFailure } from \"../../../error.ts\";\nimport * as Service from \"../../../service.ts\";\nimport { Cmd } from \"../../cmd.ts\";\n\nexport default Runtime.handler(\n\tCmd.commands.service.commands.revoke,\n\tEffect.fn(\"CLI.service.revoke\")(function* ({ id }) {\n\t\tconst { applied } = yield* Effect.flatMap(Client.make, (rpc) => rpc[\"device.revoke\"]({ id })).pipe(\n\t\t\tService.connect(),\n\t\t);\n\t\tif (!applied) return yield* new InvalidInputError({ message: `no paired device ${id}` });\n\t}, Effect.catch(reportFailure)),\n);\n"],"mappings":";;;;;AAOA,IAAA,iBAAeA,QACd,IAAI,SAAS,QAAQ,SAAS,QAC9B,OAAO,GAAG,oBAAoB,CAAC,CAAC,WAAW,EAAE,MAAM;CAClD,MAAM,EAAE,YAAY,OAAO,OAAO,QAAQC,OAAc,QAAQ,IAAI,gBAAgB,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,KAC7FC,QAAgB,CACjB;CACA,IAAI,CAAC,SAAS,OAAO,OAAO,IAAI,kBAAkB,EAAE,SAAS,oBAAoB,KAAK,CAAC;AACxF,GAAG,OAAO,MAAM,aAAa,CAAC,CAC/B"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { _ as run, c as header, d as usage, f as writeError, g as make, i as renderError, m as writeOut, o as addUsage, s as emptyUsage, t as InvalidInputError, u as terminalColumns } from "./error-BsI8iNna.mjs";
|
|
2
|
-
import { i as Cmd, t as handler } from "./runtime-
|
|
2
|
+
import { i as Cmd, t as handler } from "./runtime-CyXV7HH_.mjs";
|
|
3
|
+
import { n as layer } from "./service-CA6VAOdR.mjs";
|
|
3
4
|
import { t as harnessOptions } from "./harness-6d8TlAVk.mjs";
|
|
4
|
-
import { t as connect } from "./service-
|
|
5
|
+
import { t as connect } from "./service-YVNwFMNf.mjs";
|
|
5
6
|
import { n as threadFlag, t as sessionId } from "./ids-BW5msGUm.mjs";
|
|
6
|
-
import { Effect, Exit, Fiber, Logger, Option, Queue, Ref, Schema, Stream } from "effect";
|
|
7
|
+
import { Effect, Exit, Fiber, Layer, Logger, Option, Queue, Ref, Schema, Stream } from "effect";
|
|
7
8
|
import { EventList, Harness, Sandbox, Session } from "@codeworksh/harness/effect";
|
|
8
9
|
//#region src/cli/cmd/handlers/run.ts
|
|
9
10
|
const initialRenderState = {
|
|
@@ -149,7 +150,9 @@ var run_default = handler(Cmd.commands.run, Effect.fn("CLI.run", { level: "Info"
|
|
|
149
150
|
});
|
|
150
151
|
return yield* Effect.gen(function* () {
|
|
151
152
|
if (Option.isSome(server)) return yield* remote.pipe(connect(server.value));
|
|
152
|
-
|
|
153
|
+
const opts = harnessOptions(shared);
|
|
154
|
+
const connectorLayer = layer(opts.home === void 0 ? {} : { home: opts.home });
|
|
155
|
+
return yield* program.pipe(Effect.scoped, Effect.provide(Harness.layer(opts).pipe(Layer.provide(connectorLayer))), Effect.provideService(Logger.LogToStderr, true));
|
|
153
156
|
}).pipe(Effect.catch((error) => writeError(renderError(error)).pipe(Effect.andThen(Effect.sync(() => {
|
|
154
157
|
process.exitCode = 1;
|
|
155
158
|
})))));
|
|
@@ -157,4 +160,4 @@ var run_default = handler(Cmd.commands.run, Effect.fn("CLI.run", { level: "Info"
|
|
|
157
160
|
//#endregion
|
|
158
161
|
export { run_default as default };
|
|
159
162
|
|
|
160
|
-
//# sourceMappingURL=run-
|
|
163
|
+
//# sourceMappingURL=run-n_t47yPB.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-n_t47yPB.mjs","names":["Runtime.handler","Client.make","Client.run","Service.connect","ConnectorService.layer"],"sources":["../../src/cli/cmd/handlers/run.ts"],"sourcesContent":["import { EventList, type EventSchema, Harness, Sandbox, Session } from \"@codeworksh/harness/effect\";\nimport { Effect, Exit, Fiber, Layer, Logger, Option, Queue, Ref, Schema, Stream } from \"effect\";\nimport * as ConnectorService from \"../../../connector/service.ts\";\nimport * as Runtime from \"../../../framework/runtime.ts\";\nimport * as Client from \"../../../server/client.ts\";\nimport * as Service from \"../../service.ts\";\nimport { InvalidInputError, renderError } from \"../../error.ts\";\nimport { harnessOptions } from \"../../harness.ts\";\nimport {\n\taddUsage,\n\temptyUsage,\n\theader,\n\tterminalColumns,\n\tusage,\n\ttype UsageSummary,\n\twriteError,\n\twriteOut,\n} from \"../../output.ts\";\nimport { sessionId, threadFlag } from \"../../ids.ts\";\nimport { Cmd } from \"../cmd.ts\";\n\ninterface RenderState {\n\treadonly usage: UsageSummary;\n\treadonly textSeen: boolean;\n\treadonly textEndsWithNewline: boolean;\n\treadonly reason?: EventList.LLMEnded[\"data\"][\"reason\"];\n}\n\nconst initialRenderState: RenderState = {\n\tusage: emptyUsage,\n\ttextSeen: false,\n\ttextEndsWithNewline: false,\n};\n\nconst isTextDelta = Schema.is(EventList.LLMTextDelta);\nconst isLLMEnded = Schema.is(EventList.LLMEnded);\nconst isTurnEnded = Schema.is(EventList.TurnEnded);\n\nconst render = (state: Ref.Ref<RenderState>, ended?: Queue.Queue<string>) =>\n\tEffect.fn(\"CLI.render\")(function* (event: EventSchema.Payload) {\n\t\tif (isTextDelta(event)) {\n\t\t\tyield* writeOut(event.data.delta);\n\t\t\tif (event.data.delta.length > 0) {\n\t\t\t\tyield* Ref.update(state, (current) => ({\n\t\t\t\t\t...current,\n\t\t\t\t\ttextSeen: true,\n\t\t\t\t\ttextEndsWithNewline: event.data.delta.endsWith(\"\\n\"),\n\t\t\t\t}));\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tif (isLLMEnded(event)) {\n\t\t\tyield* Ref.update(state, (current) => ({\n\t\t\t\t...current,\n\t\t\t\tusage: addUsage(current.usage, event.data.message),\n\t\t\t\treason: event.data.reason,\n\t\t\t}));\n\t\t\treturn;\n\t\t}\n\t\tif (ended !== undefined && isTurnEnded(event)) {\n\t\t\tyield* Queue.offer(ended, event.data.messageId);\n\t\t}\n\t});\n\nconst finish = Effect.fn(\"CLI.finish\")(function* (state: Ref.Ref<RenderState>, columns: number) {\n\tconst rendered = yield* Ref.get(state);\n\tif (rendered.textSeen && !rendered.textEndsWithNewline) yield* writeOut(\"\\n\");\n\tyield* writeError(usage(rendered.usage, columns));\n\tif (rendered.reason === \"length\") {\n\t\tyield* writeError(\"Response was truncated: the model reached its output token limit.\\n\");\n\t\tyield* Effect.sync(() => {\n\t\t\tprocess.exitCode = 1;\n\t\t});\n\t}\n});\n\nconst awaitMessage = Effect.fn(\"CLI.awaitMessage\")(function* (ended: Queue.Queue<string>, messageId: string) {\n\twhile ((yield* Queue.take(ended)) !== messageId) {\n\t\t// Earlier turns in the same drain are expected when a tool call continues.\n\t}\n});\n\nconst selectSandbox = Effect.fn(\"CLI.selectSandbox\", { level: \"Info\" })(function* (input: Sandbox.Selection) {\n\tconst selection = yield* Sandbox.resolve(input);\n\tif (selection.created && selection.info !== undefined) {\n\t\tconst id = selection.info.id;\n\t\tyield* Effect.addFinalizer(() => Effect.ignore(Sandbox.stop(id)));\n\t}\n\treturn selection.info;\n});\n\nexport default Runtime.handler(\n\tCmd.commands.run,\n\tEffect.fn(\"CLI.run\", { level: \"Info\" })(function* ({\n\t\tprompt,\n\t\tsession,\n\t\tthread,\n\t\tcwd,\n\t\tsandboxDriver,\n\t\tsandboxProviderId,\n\t\tsandboxId,\n\t\tprovider,\n\t\tmodel,\n\t\tthinking,\n\t\tserver,\n\t}) {\n\t\tconst shared = yield* Cmd.spec;\n\t\tif (\n\t\t\tOption.isSome(session) &&\n\t\t\t(Option.isSome(cwd) ||\n\t\t\t\tOption.isSome(sandboxDriver) ||\n\t\t\t\tOption.isSome(sandboxProviderId) ||\n\t\t\t\tOption.isSome(sandboxId))\n\t\t) {\n\t\t\treturn yield* new InvalidInputError({\n\t\t\t\tmessage:\n\t\t\t\t\t\"--cwd, --sandbox-driver, --sandbox-id, and --sandbox-provider-id can only be used when creating a new session\",\n\t\t\t});\n\t\t}\n\t\tif (Option.isSome(thread) && Option.isNone(session)) {\n\t\t\treturn yield* new InvalidInputError({ message: \"--thread continues a thread of --session\" });\n\t\t}\n\t\tconst threadId = yield* threadFlag(thread);\n\t\tconst id = Option.isSome(session) ? yield* sessionId(session.value) : undefined;\n\t\tif (Option.isSome(provider) !== Option.isSome(model)) {\n\t\t\treturn yield* new InvalidInputError({ message: \"--provider and --model must be provided together\" });\n\t\t}\n\t\tif (Option.isSome(sandboxProviderId) && Option.isNone(sandboxDriver)) {\n\t\t\treturn yield* new InvalidInputError({\n\t\t\t\tmessage: \"--sandbox-provider-id requires a remote --sandbox-driver\",\n\t\t\t});\n\t\t}\n\t\t// --home stays: it names the home whose token reaches the server.\n\t\tif (Option.isSome(server) && [shared.database, shared.userConfigDir].some(Option.isSome)) {\n\t\t\treturn yield* new InvalidInputError({\n\t\t\t\tmessage: \"--database and --user-config-dir belong on codework serve when using --server\",\n\t\t\t});\n\t\t}\n\n\t\tif (Option.isSome(sandboxId) && (Option.isSome(sandboxDriver) || Option.isSome(sandboxProviderId))) {\n\t\t\treturn yield* new InvalidInputError({\n\t\t\t\tmessage: \"--sandbox-id cannot be combined with --sandbox-driver or --sandbox-provider-id\",\n\t\t\t});\n\t\t}\n\t\tconst selection: Sandbox.Selection = Option.isSome(sandboxId)\n\t\t\t? { id: Sandbox.SandboxInstance.ID.make(sandboxId.value) }\n\t\t\t: {\n\t\t\t\t\tdriver: Option.getOrElse(sandboxDriver, () => \"local\"),\n\t\t\t\t\t...(Option.isNone(sandboxProviderId) ? {} : { providerResourceId: sandboxProviderId.value }),\n\t\t\t\t};\n\n\t\t// The session's host directory, with no flag to set it: a person running a command is always\n\t\t// somewhere, and that somewhere is what they mean by \"this project\". `--cwd` is a different\n\t\t// thing entirely -- where the work runs inside the session's space, which may be a sandbox\n\t\t// on another machine.\n\t\tconst hostDir = Session.AbsolutePath.make(process.cwd());\n\n\t\tconst runtime = {\n\t\t\t...(Option.isNone(provider) || Option.isNone(model)\n\t\t\t\t? {}\n\t\t\t\t: { model: { provider: provider.value, id: model.value } }),\n\t\t\t...(Option.isNone(thinking) ? {} : { thinkingLevel: thinking.value }),\n\t\t};\n\t\tconst remote = Effect.gen(function* () {\n\t\t\tconst rpc = yield* Client.make;\n\t\t\tconst info =\n\t\t\t\tid !== undefined\n\t\t\t\t\t? yield* rpc[\"thread.configure\"]({\n\t\t\t\t\t\t\tsessionId: id,\n\t\t\t\t\t\t\t...(threadId === undefined ? {} : { threadId }),\n\t\t\t\t\t\t\truntime,\n\t\t\t\t\t\t})\n\t\t\t\t\t: yield* rpc[\"session.create\"]({\n\t\t\t\t\t\t\truntime,\n\t\t\t\t\t\t\t...(Option.isNone(cwd) ? {} : { directory: cwd.value }),\n\t\t\t\t\t\t\thostDir,\n\t\t\t\t\t\t\tsandbox: selection,\n\t\t\t\t\t\t});\n\t\t\tconst state = yield* Ref.make(initialRenderState);\n\t\t\tconst columns = terminalColumns();\n\t\t\tyield* writeError(\n\t\t\t\theader({\n\t\t\t\t\tsessionId: info.session.id,\n\t\t\t\t\tsandbox: info.session.sandbox?.driver ?? \"local\",\n\t\t\t\t\tdirectory: info.placement?.directory ?? info.session.directory,\n\t\t\t\t\tcolumns,\n\t\t\t\t}),\n\t\t\t);\n\t\t\tif (info.session.sandbox !== undefined) yield* writeError(`sandbox-id: ${info.session.sandbox.id}\\n`);\n\t\t\tyield* Client.run(rpc, { sessionId: info.session.id, threadId: info.id, text: prompt }, render(state)).pipe(\n\t\t\t\tEffect.onInterrupt(() =>\n\t\t\t\t\trpc[\"thread.interrupt\"]({ sessionId: info.session.id, threadId: info.id }).pipe(\n\t\t\t\t\t\tEffect.timeout(\"5 seconds\"),\n\t\t\t\t\t\tEffect.ignore,\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t);\n\t\t\tyield* finish(state, columns);\n\t\t});\n\t\tconst program = Effect.gen(function* () {\n\t\t\tlet handle: Session.ThreadHandle;\n\t\t\tif (id !== undefined) {\n\t\t\t\thandle = yield* Session.attach({\n\t\t\t\t\tsessionId: id,\n\t\t\t\t\t...(threadId === undefined ? {} : { threadId }),\n\t\t\t\t\t...runtime,\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tconst selected = yield* selectSandbox(selection);\n\t\t\t\tconst created = yield* Session.create({\n\t\t\t\t\t...runtime,\n\t\t\t\t\t...(selected === undefined ? {} : { sandbox: selected }),\n\t\t\t\t\t...(Option.isNone(cwd) ? {} : { directory: cwd.value }),\n\t\t\t\t\thostDir,\n\t\t\t\t});\n\t\t\t\thandle = created.main;\n\t\t\t}\n\t\t\tconst ended = yield* Queue.unbounded<string>();\n\t\t\tconst renderState = yield* Ref.make(initialRenderState);\n\t\t\tconst printer = yield* handle\n\t\t\t\t.events()\n\t\t\t\t.pipe(Stream.runForEach(render(renderState, ended)), Effect.forkScoped({ startImmediately: true }));\n\n\t\t\tconst info = yield* handle.info;\n\t\t\tconst columns = terminalColumns();\n\t\t\tyield* writeError(\n\t\t\t\theader({\n\t\t\t\t\tsessionId: handle.sessionId,\n\t\t\t\t\tsandbox: info.session.sandbox?.driver ?? \"local\",\n\t\t\t\t\tdirectory: info.placement?.directory ?? info.session.directory,\n\t\t\t\t\tcolumns,\n\t\t\t\t}),\n\t\t\t);\n\t\t\t// The local command joins execution to retain typed error details. Ctrl+C is the user stopping\n\t\t\t// the run, as on the remote path: named so, the next server start does not resume it.\n\t\t\tconst execution = yield* handle.prompt({ text: prompt, delivery: \"followUp\" }).pipe(\n\t\t\t\tEffect.andThen(handle.resume()),\n\t\t\t\tEffect.onInterrupt(() => handle.interrupt().pipe(Effect.timeout(\"5 seconds\"), Effect.ignore)),\n\t\t\t\tEffect.exit,\n\t\t\t);\n\t\t\tyield* handle.wait();\n\t\t\tif (Exit.isFailure(execution)) return yield* Effect.failCause(execution.cause);\n\t\t\tconst leaf = (yield* handle.history()).at(-1);\n\t\t\tif (leaf !== undefined) yield* awaitMessage(ended, leaf.entry.id);\n\t\t\tyield* Fiber.interrupt(printer);\n\t\t\tyield* finish(renderState, columns);\n\t\t});\n\n\t\t// Scope inside the provided layer, so the run's finalizers (stopping a created sandbox) close\n\t\t// while the harness and its database are still open.\n\t\tconst execute = Effect.gen(function* () {\n\t\t\tif (Option.isSome(server)) return yield* remote.pipe(Service.connect(server.value));\n\t\t\t// Stdout carries only the response; harness logs go with the rest of the diagnostics.\n\t\t\tconst opts = harnessOptions(shared);\n\t\t\tconst connectorLayer = ConnectorService.layer(opts.home === undefined ? {} : { home: opts.home });\n\t\t\treturn yield* program.pipe(\n\t\t\t\tEffect.scoped,\n\t\t\t\tEffect.provide(Harness.layer(opts).pipe(Layer.provide(connectorLayer))),\n\t\t\t\tEffect.provideService(Logger.LogToStderr, true),\n\t\t\t);\n\t\t});\n\t\treturn yield* execute.pipe(\n\t\t\tEffect.catch((error) =>\n\t\t\t\twriteError(renderError(error)).pipe(\n\t\t\t\t\tEffect.andThen(\n\t\t\t\t\t\tEffect.sync(() => {\n\t\t\t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,CAAC,KACrB,OAAO,OAAO,UACb,WAAW,YAAY,KAAK,CAAC,CAAC,CAAC,KAC9B,OAAO,QACN,OAAO,WAAW;EACjB,QAAQ,WAAW;CACpB,CAAC,CACF,CACD,CACD,CACD;AACD,CAAC,CACF"}
|
|
@@ -272,18 +272,161 @@ const Cmd = make("codework", {
|
|
|
272
272
|
]
|
|
273
273
|
}),
|
|
274
274
|
make("connect", {
|
|
275
|
-
description: "Connect this machine to a workspace",
|
|
275
|
+
description: "Connect this machine to a workspace, or manage external Connectors & Connections",
|
|
276
276
|
params: {
|
|
277
277
|
workspace: Flag.String("workspace").pipe(Flag.withDescription("Workspace to connect to; otherwise the approver picks it"), Flag.optional),
|
|
278
278
|
machineId: Flag.String("machine-id").pipe(Flag.withDescription("Set this home's machine id instead of generating one, e.g. build-box-1"), Flag.optional)
|
|
279
279
|
},
|
|
280
|
-
examples: [
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
280
|
+
examples: [
|
|
281
|
+
{
|
|
282
|
+
command: "codework connect",
|
|
283
|
+
description: "Show a code to approve in the CodeWork app"
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
command: "codework connect --machine-id build-box-1",
|
|
287
|
+
description: "Connect with a fixed id, replacing a rebuilt machine's old link"
|
|
288
|
+
},
|
|
289
|
+
{
|
|
290
|
+
command: "codework connect discover",
|
|
291
|
+
description: "Browse available Connectors in the catalog"
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
command: "codework connect create app.linear",
|
|
295
|
+
description: "Create and authorize a Linear MCP connection"
|
|
296
|
+
}
|
|
297
|
+
],
|
|
298
|
+
commands: [
|
|
299
|
+
make("discover", {
|
|
300
|
+
description: "Browse available Connectors in the catalog",
|
|
301
|
+
params: {
|
|
302
|
+
query: Argument.String("query").pipe(Argument.withDescription("Optional search query"), Argument.optional),
|
|
303
|
+
kind: Flag.Literals("kind", [
|
|
304
|
+
"provider",
|
|
305
|
+
"mcp",
|
|
306
|
+
"integration"
|
|
307
|
+
]).pipe(Flag.withDescription("Filter by page group: provider, mcp, or integration"), Flag.optional),
|
|
308
|
+
category: Flag.String("category").pipe(Flag.withDescription("Filter by category slug (e.g. ai, developer, productivity)"), Flag.optional),
|
|
309
|
+
refresh: Flag.Boolean("refresh").pipe(Flag.withDescription("Fetch the latest catalog from catalog.codework.sh"), Flag.withDefault(false)),
|
|
310
|
+
server: RunningServer,
|
|
311
|
+
json: JsonFlag
|
|
312
|
+
},
|
|
313
|
+
examples: [{
|
|
314
|
+
command: "codework connect discover",
|
|
315
|
+
description: "List all catalog connectors"
|
|
316
|
+
}, {
|
|
317
|
+
command: "codework connect discover --kind mcp",
|
|
318
|
+
description: "List MCP connectors"
|
|
319
|
+
}]
|
|
320
|
+
}),
|
|
321
|
+
make("categories", {
|
|
322
|
+
description: "List connector catalog categories",
|
|
323
|
+
params: {
|
|
324
|
+
server: RunningServer,
|
|
325
|
+
json: JsonFlag
|
|
326
|
+
},
|
|
327
|
+
examples: [{
|
|
328
|
+
command: "codework connect categories",
|
|
329
|
+
description: "Show available categories"
|
|
330
|
+
}]
|
|
331
|
+
}),
|
|
332
|
+
make("create", {
|
|
333
|
+
description: "Create a workspace Connection from a catalog Connector",
|
|
334
|
+
params: {
|
|
335
|
+
connector: Argument.String("connector").pipe(Argument.withDescription("Connector reverse-DNS id or alias (e.g. app.linear, linear, com.anthropic)")),
|
|
336
|
+
name: Flag.String("name").pipe(Flag.withDescription("Connection slug within this workspace (default: default)"), Flag.optional),
|
|
337
|
+
label: Flag.String("label").pipe(Flag.withDescription("Display label shown in the UI"), Flag.optional),
|
|
338
|
+
auth: Flag.Literals("auth", ["oauth", "apikey"]).pipe(Flag.withDescription("Authentication method (oauth or apikey)"), Flag.optional),
|
|
339
|
+
ownership: Flag.Literals("ownership", ["personal", "shared"]).pipe(Flag.withDescription("Credential ownership: personal (default for oauth) or shared (default for apikey)"), Flag.optional),
|
|
340
|
+
apiKey: Flag.String("api-key").pipe(Flag.withDescription("API key value (only for --auth apikey; omits interactive prompt)"), Flag.optional),
|
|
341
|
+
device: Flag.Boolean("device").pipe(Flag.withDescription("Use device-code OAuth flow when supported"), Flag.withDefault(false)),
|
|
342
|
+
enterprise: Flag.String("enterprise").pipe(Flag.withDescription("GitHub Enterprise URL for GitHub Copilot"), Flag.optional),
|
|
343
|
+
noAuth: Flag.Boolean("no-auth").pipe(Flag.withDescription("Create the connection record without authenticating immediately"), Flag.withDefault(false)),
|
|
344
|
+
browser: Flag.Boolean("browser").pipe(Flag.withDescription("Open the authorization URL in the default browser"), Flag.withDefault(true)),
|
|
345
|
+
server: RunningServer,
|
|
346
|
+
json: JsonFlag
|
|
347
|
+
},
|
|
348
|
+
examples: [{
|
|
349
|
+
command: "codework connect create app.linear",
|
|
350
|
+
description: "Create and sign in to Linear MCP"
|
|
351
|
+
}, {
|
|
352
|
+
command: "codework connect create com.anthropic --name work --auth apikey",
|
|
353
|
+
description: "Create a named Anthropic API key connection"
|
|
354
|
+
}]
|
|
355
|
+
}),
|
|
356
|
+
make("login", {
|
|
357
|
+
description: "Authenticate or re-authenticate an existing Connection",
|
|
358
|
+
params: {
|
|
359
|
+
ref: Argument.String("ref").pipe(Argument.withDescription("Connection uid (e.g. app.linear/default) or id")),
|
|
360
|
+
apiKey: Flag.String("api-key").pipe(Flag.withDescription("API key value (for apikey connections)"), Flag.optional),
|
|
361
|
+
device: Flag.Boolean("device").pipe(Flag.withDescription("Use device-code OAuth flow when supported"), Flag.withDefault(false)),
|
|
362
|
+
enterprise: Flag.String("enterprise").pipe(Flag.withDescription("GitHub Enterprise URL for GitHub Copilot"), Flag.optional),
|
|
363
|
+
browser: Flag.Boolean("browser").pipe(Flag.withDescription("Open the authorization URL in the default browser"), Flag.withDefault(true)),
|
|
364
|
+
server: RunningServer,
|
|
365
|
+
json: JsonFlag
|
|
366
|
+
},
|
|
367
|
+
examples: [{
|
|
368
|
+
command: "codework connect login app.linear/default",
|
|
369
|
+
description: "Sign in to Linear MCP"
|
|
370
|
+
}]
|
|
371
|
+
}),
|
|
372
|
+
make("list", {
|
|
373
|
+
description: "List workspace Connections (including auto-detected host env)",
|
|
374
|
+
params: {
|
|
375
|
+
kind: Flag.Literals("kind", [
|
|
376
|
+
"provider",
|
|
377
|
+
"mcp",
|
|
378
|
+
"integration"
|
|
379
|
+
]).pipe(Flag.withDescription("Filter by page group: provider, mcp, or integration"), Flag.optional),
|
|
380
|
+
connector: Flag.String("connector").pipe(Flag.withDescription("Filter by connector reverse-DNS id"), Flag.optional),
|
|
381
|
+
includeEnv: Flag.Boolean("include-env").pipe(Flag.withDescription("Include read-only auto-detected host env connections"), Flag.withDefault(true)),
|
|
382
|
+
server: RunningServer,
|
|
383
|
+
json: JsonFlag
|
|
384
|
+
},
|
|
385
|
+
examples: [{
|
|
386
|
+
command: "codework connect list",
|
|
387
|
+
description: "List all connections in this workspace"
|
|
388
|
+
}, {
|
|
389
|
+
command: "codework connect list --kind provider",
|
|
390
|
+
description: "List LLM provider connections"
|
|
391
|
+
}]
|
|
392
|
+
}),
|
|
393
|
+
make("status", {
|
|
394
|
+
description: "Show status of a Connection without refreshing or printing secrets",
|
|
395
|
+
params: {
|
|
396
|
+
ref: Argument.String("ref").pipe(Argument.withDescription("Connection uid (e.g. app.linear/default) or id")),
|
|
397
|
+
server: RunningServer,
|
|
398
|
+
json: JsonFlag
|
|
399
|
+
},
|
|
400
|
+
examples: [{
|
|
401
|
+
command: "codework connect status app.linear/default",
|
|
402
|
+
description: "Show connection status"
|
|
403
|
+
}]
|
|
404
|
+
}),
|
|
405
|
+
make("disconnect", {
|
|
406
|
+
description: "Clear stored credentials for a Connection without deleting it",
|
|
407
|
+
params: {
|
|
408
|
+
ref: Argument.String("ref").pipe(Argument.withDescription("Connection uid (e.g. app.linear/default) or id")),
|
|
409
|
+
server: RunningServer,
|
|
410
|
+
json: JsonFlag
|
|
411
|
+
},
|
|
412
|
+
examples: [{
|
|
413
|
+
command: "codework connect disconnect app.linear/default",
|
|
414
|
+
description: "Sign out of Linear MCP"
|
|
415
|
+
}]
|
|
416
|
+
}),
|
|
417
|
+
make("remove", {
|
|
418
|
+
description: "Delete a Connection and all its stored credentials",
|
|
419
|
+
params: {
|
|
420
|
+
ref: Argument.String("ref").pipe(Argument.withDescription("Connection uid (e.g. app.linear/default) or id")),
|
|
421
|
+
server: RunningServer,
|
|
422
|
+
json: JsonFlag
|
|
423
|
+
},
|
|
424
|
+
examples: [{
|
|
425
|
+
command: "codework connect remove app.linear/default",
|
|
426
|
+
description: "Delete the Linear MCP connection"
|
|
427
|
+
}]
|
|
428
|
+
})
|
|
429
|
+
]
|
|
287
430
|
}),
|
|
288
431
|
make("disconnect", {
|
|
289
432
|
description: "Disconnect this machine from a workspace",
|
|
@@ -648,4 +791,4 @@ function provide(node, handlers, context) {
|
|
|
648
791
|
//#endregion
|
|
649
792
|
export { Cmd as i, handlers as n, run as r, handler as t };
|
|
650
793
|
|
|
651
|
-
//# sourceMappingURL=runtime-
|
|
794
|
+
//# sourceMappingURL=runtime-CyXV7HH_.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-CyXV7HH_.mjs","names":["Spec.make","Otel.layer"],"sources":["../../src/framework/spec.ts","../../src/cli/cmd/cmd.ts","../../src/framework/otel.ts","../../src/framework/runtime.ts"],"sourcesContent":["import { Command } from \"effect/cli\";\n\n/**\n * A declarative command tree. Specs carry only the shape of a command -- its\n * name, parameters, description, and children -- so the whole CLI surface can\n * be read in one file. Handlers are attached separately by {@link Runtime}, which\n * keeps their imports (and the harness they pull in) off the startup path.\n */\n\nexport interface Example {\n\treadonly command: string;\n\treadonly description: string;\n}\n\ninterface Options<\n\tConfig extends Command.Command.Config,\n\tShared extends Command.Command.FlagConfig,\n\tCommands extends ReadonlyArray<Any>,\n> {\n\treadonly description?: string;\n\treadonly params?: Config;\n\t/** Flags declared here are also parsed by every descendant command. */\n\treadonly shared?: Shared;\n\treadonly examples?: ReadonlyArray<Example>;\n\treadonly commands?: Commands;\n}\n\nexport interface Node<\n\tName extends string,\n\t// The tree is heterogeneous, so a node has to accept any command shape here.\n\t// Concrete types are recovered per-command through `Runtime.Input`.\n\t// biome-ignore lint/suspicious/noExplicitAny: heterogeneous command tree\n\tSpec extends Command.Command<Name, any, any, any, any>,\n\tCommands extends Children,\n> {\n\treadonly name: Name;\n\treadonly spec: Spec;\n\treadonly commands: Commands;\n}\n\n// The command name is invariant on `Command`, so the erased node type has to\n// admit any name for concrete nodes to be assignable to it.\n// biome-ignore lint/suspicious/noExplicitAny: heterogeneous command tree\nexport type Any = Node<string, Command.Command<any, any, any, any, any>, Children>;\nexport type Children = Readonly<Record<string, Any>>;\n\ntype ChildrenOf<Commands extends ReadonlyArray<Any>> = {\n\treadonly [Node in Commands[number] as Node[\"name\"]]: Node;\n};\n\nexport function make<\n\tconst Name extends string,\n\tconst Config extends Command.Command.Config = {},\n\tconst Shared extends Command.Command.FlagConfig = {},\n\tconst Commands extends ReadonlyArray<Any> = [],\n>(name: Name, options: Options<Config, Shared, Commands> = {}) {\n\tlet spec = Command.make(name, options.params ?? ({} as Config)).pipe(\n\t\tCommand.withSharedFlags(options.shared ?? ({} as Shared)),\n\t);\n\tif (options.description !== undefined) spec = spec.pipe(Command.withDescription(options.description));\n\tif (options.examples !== undefined) spec = spec.pipe(Command.withExamples(options.examples));\n\treturn {\n\t\tname,\n\t\tspec,\n\t\tcommands: Object.fromEntries(\n\t\t\t(options.commands ?? []).map((command) => [command.name, command]),\n\t\t) as ChildrenOf<Commands>,\n\t};\n}\n","import { Model } from \"@codeworksh/aikit\";\nimport { Schema } from \"effect\";\nimport { Argument, Flag } from \"effect/cli\";\nimport * as Spec from \"../../framework/spec.ts\";\n\n/**\n * The full command surface of the `codework` CLI. Declarations only -- each\n * command's behaviour lives in `./handlers`, wired up in `src/index.ts`.\n */\n\nconst thinkingLevels = Object.values(Model.ThinkingLevelEnum);\n\n/**\n * Every `auth` subcommand answers the same three questions: which provider,\n * whose credentials, and where they live. Only `login` needs anything more.\n */\nconst AuthParams = {\n\topenaiCodex: Flag.Boolean(\"openai-codex\").pipe(\n\t\tFlag.withDescription(\"Use OpenAI Codex OAuth\"),\n\t\tFlag.withDefault(false),\n\t),\n\tgithubCopilot: Flag.Boolean(\"github-copilot\").pipe(\n\t\tFlag.withDescription(\"Use GitHub Copilot OAuth (device flow)\"),\n\t\tFlag.withDefault(false),\n\t),\n\tserver: Flag.String(\"server\").pipe(Flag.withDescription(\"RPC server URL (ws://host:port/rpc/v1)\"), Flag.optional),\n\tauthFile: Flag.String(\"auth-file\").pipe(\n\t\tFlag.withDescription(\"Credential file (defaults to <home>/aikit/auth.json)\"),\n\t\tFlag.optional,\n\t),\n};\n\n/** Where the background server binds when `service` has to start one. */\nconst ServerAddress = {\n\thost: Flag.String(\"host\").pipe(\n\t\tFlag.withDescription(\"Host interface the background server binds\"),\n\t\tFlag.withDefault(\"127.0.0.1\"),\n\t),\n\tport: Flag.Int(\"port\").pipe(\n\t\tFlag.withSchema(Schema.Int.check(Schema.isBetween({ minimum: 0, maximum: 65535 }))),\n\t\tFlag.withDescription(\"Port the background server listens on\"),\n\t\tFlag.withDefault(7433),\n\t),\n};\n\n/** For commands that only talk to a server that is already running. */\nconst RunningServer = Flag.String(\"server\").pipe(\n\tFlag.withDescription(\"RPC server URL (defaults to this home's server)\"),\n\tFlag.optional,\n);\n\n/** A thread's MCP server in a running server: every thread sharing its instance is affected. */\nconst McpControlParams = {\n\tname: Argument.String(\"name\").pipe(Argument.withDescription(\"Server name in mcp.json\")),\n\tsession: Flag.String(\"session\").pipe(Flag.withAlias(\"s\"), Flag.withDescription(\"The session\")),\n\tthread: Flag.String(\"thread\").pipe(\n\t\tFlag.withDescription(\"Thread of --session whose server it is: a thread ID, or main (default)\"),\n\t\tFlag.optional,\n\t),\n\tserver: RunningServer,\n};\n\nconst JsonFlag = Flag.Boolean(\"json\").pipe(\n\tFlag.withDescription(\"Print machine-readable output\"),\n\tFlag.withDefault(false),\n);\n\nexport const Cmd = Spec.make(\"codework\", {\n\tdescription: \"CodeWork Command Line Interface\",\n\tshared: {\n\t\tuserConfigDir: Flag.String(\"user-config-dir\").pipe(\n\t\t\tFlag.withDescription(\"Directory whose settings.jsonc replaces the user settings in --home\"),\n\t\t\tFlag.optional,\n\t\t),\n\t\thome: Flag.String(\"home\").pipe(\n\t\t\tFlag.withDescription(\"CodeWork home: user settings, credentials, cache and data (default: ~/.codework)\"),\n\t\t\tFlag.optional,\n\t\t),\n\t\tdatabase: Flag.String(\"database\").pipe(Flag.withDescription(\"SQLite database path or :memory:\"), Flag.optional),\n\t},\n\tcommands: [\n\t\tSpec.make(\"auth\", {\n\t\t\tdescription: \"Manage OAuth credentials\",\n\t\t\tcommands: [\n\t\t\t\tSpec.make(\"login\", {\n\t\t\t\t\tdescription: \"Sign in to a provider\",\n\t\t\t\t\tparams: {\n\t\t\t\t\t\t...AuthParams,\n\t\t\t\t\t\tbrowser: Flag.Boolean(\"browser\").pipe(\n\t\t\t\t\t\t\tFlag.withDescription(\"Open the authorization URL in the default browser\"),\n\t\t\t\t\t\t\tFlag.withDefault(true),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tdevice: Flag.Boolean(\"device\").pipe(\n\t\t\t\t\t\t\tFlag.withDescription(\"Use the device-code flow instead of a localhost browser callback\"),\n\t\t\t\t\t\t\tFlag.withDefault(false),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tenterprise: Flag.String(\"enterprise\").pipe(\n\t\t\t\t\t\t\tFlag.withDescription(\"GitHub Enterprise domain for GitHub Copilot login\"),\n\t\t\t\t\t\t\tFlag.optional,\n\t\t\t\t\t\t),\n\t\t\t\t\t\tenableModels: Flag.Boolean(\"enable-models\").pipe(\n\t\t\t\t\t\t\tFlag.withDescription(\"Enable unconfigured Copilot catalog models after login\"),\n\t\t\t\t\t\t\tFlag.withDefault(false),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tjson: JsonFlag,\n\t\t\t\t\t},\n\t\t\t\t\texamples: [\n\t\t\t\t\t\t{ command: \"codework auth login --openai-codex\", description: \"Sign in with ChatGPT\" },\n\t\t\t\t\t\t{ command: \"codework auth login --github-copilot\", description: \"Sign in with GitHub Copilot\" },\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcommand: \"codework auth login --openai-codex --device\",\n\t\t\t\t\t\t\tdescription: \"Sign in with a device code, no local port\",\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcommand: \"codework auth login --openai-codex --server ws://127.0.0.1:7433/rpc/v1\",\n\t\t\t\t\t\t\tdescription: \"Sign in the running server\",\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t}),\n\t\t\t\tSpec.make(\"status\", {\n\t\t\t\t\tdescription: \"Show a stored login without refreshing it\",\n\t\t\t\t\tparams: { ...AuthParams, json: JsonFlag },\n\t\t\t\t\texamples: [{ command: \"codework auth status --openai-codex\", description: \"Show the stored login\" }],\n\t\t\t\t}),\n\t\t\t\tSpec.make(\"refresh\", {\n\t\t\t\t\tdescription: \"Refresh a stored login if it has expired\",\n\t\t\t\t\tparams: { ...AuthParams, json: JsonFlag },\n\t\t\t\t\texamples: [{ command: \"codework auth refresh --openai-codex\", description: \"Renew an expired login\" }],\n\t\t\t\t}),\n\t\t\t\tSpec.make(\"logout\", {\n\t\t\t\t\tdescription: \"Clear a stored login\",\n\t\t\t\t\tparams: AuthParams,\n\t\t\t\t\texamples: [{ command: \"codework auth logout --github-copilot\", description: \"Clear the stored login\" }],\n\t\t\t\t}),\n\t\t\t],\n\t\t}),\n\t\tSpec.make(\"mcp\", {\n\t\t\tdescription: \"Manage MCP servers\",\n\t\t\tcommands: [\n\t\t\t\tSpec.make(\"add\", {\n\t\t\t\t\tdescription: \"Add or replace a server in mcp.json\",\n\t\t\t\t\tparams: {\n\t\t\t\t\t\tname: Argument.String(\"name\").pipe(Argument.withDescription(\"Server name\")),\n\t\t\t\t\t\tcommand: Argument.String(\"command\").pipe(\n\t\t\t\t\t\t\tArgument.withDescription(\"Command and arguments of a stdio server, after --\"),\n\t\t\t\t\t\t\tArgument.variadic({ min: 0 }),\n\t\t\t\t\t\t),\n\t\t\t\t\t\turl: Flag.String(\"url\").pipe(\n\t\t\t\t\t\t\tFlag.withDescription(\"Streamable HTTP server URL (instead of a command)\"),\n\t\t\t\t\t\t\tFlag.optional,\n\t\t\t\t\t\t),\n\t\t\t\t\t\tenv: Flag.KeyValuePair(\"env\").pipe(\n\t\t\t\t\t\t\tFlag.withDescription(\"Environment variable of a stdio server, as KEY=VALUE\"),\n\t\t\t\t\t\t\tFlag.optional,\n\t\t\t\t\t\t),\n\t\t\t\t\t\tcwd: Flag.String(\"cwd\").pipe(\n\t\t\t\t\t\t\tFlag.withDescription(\"Working directory of a stdio server\"),\n\t\t\t\t\t\t\tFlag.optional,\n\t\t\t\t\t\t),\n\t\t\t\t\t\theader: Flag.KeyValuePair(\"header\").pipe(\n\t\t\t\t\t\t\tFlag.withDescription(\"HTTP header, as KEY=VALUE\"),\n\t\t\t\t\t\t\tFlag.optional,\n\t\t\t\t\t\t),\n\t\t\t\t\t\tbearerTokenEnvVar: Flag.String(\"bearer-token-env-var\").pipe(\n\t\t\t\t\t\t\tFlag.withDescription('Send \"Authorization: Bearer ${NAME}\"'),\n\t\t\t\t\t\t\tFlag.optional,\n\t\t\t\t\t\t),\n\t\t\t\t\t\toauthClientId: Flag.String(\"oauth-client-id\").pipe(\n\t\t\t\t\t\t\tFlag.withDescription(\"Pre-registered OAuth client id\"),\n\t\t\t\t\t\t\tFlag.optional,\n\t\t\t\t\t\t),\n\t\t\t\t\t\toauthClientSecret: Flag.String(\"oauth-client-secret\").pipe(\n\t\t\t\t\t\t\tFlag.withDescription(\"OAuth client secret (may be ${NAME} or !command)\"),\n\t\t\t\t\t\t\tFlag.optional,\n\t\t\t\t\t\t),\n\t\t\t\t\t\toauthCallbackPort: Flag.Int(\"oauth-callback-port\").pipe(\n\t\t\t\t\t\t\tFlag.withSchema(Schema.Int.check(Schema.isBetween({ minimum: 1, maximum: 65535 }))),\n\t\t\t\t\t\t\tFlag.withDescription(\"Fixed OAuth callback port\"),\n\t\t\t\t\t\t\tFlag.optional,\n\t\t\t\t\t\t),\n\t\t\t\t\t\toauthClientName: Flag.String(\"oauth-client-name\").pipe(\n\t\t\t\t\t\t\tFlag.withDescription(\"Client name sent when registering with the OAuth server\"),\n\t\t\t\t\t\t\tFlag.optional,\n\t\t\t\t\t\t),\n\t\t\t\t\t\texposure: Flag.Literals(\"exposure\", [\"direct\", \"hidden\", \"codemode\", \"deferred\"]).pipe(\n\t\t\t\t\t\t\tFlag.withDescription(\"How the model reaches the server's tools (default: direct)\"),\n\t\t\t\t\t\t\tFlag.optional,\n\t\t\t\t\t\t),\n\t\t\t\t\t\tdescription: Flag.String(\"description\").pipe(\n\t\t\t\t\t\t\tFlag.withDescription(\"What the server offers\"),\n\t\t\t\t\t\t\tFlag.optional,\n\t\t\t\t\t\t),\n\t\t\t\t\t\tlocal: Flag.Boolean(\"local\").pipe(\n\t\t\t\t\t\t\tFlag.withAlias(\"l\"),\n\t\t\t\t\t\t\tFlag.withDescription(\"Write the project's .codework/mcp.json instead of the user one\"),\n\t\t\t\t\t\t\tFlag.withDefault(false),\n\t\t\t\t\t\t),\n\t\t\t\t\t},\n\t\t\t\t\texamples: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcommand: \"codework mcp add fs -- npx -y @modelcontextprotocol/server-filesystem .\",\n\t\t\t\t\t\t\tdescription: \"Add a stdio server\",\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcommand: \"codework mcp add linear --url https://mcp.linear.app/mcp\",\n\t\t\t\t\t\t\tdescription: \"Add an HTTP server; sign in with codework mcp login linear\",\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcommand: \"codework mcp add tools -l --url http://127.0.0.1:8080/mcp\",\n\t\t\t\t\t\t\tdescription: \"Add a server to this project only\",\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t}),\n\t\t\t\tSpec.make(\"remove\", {\n\t\t\t\t\tdescription: \"Remove a server from mcp.json\",\n\t\t\t\t\tparams: {\n\t\t\t\t\t\tname: Argument.String(\"name\").pipe(Argument.withDescription(\"Server name in mcp.json\")),\n\t\t\t\t\t\tlocal: Flag.Boolean(\"local\").pipe(\n\t\t\t\t\t\t\tFlag.withAlias(\"l\"),\n\t\t\t\t\t\t\tFlag.withDescription(\"Remove it from the project's .codework/mcp.json instead of the user one\"),\n\t\t\t\t\t\t\tFlag.withDefault(false),\n\t\t\t\t\t\t),\n\t\t\t\t\t},\n\t\t\t\t\texamples: [{ command: \"codework mcp remove linear\", description: \"Remove the linear server\" }],\n\t\t\t\t}),\n\t\t\t\tSpec.make(\"list\", {\n\t\t\t\t\tdescription: \"Connect to every enabled server and show its state, tools and errors\",\n\t\t\t\t\tparams: { json: JsonFlag },\n\t\t\t\t\texamples: [\n\t\t\t\t\t\t{ command: \"codework mcp list\", description: \"Check every configured server; exits 1 on a failure\" },\n\t\t\t\t\t],\n\t\t\t\t}),\n\t\t\t\tSpec.make(\"login\", {\n\t\t\t\t\tdescription: \"Sign in to an MCP server with OAuth\",\n\t\t\t\t\tparams: {\n\t\t\t\t\t\tname: Argument.String(\"name\").pipe(Argument.withDescription(\"Server name in mcp.json\")),\n\t\t\t\t\t\tbrowser: Flag.Boolean(\"browser\").pipe(\n\t\t\t\t\t\t\tFlag.withDescription(\"Open the authorization URL in the default browser\"),\n\t\t\t\t\t\t\tFlag.withDefault(true),\n\t\t\t\t\t\t),\n\t\t\t\t\t\ttimeout: Flag.Int(\"timeout\").pipe(\n\t\t\t\t\t\t\tFlag.withSchema(Schema.Int.check(Schema.isGreaterThan(0))),\n\t\t\t\t\t\t\tFlag.withDescription(\"Seconds the whole sign-in may take\"),\n\t\t\t\t\t\t\tFlag.withDefault(300),\n\t\t\t\t\t\t),\n\t\t\t\t\t},\n\t\t\t\t\texamples: [\n\t\t\t\t\t\t{ command: \"codework mcp login linear\", description: \"Sign in to the linear server\" },\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcommand: \"codework mcp login linear --browser=false\",\n\t\t\t\t\t\t\tdescription: \"Print the URL; paste the redirected URL back if the browser is elsewhere\",\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t}),\n\t\t\t\tSpec.make(\"logout\", {\n\t\t\t\t\tdescription: \"Remove the stored OAuth credentials of an MCP server\",\n\t\t\t\t\tparams: {\n\t\t\t\t\t\tname: Argument.String(\"name\").pipe(Argument.withDescription(\"Server name in mcp.json\")),\n\t\t\t\t\t},\n\t\t\t\t\texamples: [{ command: \"codework mcp logout linear\", description: \"Sign out of the linear server\" }],\n\t\t\t\t}),\n\t\t\t\tSpec.make(\"reconnect\", {\n\t\t\t\t\tdescription: \"Connect a thread's MCP server afresh in a running server\",\n\t\t\t\t\tparams: McpControlParams,\n\t\t\t\t\texamples: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcommand: \"codework mcp reconnect linear --session ses_01h9\",\n\t\t\t\t\t\t\tdescription: \"Restart the linear server the main thread uses; its tools return from the next turn\",\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcommand: \"codework mcp reconnect linear --session ses_01h9 --thread thr_01ja\",\n\t\t\t\t\t\t\tdescription: \"Restart the one a thread of the session uses\",\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t}),\n\t\t\t\tSpec.make(\"disconnect\", {\n\t\t\t\t\tdescription: \"Close a thread's MCP server in a running server until it is reconnected\",\n\t\t\t\t\tparams: McpControlParams,\n\t\t\t\t\texamples: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcommand: \"codework mcp disconnect linear --session ses_01h9\",\n\t\t\t\t\t\t\tdescription: \"Close the linear server the main thread uses\",\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t}),\n\t\t\t],\n\t\t}),\n\t\tSpec.make(\"run\", {\n\t\t\tdescription: \"Start or continue an agent session\",\n\t\t\tparams: {\n\t\t\t\tserver: Flag.String(\"server\").pipe(\n\t\t\t\t\tFlag.withDescription(\"RPC server URL (ws://host:port/rpc/v1)\"),\n\t\t\t\t\tFlag.optional,\n\t\t\t\t),\n\t\t\t\tprompt: Argument.String(\"prompt\").pipe(Argument.withDescription(\"Prompt for the agent\")),\n\t\t\t\tsession: Flag.String(\"session\").pipe(\n\t\t\t\t\tFlag.withAlias(\"s\"),\n\t\t\t\t\tFlag.withDescription(\"Continue an existing session\"),\n\t\t\t\t\tFlag.optional,\n\t\t\t\t),\n\t\t\t\tthread: Flag.String(\"thread\").pipe(\n\t\t\t\t\tFlag.withDescription(\"Thread of --session to continue: a thread ID, or main (default)\"),\n\t\t\t\t\tFlag.optional,\n\t\t\t\t),\n\t\t\t\tcwd: Flag.String(\"cwd\").pipe(\n\t\t\t\t\tFlag.withAlias(\"C\"),\n\t\t\t\t\tFlag.withDescription(\"Working directory for a new session\"),\n\t\t\t\t\tFlag.optional,\n\t\t\t\t),\n\t\t\t\tsandboxDriver: Flag.String(\"sandbox-driver\").pipe(\n\t\t\t\t\tFlag.withDescription(\"Sandbox driver for a new session (default: local)\"),\n\t\t\t\t\tFlag.optional,\n\t\t\t\t),\n\t\t\t\tsandboxId: Flag.String(\"sandbox-id\").pipe(\n\t\t\t\t\tFlag.withDescription(\"Reuse an existing sandbox instance\"),\n\t\t\t\t\tFlag.optional,\n\t\t\t\t),\n\t\t\t\tsandboxProviderId: Flag.String(\"sandbox-provider-id\").pipe(\n\t\t\t\t\tFlag.withDescription(\"Provider ID of an existing remote sandbox\"),\n\t\t\t\t\tFlag.optional,\n\t\t\t\t),\n\t\t\t\tprovider: Flag.String(\"provider\").pipe(Flag.withDescription(\"Model catalog provider ID\"), Flag.optional),\n\t\t\t\tmodel: Flag.String(\"model\").pipe(Flag.withDescription(\"Model ID\"), Flag.optional),\n\t\t\t\tthinking: Flag.Literals(\"thinking\", thinkingLevels).pipe(\n\t\t\t\t\tFlag.withDescription(\"Reasoning effort the model uses before answering\"),\n\t\t\t\t\tFlag.optional,\n\t\t\t\t),\n\t\t\t},\n\t\t\texamples: [\n\t\t\t\t{ command: 'codework run \"Inspect the failing tests\"', description: \"Create a session\" },\n\t\t\t\t{\n\t\t\t\t\tcommand: 'codework run --provider openai --model gpt-5.5 --thinking high \"Inspect the failing tests\"',\n\t\t\t\t\tdescription: \"Create a session with an explicit model\",\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tcommand: 'codework run --sandbox-driver daytona \"Inspect the repository\"',\n\t\t\t\t\tdescription: \"Create a Daytona sandbox and session\",\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tcommand: 'codework run --sandbox-driver daytona --sandbox-provider-id <id> \"Inspect the repository\"',\n\t\t\t\t\tdescription: \"Use an existing remote sandbox\",\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tcommand: 'codework run --session <id> --provider openai --model gpt-5.6-luna \"Now fix them\"',\n\t\t\t\t\tdescription: \"Continue a session with explicit model bindings\",\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tcommand: 'codework run --session <id> --thread <thread-id> \"Try OAuth instead\"',\n\t\t\t\t\tdescription: \"Continue one of the session's threads\",\n\t\t\t\t},\n\t\t\t],\n\t\t}),\n\t\tSpec.make(\"connect\", {\n\t\t\tdescription: \"Connect this machine to a workspace, or manage external Connectors & Connections\",\n\t\t\tparams: {\n\t\t\t\tworkspace: Flag.String(\"workspace\").pipe(\n\t\t\t\t\tFlag.withDescription(\"Workspace to connect to; otherwise the approver picks it\"),\n\t\t\t\t\tFlag.optional,\n\t\t\t\t),\n\t\t\t\tmachineId: Flag.String(\"machine-id\").pipe(\n\t\t\t\t\tFlag.withDescription(\"Set this home's machine id instead of generating one, e.g. build-box-1\"),\n\t\t\t\t\tFlag.optional,\n\t\t\t\t),\n\t\t\t},\n\t\t\texamples: [\n\t\t\t\t{ command: \"codework connect\", description: \"Show a code to approve in the CodeWork app\" },\n\t\t\t\t{\n\t\t\t\t\tcommand: \"codework connect --machine-id build-box-1\",\n\t\t\t\t\tdescription: \"Connect with a fixed id, replacing a rebuilt machine's old link\",\n\t\t\t\t},\n\t\t\t\t{ command: \"codework connect discover\", description: \"Browse available Connectors in the catalog\" },\n\t\t\t\t{\n\t\t\t\t\tcommand: \"codework connect create app.linear\",\n\t\t\t\t\tdescription: \"Create and authorize a Linear MCP connection\",\n\t\t\t\t},\n\t\t\t],\n\t\t\tcommands: [\n\t\t\t\tSpec.make(\"discover\", {\n\t\t\t\t\tdescription: \"Browse available Connectors in the catalog\",\n\t\t\t\t\tparams: {\n\t\t\t\t\t\tquery: Argument.String(\"query\").pipe(\n\t\t\t\t\t\t\tArgument.withDescription(\"Optional search query\"),\n\t\t\t\t\t\t\tArgument.optional,\n\t\t\t\t\t\t),\n\t\t\t\t\t\tkind: Flag.Literals(\"kind\", [\"provider\", \"mcp\", \"integration\"]).pipe(\n\t\t\t\t\t\t\tFlag.withDescription(\"Filter by page group: provider, mcp, or integration\"),\n\t\t\t\t\t\t\tFlag.optional,\n\t\t\t\t\t\t),\n\t\t\t\t\t\tcategory: Flag.String(\"category\").pipe(\n\t\t\t\t\t\t\tFlag.withDescription(\"Filter by category slug (e.g. ai, developer, productivity)\"),\n\t\t\t\t\t\t\tFlag.optional,\n\t\t\t\t\t\t),\n\t\t\t\t\t\trefresh: Flag.Boolean(\"refresh\").pipe(\n\t\t\t\t\t\t\tFlag.withDescription(\"Fetch the latest catalog from catalog.codework.sh\"),\n\t\t\t\t\t\t\tFlag.withDefault(false),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tserver: RunningServer,\n\t\t\t\t\t\tjson: JsonFlag,\n\t\t\t\t\t},\n\t\t\t\t\texamples: [\n\t\t\t\t\t\t{ command: \"codework connect discover\", description: \"List all catalog connectors\" },\n\t\t\t\t\t\t{ command: \"codework connect discover --kind mcp\", description: \"List MCP connectors\" },\n\t\t\t\t\t],\n\t\t\t\t}),\n\t\t\t\tSpec.make(\"categories\", {\n\t\t\t\t\tdescription: \"List connector catalog categories\",\n\t\t\t\t\tparams: {\n\t\t\t\t\t\tserver: RunningServer,\n\t\t\t\t\t\tjson: JsonFlag,\n\t\t\t\t\t},\n\t\t\t\t\texamples: [{ command: \"codework connect categories\", description: \"Show available categories\" }],\n\t\t\t\t}),\n\t\t\t\tSpec.make(\"create\", {\n\t\t\t\t\tdescription: \"Create a workspace Connection from a catalog Connector\",\n\t\t\t\t\tparams: {\n\t\t\t\t\t\tconnector: Argument.String(\"connector\").pipe(\n\t\t\t\t\t\t\tArgument.withDescription(\n\t\t\t\t\t\t\t\t\"Connector reverse-DNS id or alias (e.g. app.linear, linear, com.anthropic)\",\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tname: Flag.String(\"name\").pipe(\n\t\t\t\t\t\t\tFlag.withDescription(\"Connection slug within this workspace (default: default)\"),\n\t\t\t\t\t\t\tFlag.optional,\n\t\t\t\t\t\t),\n\t\t\t\t\t\tlabel: Flag.String(\"label\").pipe(\n\t\t\t\t\t\t\tFlag.withDescription(\"Display label shown in the UI\"),\n\t\t\t\t\t\t\tFlag.optional,\n\t\t\t\t\t\t),\n\t\t\t\t\t\tauth: Flag.Literals(\"auth\", [\"oauth\", \"apikey\"]).pipe(\n\t\t\t\t\t\t\tFlag.withDescription(\"Authentication method (oauth or apikey)\"),\n\t\t\t\t\t\t\tFlag.optional,\n\t\t\t\t\t\t),\n\t\t\t\t\t\townership: Flag.Literals(\"ownership\", [\"personal\", \"shared\"]).pipe(\n\t\t\t\t\t\t\tFlag.withDescription(\n\t\t\t\t\t\t\t\t\"Credential ownership: personal (default for oauth) or shared (default for apikey)\",\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tFlag.optional,\n\t\t\t\t\t\t),\n\t\t\t\t\t\tapiKey: Flag.String(\"api-key\").pipe(\n\t\t\t\t\t\t\tFlag.withDescription(\"API key value (only for --auth apikey; omits interactive prompt)\"),\n\t\t\t\t\t\t\tFlag.optional,\n\t\t\t\t\t\t),\n\t\t\t\t\t\tdevice: Flag.Boolean(\"device\").pipe(\n\t\t\t\t\t\t\tFlag.withDescription(\"Use device-code OAuth flow when supported\"),\n\t\t\t\t\t\t\tFlag.withDefault(false),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tenterprise: Flag.String(\"enterprise\").pipe(\n\t\t\t\t\t\t\tFlag.withDescription(\"GitHub Enterprise URL for GitHub Copilot\"),\n\t\t\t\t\t\t\tFlag.optional,\n\t\t\t\t\t\t),\n\t\t\t\t\t\tnoAuth: Flag.Boolean(\"no-auth\").pipe(\n\t\t\t\t\t\t\tFlag.withDescription(\"Create the connection record without authenticating immediately\"),\n\t\t\t\t\t\t\tFlag.withDefault(false),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tbrowser: Flag.Boolean(\"browser\").pipe(\n\t\t\t\t\t\t\tFlag.withDescription(\"Open the authorization URL in the default browser\"),\n\t\t\t\t\t\t\tFlag.withDefault(true),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tserver: RunningServer,\n\t\t\t\t\t\tjson: JsonFlag,\n\t\t\t\t\t},\n\t\t\t\t\texamples: [\n\t\t\t\t\t\t{ command: \"codework connect create app.linear\", description: \"Create and sign in to Linear MCP\" },\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcommand: \"codework connect create com.anthropic --name work --auth apikey\",\n\t\t\t\t\t\t\tdescription: \"Create a named Anthropic API key connection\",\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t}),\n\t\t\t\tSpec.make(\"login\", {\n\t\t\t\t\tdescription: \"Authenticate or re-authenticate an existing Connection\",\n\t\t\t\t\tparams: {\n\t\t\t\t\t\tref: Argument.String(\"ref\").pipe(\n\t\t\t\t\t\t\tArgument.withDescription(\"Connection uid (e.g. app.linear/default) or id\"),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tapiKey: Flag.String(\"api-key\").pipe(\n\t\t\t\t\t\t\tFlag.withDescription(\"API key value (for apikey connections)\"),\n\t\t\t\t\t\t\tFlag.optional,\n\t\t\t\t\t\t),\n\t\t\t\t\t\tdevice: Flag.Boolean(\"device\").pipe(\n\t\t\t\t\t\t\tFlag.withDescription(\"Use device-code OAuth flow when supported\"),\n\t\t\t\t\t\t\tFlag.withDefault(false),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tenterprise: Flag.String(\"enterprise\").pipe(\n\t\t\t\t\t\t\tFlag.withDescription(\"GitHub Enterprise URL for GitHub Copilot\"),\n\t\t\t\t\t\t\tFlag.optional,\n\t\t\t\t\t\t),\n\t\t\t\t\t\tbrowser: Flag.Boolean(\"browser\").pipe(\n\t\t\t\t\t\t\tFlag.withDescription(\"Open the authorization URL in the default browser\"),\n\t\t\t\t\t\t\tFlag.withDefault(true),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tserver: RunningServer,\n\t\t\t\t\t\tjson: JsonFlag,\n\t\t\t\t\t},\n\t\t\t\t\texamples: [\n\t\t\t\t\t\t{ command: \"codework connect login app.linear/default\", description: \"Sign in to Linear MCP\" },\n\t\t\t\t\t],\n\t\t\t\t}),\n\t\t\t\tSpec.make(\"list\", {\n\t\t\t\t\tdescription: \"List workspace Connections (including auto-detected host env)\",\n\t\t\t\t\tparams: {\n\t\t\t\t\t\tkind: Flag.Literals(\"kind\", [\"provider\", \"mcp\", \"integration\"]).pipe(\n\t\t\t\t\t\t\tFlag.withDescription(\"Filter by page group: provider, mcp, or integration\"),\n\t\t\t\t\t\t\tFlag.optional,\n\t\t\t\t\t\t),\n\t\t\t\t\t\tconnector: Flag.String(\"connector\").pipe(\n\t\t\t\t\t\t\tFlag.withDescription(\"Filter by connector reverse-DNS id\"),\n\t\t\t\t\t\t\tFlag.optional,\n\t\t\t\t\t\t),\n\t\t\t\t\t\tincludeEnv: Flag.Boolean(\"include-env\").pipe(\n\t\t\t\t\t\t\tFlag.withDescription(\"Include read-only auto-detected host env connections\"),\n\t\t\t\t\t\t\tFlag.withDefault(true),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tserver: RunningServer,\n\t\t\t\t\t\tjson: JsonFlag,\n\t\t\t\t\t},\n\t\t\t\t\texamples: [\n\t\t\t\t\t\t{ command: \"codework connect list\", description: \"List all connections in this workspace\" },\n\t\t\t\t\t\t{ command: \"codework connect list --kind provider\", description: \"List LLM provider connections\" },\n\t\t\t\t\t],\n\t\t\t\t}),\n\t\t\t\tSpec.make(\"status\", {\n\t\t\t\t\tdescription: \"Show status of a Connection without refreshing or printing secrets\",\n\t\t\t\t\tparams: {\n\t\t\t\t\t\tref: Argument.String(\"ref\").pipe(\n\t\t\t\t\t\t\tArgument.withDescription(\"Connection uid (e.g. app.linear/default) or id\"),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tserver: RunningServer,\n\t\t\t\t\t\tjson: JsonFlag,\n\t\t\t\t\t},\n\t\t\t\t\texamples: [\n\t\t\t\t\t\t{ command: \"codework connect status app.linear/default\", description: \"Show connection status\" },\n\t\t\t\t\t],\n\t\t\t\t}),\n\t\t\t\tSpec.make(\"disconnect\", {\n\t\t\t\t\tdescription: \"Clear stored credentials for a Connection without deleting it\",\n\t\t\t\t\tparams: {\n\t\t\t\t\t\tref: Argument.String(\"ref\").pipe(\n\t\t\t\t\t\t\tArgument.withDescription(\"Connection uid (e.g. app.linear/default) or id\"),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tserver: RunningServer,\n\t\t\t\t\t\tjson: JsonFlag,\n\t\t\t\t\t},\n\t\t\t\t\texamples: [\n\t\t\t\t\t\t{ command: \"codework connect disconnect app.linear/default\", description: \"Sign out of Linear MCP\" },\n\t\t\t\t\t],\n\t\t\t\t}),\n\t\t\t\tSpec.make(\"remove\", {\n\t\t\t\t\tdescription: \"Delete a Connection and all its stored credentials\",\n\t\t\t\t\tparams: {\n\t\t\t\t\t\tref: Argument.String(\"ref\").pipe(\n\t\t\t\t\t\t\tArgument.withDescription(\"Connection uid (e.g. app.linear/default) or id\"),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tserver: RunningServer,\n\t\t\t\t\t\tjson: JsonFlag,\n\t\t\t\t\t},\n\t\t\t\t\texamples: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcommand: \"codework connect remove app.linear/default\",\n\t\t\t\t\t\t\tdescription: \"Delete the Linear MCP connection\",\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t}),\n\t\t\t],\n\t\t}),\n\t\tSpec.make(\"disconnect\", {\n\t\t\tdescription: \"Disconnect this machine from a workspace\",\n\t\t\tparams: {\n\t\t\t\tworkspace: Flag.String(\"workspace\").pipe(\n\t\t\t\t\tFlag.withDescription(\"Workspace to leave; optional when only one is connected\"),\n\t\t\t\t\tFlag.optional,\n\t\t\t\t),\n\t\t\t},\n\t\t\texamples: [{ command: \"codework disconnect\", description: \"Leave the only connected workspace\" }],\n\t\t}),\n\t\tSpec.make(\"serve\", {\n\t\t\tdescription: \"Start the CodeWork RPC server\",\n\t\t\tparams: {\n\t\t\t\thost: Flag.String(\"host\").pipe(\n\t\t\t\t\tFlag.withDescription(\"Host interface to bind\"),\n\t\t\t\t\tFlag.withDefault(\"127.0.0.1\"),\n\t\t\t\t),\n\t\t\t\tport: Flag.Int(\"port\").pipe(\n\t\t\t\t\tFlag.withSchema(Schema.Int.check(Schema.isBetween({ minimum: 0, maximum: 65535 }))),\n\t\t\t\t\tFlag.withDescription(\"Port to listen on (0 for an ephemeral port)\"),\n\t\t\t\t\tFlag.withDefault(7433),\n\t\t\t\t),\n\t\t\t\tservice: Flag.Boolean(\"service\").pipe(\n\t\t\t\t\tFlag.withDescription(\n\t\t\t\t\t\t\"Run as the background server `codework service` manages, logging to <home>/log/server.log\",\n\t\t\t\t\t),\n\t\t\t\t\tFlag.withDefault(false),\n\t\t\t\t),\n\t\t\t\ttrustedProxy: Flag.String(\"trusted-proxy\").pipe(\n\t\t\t\t\tFlag.withDescription(\n\t\t\t\t\t\t\"Address or CIDR range of a TLS proxy in front of the server, repeatable or comma-separated (default: CODEWORK_TRUSTED_PROXY, then server.trustedProxy in user settings)\",\n\t\t\t\t\t),\n\t\t\t\t\tFlag.atLeast(0),\n\t\t\t\t),\n\t\t\t},\n\t\t\texamples: [\n\t\t\t\t{ command: \"codework serve\", description: \"Start the RPC server on 127.0.0.1:7433\" },\n\t\t\t\t{ command: \"codework serve --port 0\", description: \"Choose an available local port\" },\n\t\t\t\t{\n\t\t\t\t\tcommand: \"codework serve --host 0.0.0.0 --trusted-proxy 10.0.0.0/8\",\n\t\t\t\t\tdescription: \"Believe X-Forwarded-Proto from a proxy in 10.0.0.0/8\",\n\t\t\t\t},\n\t\t\t],\n\t\t}),\n\t\tSpec.make(\"service\", {\n\t\t\tdescription: \"Manage the background server\",\n\t\t\tcommands: [\n\t\t\t\tSpec.make(\"start\", { description: \"Start the background server\", params: ServerAddress }),\n\t\t\t\tSpec.make(\"restart\", { description: \"Restart the background server\", params: ServerAddress }),\n\t\t\t\tSpec.make(\"status\", { description: \"Show background server status\" }),\n\t\t\t\tSpec.make(\"stop\", { description: \"Stop the background server\" }),\n\t\t\t\tSpec.make(\"pair\", {\n\t\t\t\t\tdescription: \"Print a one-time code another computer pairs with, valid 10 minutes\",\n\t\t\t\t}),\n\t\t\t\tSpec.make(\"devices\", { description: \"List paired devices\" }),\n\t\t\t\tSpec.make(\"revoke\", {\n\t\t\t\t\tdescription: \"Unpair a device and end its connections\",\n\t\t\t\t\tparams: { id: Argument.String(\"device-id\").pipe(Argument.withDescription(\"The device to unpair\")) },\n\t\t\t\t}),\n\t\t\t],\n\t\t}),\n\t\tSpec.make(\"session\", {\n\t\t\tdescription: \"Manage sessions\",\n\t\t\tcommands: [\n\t\t\t\tSpec.make(\"link\", {\n\t\t\t\t\tdescription: \"Anchor a session to a host directory\",\n\t\t\t\t\tparams: {\n\t\t\t\t\t\tsession: Argument.String(\"session-id\").pipe(Argument.withDescription(\"The session to link\")),\n\t\t\t\t\t\tpath: Argument.String(\"path\").pipe(\n\t\t\t\t\t\t\t// The anchor is not a configuration mechanism, but `.codework` is the landmark\n\t\t\t\t\t\t\t// a person recognises, so the help names it to make the directory concrete.\n\t\t\t\t\t\t\tArgument.withDescription(\n\t\t\t\t\t\t\t\t\"Host directory to anchor to — typically the directory holding your .codework configuration; defaults to the shell's\",\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tArgument.optional,\n\t\t\t\t\t\t),\n\t\t\t\t\t\tunlink: Flag.Boolean(\"unlink\").pipe(\n\t\t\t\t\t\t\tFlag.withDescription(\"Clear the anchor, leaving the session with no host directory\"),\n\t\t\t\t\t\t\tFlag.withDefault(false),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tserver: RunningServer,\n\t\t\t\t\t},\n\t\t\t\t\texamples: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcommand: \"codework session link ses_01h9\",\n\t\t\t\t\t\t\tdescription: \"Link it to the directory you are standing in\",\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcommand: \"codework session link ses_01h9 ~/work/api\",\n\t\t\t\t\t\t\tdescription: \"Link it to a project elsewhere on this machine\",\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcommand: \"codework session link ses_01h9 --unlink\",\n\t\t\t\t\t\t\tdescription: \"Clear the anchor\",\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t}),\n\t\t\t\tSpec.make(\"relink\", {\n\t\t\t\t\tdescription: \"Move where a session's work, or one thread's, happens\",\n\t\t\t\t\tparams: {\n\t\t\t\t\t\tsession: Argument.String(\"session-id\").pipe(Argument.withDescription(\"The session to move\")),\n\t\t\t\t\t\tthread: Flag.String(\"thread\").pipe(\n\t\t\t\t\t\t\tFlag.withDescription(\n\t\t\t\t\t\t\t\t\"Move only this thread: a thread ID, or main; omitted moves the session's default\",\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tFlag.optional,\n\t\t\t\t\t\t),\n\t\t\t\t\t\tdirectory: Flag.String(\"directory\").pipe(\n\t\t\t\t\t\t\tFlag.withAlias(\"C\"),\n\t\t\t\t\t\t\tFlag.withDescription(\n\t\t\t\t\t\t\t\t\"Checkout to move into; the work keeps its position under it when that path exists there\",\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tFlag.optional,\n\t\t\t\t\t\t),\n\t\t\t\t\t\tsandboxId: Flag.String(\"sandbox-id\").pipe(\n\t\t\t\t\t\t\tFlag.withDescription(\"Sandbox instance to move to (default: local)\"),\n\t\t\t\t\t\t\tFlag.optional,\n\t\t\t\t\t\t),\n\t\t\t\t\t\tjson: JsonFlag,\n\t\t\t\t\t\tserver: RunningServer,\n\t\t\t\t\t},\n\t\t\t\t\texamples: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcommand: \"codework session relink ses_01h9 -C ~/work/api\",\n\t\t\t\t\t\t\tdescription: \"Move the session to a local checkout\",\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcommand: \"codework session relink ses_01h9 --thread thr_01ja --sandbox-id sbx_01k2\",\n\t\t\t\t\t\t\tdescription: \"Run one thread in a sandbox, leaving the others where they are\",\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t}),\n\t\t\t],\n\t\t}),\n\t\tSpec.make(\"thread\", {\n\t\t\tdescription: \"Manage a session's threads\",\n\t\t\tcommands: [\n\t\t\t\tSpec.make(\"list\", {\n\t\t\t\t\tdescription: \"List a session's threads, newest first\",\n\t\t\t\t\tparams: {\n\t\t\t\t\t\tsession: Argument.String(\"session-id\").pipe(Argument.withDescription(\"The session\")),\n\t\t\t\t\t\tjson: JsonFlag,\n\t\t\t\t\t\tserver: RunningServer,\n\t\t\t\t\t},\n\t\t\t\t\texamples: [{ command: \"codework thread list ses_01h9\", description: \"List the session's threads\" }],\n\t\t\t\t}),\n\t\t\t\tSpec.make(\"fork\", {\n\t\t\t\t\tdescription: \"Start a new thread from a committed entry of a thread's history\",\n\t\t\t\t\tparams: {\n\t\t\t\t\t\tsession: Argument.String(\"session-id\").pipe(Argument.withDescription(\"The session\")),\n\t\t\t\t\t\tthread: Flag.String(\"thread\").pipe(\n\t\t\t\t\t\t\tFlag.withDescription(\"Thread to fork: a thread ID, or main (default)\"),\n\t\t\t\t\t\t\tFlag.optional,\n\t\t\t\t\t\t),\n\t\t\t\t\t\tat: Flag.String(\"at\").pipe(Flag.withDescription(\"Keep history through this entry\"), Flag.optional),\n\t\t\t\t\t\tbefore: Flag.String(\"before\").pipe(\n\t\t\t\t\t\t\tFlag.withDescription(\"Keep history up to this user entry, and print its text to edit\"),\n\t\t\t\t\t\t\tFlag.optional,\n\t\t\t\t\t\t),\n\t\t\t\t\t\tjson: JsonFlag,\n\t\t\t\t\t\tserver: RunningServer,\n\t\t\t\t\t},\n\t\t\t\t\texamples: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcommand: \"codework thread fork ses_01h9 --at 01jb\",\n\t\t\t\t\t\t\tdescription: \"Continue the main thread's history through an entry in a new thread\",\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcommand: \"codework thread fork ses_01h9 --thread thr_01ja --before 01jc\",\n\t\t\t\t\t\t\tdescription: \"Branch just before a prompt, to send it again differently\",\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t}),\n\t\t\t],\n\t\t}),\n\t\tSpec.make(\"plugin\", {\n\t\t\tdescription: \"Manage plugins\",\n\t\t\tcommands: [\n\t\t\t\tSpec.make(\"add\", {\n\t\t\t\t\tdescription: \"Install a plugin and add it to a settings file\",\n\t\t\t\t\tparams: {\n\t\t\t\t\t\tpackage: Argument.String(\"package\").pipe(\n\t\t\t\t\t\t\tArgument.withDescription(\"Package spec, path, or file: URL\"),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tglobal: Flag.Boolean(\"global\").pipe(\n\t\t\t\t\t\t\tFlag.withAlias(\"g\"),\n\t\t\t\t\t\t\tFlag.withDescription(\"Write the user-wide settings file instead of this project's\"),\n\t\t\t\t\t\t\tFlag.withDefault(false),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tsession: Flag.String(\"session\").pipe(\n\t\t\t\t\t\t\tFlag.withDescription(\"Write the project a session is linked to, rather than this directory's\"),\n\t\t\t\t\t\t\tFlag.optional,\n\t\t\t\t\t\t),\n\t\t\t\t\t},\n\t\t\t\t\texamples: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcommand: \"codework plugin add @acme/codework-tool-proc@1.2.0\",\n\t\t\t\t\t\t\tdescription: \"Install a published plugin into this project's settings\",\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcommand: \"codework plugin add @acme/codework-tool-proc --session ses_01h9\",\n\t\t\t\t\t\t\tdescription: \"Write the project that session is linked to, from anywhere\",\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcommand: \"codework plugin add @acme/codework-tool-proc -g\",\n\t\t\t\t\t\t\tdescription: \"Install it for every project this user runs\",\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t}),\n\t\t\t\tSpec.make(\"install\", {\n\t\t\t\t\tdescription: \"Install every plugin the settings files name\",\n\t\t\t\t\tparams: {},\n\t\t\t\t\texamples: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcommand: \"codework plugin install\",\n\t\t\t\t\t\t\tdescription: \"Materialise what a fresh checkout already declares\",\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t}),\n\t\t\t\tSpec.make(\"list\", {\n\t\t\t\t\tdescription: \"List configured plugins and what each one resolved to\",\n\t\t\t\t\tparams: {\n\t\t\t\t\t\tverbose: Flag.Boolean(\"verbose\").pipe(\n\t\t\t\t\t\t\tFlag.withDescription(\"Show the message behind a failure, not only its reason\"),\n\t\t\t\t\t\t\tFlag.withDefault(false),\n\t\t\t\t\t\t),\n\t\t\t\t\t},\n\t\t\t\t\texamples: [{ command: \"codework plugin list\", description: \"Show every configured plugin\" }],\n\t\t\t\t}),\n\t\t\t\tSpec.make(\"check\", {\n\t\t\t\t\tdescription: \"Report which configured plugins have a newer revision available\",\n\t\t\t\t\tparams: {\n\t\t\t\t\t\tspec: Argument.String(\"spec\").pipe(\n\t\t\t\t\t\t\tArgument.withDescription(\"Only this configured plugin: a package name or spec, git spec, or path\"),\n\t\t\t\t\t\t\tArgument.optional,\n\t\t\t\t\t\t),\n\t\t\t\t\t\t// An answer is reused for an hour, which is right for a command someone may\n\t\t\t\t\t\t// run repeatedly and wrong for the minute after they pushed a plugin. Without\n\t\t\t\t\t\t// this there is no way to say \"ask again\", and `check` reports a moving branch\n\t\t\t\t\t\t// as current while `update` — which always refreshes — moves it.\n\t\t\t\t\t\trefresh: Flag.Boolean(\"refresh\").pipe(\n\t\t\t\t\t\t\tFlag.withDescription(\"Ask the remote again instead of reusing a recent answer\"),\n\t\t\t\t\t\t\tFlag.withDefault(false),\n\t\t\t\t\t\t),\n\t\t\t\t\t},\n\t\t\t\t\texamples: [\n\t\t\t\t\t\t{ command: \"codework plugin check\", description: \"Ask the registry what has moved\" },\n\t\t\t\t\t\t{ command: \"codework plugin check @acme/codework-tool-proc\", description: \"Ask about one plugin\" },\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcommand: \"codework plugin check --refresh\",\n\t\t\t\t\t\t\tdescription: \"Ignore the cached answer, after pushing a plugin\",\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t}),\n\t\t\t\tSpec.make(\"update\", {\n\t\t\t\t\tdescription: \"Fetch a newer revision of every plugin that has one\",\n\t\t\t\t\tparams: {\n\t\t\t\t\t\tspec: Argument.String(\"spec\").pipe(\n\t\t\t\t\t\t\tArgument.withDescription(\"Only this configured plugin: a package name or spec, git spec, or path\"),\n\t\t\t\t\t\t\tArgument.optional,\n\t\t\t\t\t\t),\n\t\t\t\t\t},\n\t\t\t\t\texamples: [\n\t\t\t\t\t\t{ command: \"codework plugin update\", description: \"Take whatever `check` found\" },\n\t\t\t\t\t\t{ command: \"codework plugin update @acme/codework-tool-proc\", description: \"Update one plugin\" },\n\t\t\t\t\t],\n\t\t\t\t}),\n\t\t\t\tSpec.make(\"reload\", {\n\t\t\t\t\tdescription: \"Re-import configured plugins in a running server\",\n\t\t\t\t\tparams: {\n\t\t\t\t\t\tserver: RunningServer,\n\t\t\t\t\t},\n\t\t\t\t\texamples: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcommand: \"codework plugin reload\",\n\t\t\t\t\t\t\tdescription: \"Pick up edits to a local plugin without restarting\",\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t}),\n\t\t\t\tSpec.make(\"remove\", {\n\t\t\t\t\tdescription: \"Remove a plugin from a settings file\",\n\t\t\t\t\tparams: {\n\t\t\t\t\t\tpackage: Argument.String(\"package\").pipe(\n\t\t\t\t\t\t\tArgument.withDescription(\"Configured package spec, path, or plugin ID\"),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tglobal: Flag.Boolean(\"global\").pipe(\n\t\t\t\t\t\t\tFlag.withAlias(\"g\"),\n\t\t\t\t\t\t\tFlag.withDescription(\"Edit the user-wide settings file instead of this project's\"),\n\t\t\t\t\t\t\tFlag.withDefault(false),\n\t\t\t\t\t\t),\n\t\t\t\t\t},\n\t\t\t\t\texamples: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcommand: \"codework plugin remove @acme/codework-tool-proc\",\n\t\t\t\t\t\t\tdescription: \"Drop a plugin and any configuration written against it\",\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t}),\n\t\t\t],\n\t\t}),\n\t\tSpec.make(\"models\", {\n\t\t\tdescription: \"List or refresh the model catalog\",\n\t\t\tparams: {\n\t\t\t\tprovider: Flag.String(\"provider\").pipe(Flag.withDescription(\"Model catalog provider ID\"), Flag.optional),\n\t\t\t},\n\t\t\texamples: [\n\t\t\t\t{ command: \"codework models\", description: \"List all models from all providers\" },\n\t\t\t\t{\n\t\t\t\t\tcommand: \"codework models --provider openai\",\n\t\t\t\t\tdescription: \"List models for a specific provider\",\n\t\t\t\t},\n\t\t\t\t{ command: \"codework models providers\", description: \"List all available provider IDs\" },\n\t\t\t],\n\t\t\tcommands: [\n\t\t\t\tSpec.make(\"providers\", {\n\t\t\t\t\tdescription: \"List available model providers in the catalog\",\n\t\t\t\t}),\n\t\t\t\tSpec.make(\"refresh\", {\n\t\t\t\t\tdescription: \"Download the model catalog into the home if it is stale\",\n\t\t\t\t\tparams: {\n\t\t\t\t\t\tforce: Flag.Boolean(\"force\").pipe(\n\t\t\t\t\t\t\tFlag.withDescription(\"Download it even if it is still fresh\"),\n\t\t\t\t\t\t\tFlag.withDefault(false),\n\t\t\t\t\t\t),\n\t\t\t\t\t},\n\t\t\t\t\texamples: [\n\t\t\t\t\t\t{ command: \"codework models refresh\", description: \"Refresh a catalog older than 15 minutes\" },\n\t\t\t\t\t\t{ command: \"codework models refresh --force\", description: \"Download the catalog now\" },\n\t\t\t\t\t],\n\t\t\t\t}),\n\t\t\t],\n\t\t}),\n\t\tSpec.make(\"acp\", {\n\t\t\tdescription: \"Start the CodeWork Agent Client Protocol (ACP) server over stdio\",\n\t\t\texamples: [{ command: \"codework acp\", description: \"Start the ACP server on stdio\" }],\n\t\t}),\n\t],\n});\n","import { Config, ConfigProvider, Effect, Layer, Metric, Option, References, Schema } from \"effect\";\nimport { FetchHttpClient } from \"effect/http\";\nimport { OtlpMetrics, OtlpSerialization, OtlpTracer } from \"effect/observability\";\nimport { uuidv7 } from \"uuidv7\";\n\n// Configured by the standard `OTEL_*` variables alone. A configuration that fails\n// to build runs the command without export rather than failing it.\n\n// The OTel spec defaults `OTEL_{TRACES,METRICS}_EXPORTER` to `otlp`; Effect reads an\n// unset list as none, so an endpoint alone would export nothing.\nconst exporterDefaults = ConfigProvider.layerAdd(\n\tConfigProvider.fromUnknown({ OTEL_TRACES_EXPORTER: [\"otlp\"], OTEL_METRICS_EXPORTER: [\"otlp\"] }),\n);\n\n// Effect's fiber metrics hook every fiber start and end, so they follow metrics export.\nconst metricsEnabled = Config.all({\n\tdisabled: Config.Boolean(\"OTEL_SDK_DISABLED\").pipe(Config.withDefault(false)),\n\tendpoint: Config.String(\"OTEL_EXPORTER_OTLP_METRICS_ENDPOINT\").pipe(\n\t\tConfig.orElse(() => Config.String(\"OTEL_EXPORTER_OTLP_ENDPOINT\")),\n\t\tConfig.option,\n\t),\n\texporters: Config.Array(Schema.String, \"OTEL_METRICS_EXPORTER\"),\n}).pipe(\n\tConfig.map(\n\t\t({ disabled, endpoint, exporters }) =>\n\t\t\t!disabled && Option.isSome(endpoint) && exporters.some((exporter) => exporter.trim().toLowerCase() === \"otlp\"),\n\t),\n);\n\nconst fiberMetrics = Layer.unwrap(\n\tEffect.gen(function* () {\n\t\treturn (yield* metricsEnabled) ? Metric.enableRuntimeMetricsLayer : Layer.empty;\n\t}),\n);\n\n// Only spans marked `level: \"Info\"` are exported; the rest, Effect's own `sql.*`\n// among them, default to `Debug`. Effect drops a span's children with it, so every\n// span on the path from a command to a model or tool call must be `Info`.\nconst levels = { all: \"All\", trace: \"Trace\", debug: \"Debug\", info: \"Info\", warn: \"Warn\", error: \"Error\" } as const;\n\nconst traceLevels = Layer.unwrap(\n\tEffect.gen(function* () {\n\t\tconst name = yield* Config.String(\"CODEWORK_TRACE_LEVEL\").pipe(Config.withDefault(\"info\"));\n\t\tconst minimum = levels[name.trim().toLowerCase() as keyof typeof levels] ?? \"Info\";\n\t\treturn Layer.mergeAll(\n\t\t\tLayer.succeed(References.CurrentTraceLevel, \"Debug\"),\n\t\t\tLayer.succeed(References.MinimumTraceLevel, minimum),\n\t\t);\n\t}),\n);\n\ninterface OtlpResource {\n\treadonly serviceName: string;\n\treadonly serviceVersion: string;\n\treadonly attributes: Record<string, string>;\n}\n\n// Effect has no gRPC exporter: `grpc` exports nothing rather than sending HTTP to a gRPC port.\nconst exporters = (resource: OtlpResource) =>\n\tLayer.unwrap(\n\t\tEffect.gen(function* () {\n\t\t\tconst protocol = yield* Config.String(\"OTEL_EXPORTER_OTLP_PROTOCOL\").pipe(Config.withDefault(\"http/protobuf\"));\n\t\t\tconst format = {\n\t\t\t\t\"http/json\": OtlpSerialization.layerJson,\n\t\t\t\t\"http/protobuf\": OtlpSerialization.layerProtobuf,\n\t\t\t}[protocol.trim().toLowerCase()];\n\t\t\tif (format === undefined) return Layer.empty;\n\t\t\treturn Layer.mergeAll(\n\t\t\t\tOtlpTracer.layerFromConfig({ resource }),\n\t\t\t\tOtlpMetrics.layerFromConfig({ resource }),\n\t\t\t).pipe(Layer.provide(format));\n\t\t}),\n\t);\n\nconst channel = (version: string) =>\n\tversion.includes(\"-canary.\") ? \"canary\" : version.includes(\"-dev.\") ? \"dev\" : \"latest\";\n\nconst instanceId = uuidv7();\n\nexport const layer = (options: { readonly version: string; readonly command: string }) => {\n\tconst resource: OtlpResource = {\n\t\tserviceName: \"codework\",\n\t\tserviceVersion: options.version,\n\t\tattributes: {\n\t\t\t\"service.instance.id\": instanceId,\n\t\t\t\"deployment.environment.name\": channel(options.version),\n\t\t\t\"codework.command\": options.command,\n\t\t},\n\t};\n\treturn Layer.mergeAll(exporters(resource), fiberMetrics, traceLevels).pipe(\n\t\tLayer.provide(FetchHttpClient.layer),\n\t\tLayer.provide(exporterDefaults),\n\t\tLayer.catchCause(() => Layer.empty),\n\t);\n};\n","import { Effect } from \"effect\";\nimport { Command } from \"effect/cli\";\nimport type { CommandError } from \"../cli/error.ts\";\nimport * as Otel from \"./otel.ts\";\nimport * as Spec from \"./spec.ts\";\n\n/**\n * Binds handlers to a {@link Spec} tree. Handlers are loaded through dynamic\n * imports so that starting the process -- or printing `--help` -- never pulls in\n * the harness, its sandbox drivers, or the model catalog.\n */\n\n/** Recovers the parsed input type of a spec node, for typing its handler. */\nexport type Input<Value> =\n\tValue extends Spec.Node<infer _Name, infer Spec, infer _Commands>\n\t\t? Input<Spec>\n\t\t: Value extends Command.Command<infer _Name, infer Parsed, infer _Context, infer _Error, infer _Requirements>\n\t\t\t? Parsed\n\t\t\t: never;\n\n/**\n * A handler may yield an ancestor's spec to read its shared flags, which shows up\n * as a `CommandContext` requirement; `withSubcommands` discharges it when the tree\n * is assembled.\n */\ntype Requirements = Command.Environment | Command.CommandContext<string>;\ntype Run<Parsed> = (input: Parsed) => Effect.Effect<void, CommandError, Requirements>;\ntype Loader<Node extends Spec.Any> = () => Promise<{ readonly default: Run<Input<Node>> }>;\n\n/**\n * The handler registry for a spec tree: a loader per leaf, mirroring the shape of\n * the tree. A parent with children takes its own handler under `$`.\n */\nexport type Handlers<Node extends Spec.Any> = keyof Node[\"commands\"] extends never\n\t? Loader<Node>\n\t: { readonly $?: Loader<Node> } & { readonly [Key in keyof Node[\"commands\"]]: Handlers<Node[\"commands\"][Key]> };\n\ninterface LazyHandler {\n\treadonly spec: Command.Command.Any;\n\t// biome-ignore lint/suspicious/noExplicitAny: input is recovered per-command by `Input`\n\treadonly load: () => Promise<{ readonly default: Run<any> }>;\n}\n\ntype LazyHandlers = LazyHandler[\"load\"] | { readonly [key: string]: LazyHandlers | undefined };\n\ntype ProvidedCommand = Command.Command<string, unknown, unknown, never, Command.Environment>;\n\n/** Type-checks a handler against the spec node it implements. */\nexport function handler<const Node extends Spec.Any>(_node: Node, run: Run<Input<Node>>) {\n\treturn run;\n}\n\nexport function handlers<const Root extends Spec.Any>(\n\troot: Root,\n\thandlers: Handlers<Root>,\n): ReadonlyArray<LazyHandler> {\n\tconst result: LazyHandler[] = [];\n\n\tfunction add(node: Spec.Any, value: LazyHandlers) {\n\t\tif (typeof value === \"function\") {\n\t\t\tresult.push({ spec: node.spec, load: value });\n\t\t\treturn;\n\t\t}\n\t\tif (value.$ !== undefined) result.push({ spec: node.spec, load: value.$ as LazyHandler[\"load\"] });\n\t\tfor (const [name, child] of Object.entries(node.commands)) {\n\t\t\tconst nested = value[name];\n\t\t\tif (nested !== undefined) add(child, nested);\n\t\t}\n\t}\n\n\tadd(root, handlers as LazyHandlers);\n\treturn result;\n}\n\nexport function run(root: Spec.Any, handlers: ReadonlyArray<LazyHandler>, options: { readonly version: string }) {\n\treturn Command.run(provide(root, handlers, { version: options.version, path: [] }), options);\n}\n\nfunction provide(\n\tnode: Spec.Any,\n\thandlers: ReadonlyArray<LazyHandler>,\n\tcontext: { readonly version: string; readonly path: ReadonlyArray<string> },\n): ProvidedCommand {\n\tconst found = handlers.find((entry) => entry.spec === node.spec);\n\tconst command = context.path.length === 0 ? node.name : context.path.join(\" \");\n\tconst spec = found\n\t\t? node.spec.pipe(\n\t\t\t\tCommand.withHandler((input) =>\n\t\t\t\t\tEffect.promise(found.load).pipe(\n\t\t\t\t\t\tEffect.flatMap((module) => module.default(input)),\n\t\t\t\t\t\t// Rendered here, so a handler's own failure prints as `error:` instead of reaching the\n\t\t\t\t\t\t// runtime's logger with a stack. Imported on failure: the renderer pulls in the harness.\n\t\t\t\t\t\tEffect.catch((error) =>\n\t\t\t\t\t\t\tEffect.promise(() => import(\"../cli/error.ts\")).pipe(\n\t\t\t\t\t\t\t\tEffect.flatMap((module) => module.reportFailure(error)),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tEffect.provide(Otel.layer({ version: context.version, command })),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t)\n\t\t: node.spec;\n\tconst children = Object.values(node.commands);\n\tif (children.length === 0) return spec as ProvidedCommand;\n\treturn spec.pipe(\n\t\tCommand.withSubcommands(\n\t\t\tchildren.map((child) => provide(child, handlers, { ...context, path: [...context.path, child.name] })),\n\t\t),\n\t) as ProvidedCommand;\n}\n"],"mappings":";;;;;;;AAkDA,SAAgB,KAKd,MAAY,UAA6C,CAAC,GAAG;CAC9D,IAAI,OAAO,QAAQ,KAAK,MAAM,QAAQ,UAAW,CAAC,CAAY,CAAC,CAAC,KAC/D,QAAQ,gBAAgB,QAAQ,UAAW,CAAC,CAAY,CACzD;CACA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