@codeworksh/cli 0.6.0 → 0.7.0-canary.116.1.ga7e3ef29
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-Dr7BPHDK.mjs → acp-Bf_bcW39.mjs} +4 -4
- package/{acp-Dr7BPHDK.mjs.map → acp-Bf_bcW39.mjs.map} +1 -1
- package/{add-CzFz-Mfb.mjs → add-CGjQkVRs.mjs} +5 -5
- package/{add-CzFz-Mfb.mjs.map → add-CGjQkVRs.mjs.map} +1 -1
- package/{add-fJlj0O2v.mjs → add-DArbv6Op.mjs} +4 -4
- package/{add-fJlj0O2v.mjs.map → add-DArbv6Op.mjs.map} +1 -1
- package/{catalog-DCjYMhro.mjs → catalog-XfqtqMDz.mjs} +2 -2
- package/{catalog-DCjYMhro.mjs.map → catalog-XfqtqMDz.mjs.map} +1 -1
- package/{check-7oL3UVdX.mjs → check-BRHzx5p0.mjs} +4 -4
- package/{check-7oL3UVdX.mjs.map → check-BRHzx5p0.mjs.map} +1 -1
- package/{control-Bd2G-Unk.mjs → control-F0bo3rXh.mjs} +5 -5
- package/{control-Bd2G-Unk.mjs.map → control-F0bo3rXh.mjs.map} +1 -1
- package/disconnect-DemFNh2P.mjs +2 -0
- package/{entries-hMxcOaPm.mjs → entries-DnbFTTLU.mjs} +3 -3
- package/{entries-hMxcOaPm.mjs.map → entries-DnbFTTLU.mjs.map} +1 -1
- package/{error-BVSfzBzb.mjs → error--BWou73I.mjs} +141 -3
- package/error--BWou73I.mjs.map +1 -0
- package/{fork-BtL-68qs.mjs → fork-DlhNFPUB.mjs} +4 -4
- package/{fork-BtL-68qs.mjs.map → fork-DlhNFPUB.mjs.map} +1 -1
- package/{identity-D2pOA6eh.mjs → identity-8WAptgI_.mjs} +2 -2
- package/{identity-D2pOA6eh.mjs.map → identity-8WAptgI_.mjs.map} +1 -1
- package/index.mjs +34 -35
- package/index.mjs.map +1 -1
- package/{install-Dqx1TWtz.mjs → install-DRJ5KKyb.mjs} +4 -4
- package/{install-Dqx1TWtz.mjs.map → install-DRJ5KKyb.mjs.map} +1 -1
- package/{jsonc-BwztMdEB.mjs → jsonc-Cel7I0yd.mjs} +2 -2
- package/{jsonc-BwztMdEB.mjs.map → jsonc-Cel7I0yd.mjs.map} +1 -1
- package/{link-BilIb5jN.mjs → link-CJE1PRTf.mjs} +3 -3
- package/{link-BilIb5jN.mjs.map → link-CJE1PRTf.mjs.map} +1 -1
- package/{list-BUPm4Bsu.mjs → list-B3kSn78f.mjs} +4 -4
- package/{list-BUPm4Bsu.mjs.map → list-B3kSn78f.mjs.map} +1 -1
- package/{list-DV3VGuTp.mjs → list-Cf-zESJf.mjs} +4 -4
- package/{list-DV3VGuTp.mjs.map → list-Cf-zESJf.mjs.map} +1 -1
- package/{list-D1sa8t4P.mjs → list-Df4ngZjL.mjs} +4 -4
- package/{list-D1sa8t4P.mjs.map → list-Df4ngZjL.mjs.map} +1 -1
- package/{list-BdMdlBjQ.mjs → list-TLhgvlKp.mjs} +3 -3
- package/{list-BdMdlBjQ.mjs.map → list-TLhgvlKp.mjs.map} +1 -1
- package/{login-COjr-kTw.mjs → login-BJ3d7FM_.mjs} +4 -4
- package/{login-COjr-kTw.mjs.map → login-BJ3d7FM_.mjs.map} +1 -1
- package/{login-DC6bw2pG.mjs → login-oWLqnAQK.mjs} +4 -4
- package/{login-DC6bw2pG.mjs.map → login-oWLqnAQK.mjs.map} +1 -1
- package/{logout-CfyRsTUE.mjs → logout-ClrNQ8LO.mjs} +4 -4
- package/{logout-CfyRsTUE.mjs.map → logout-ClrNQ8LO.mjs.map} +1 -1
- package/{logout-D02BdsX6.mjs → logout-D44pgH6b.mjs} +4 -4
- package/{logout-D02BdsX6.mjs.map → logout-D44pgH6b.mjs.map} +1 -1
- package/package-Be19GRQs.mjs +6 -0
- package/package-Be19GRQs.mjs.map +1 -0
- package/package.json +3 -4
- package/{providers-8XcCtqG7.mjs → providers-ozcPo-AJ.mjs} +4 -4
- package/{providers-8XcCtqG7.mjs.map → providers-ozcPo-AJ.mjs.map} +1 -1
- package/reconnect-BcJtQx3U.mjs +2 -0
- package/{refresh-zDPc39tX.mjs → refresh-B6iT5eWN.mjs} +4 -4
- package/{refresh-zDPc39tX.mjs.map → refresh-B6iT5eWN.mjs.map} +1 -1
- package/{refresh-CPt2ua-n.mjs → refresh-CH7lLrF3.mjs} +4 -4
- package/{refresh-CPt2ua-n.mjs.map → refresh-CH7lLrF3.mjs.map} +1 -1
- package/{relink-Cr5T6W7K.mjs → relink-BvrynRLV.mjs} +4 -4
- package/{relink-Cr5T6W7K.mjs.map → relink-BvrynRLV.mjs.map} +1 -1
- package/{reload-xhRj21Ic.mjs → reload-qYk-KlpL.mjs} +3 -3
- package/{reload-xhRj21Ic.mjs.map → reload-qYk-KlpL.mjs.map} +1 -1
- package/{remove-DRBU8YfV.mjs → remove-Be5ytOgR.mjs} +4 -4
- package/{remove-DRBU8YfV.mjs.map → remove-Be5ytOgR.mjs.map} +1 -1
- package/{remove-BuO_0yjy.mjs → remove-CTzOWKTq.mjs} +5 -5
- package/{remove-BuO_0yjy.mjs.map → remove-CTzOWKTq.mjs.map} +1 -1
- package/{restart-B7TyHczC.mjs → restart-Dhrm8aBK.mjs} +4 -4
- package/{restart-B7TyHczC.mjs.map → restart-Dhrm8aBK.mjs.map} +1 -1
- package/{run-B3acSsVy.mjs → run-BX65GBq_.mjs} +4 -4
- package/{run-B3acSsVy.mjs.map → run-BX65GBq_.mjs.map} +1 -1
- package/{runtime-CwoLsQy7.mjs → runtime-CK2CunDw.mjs} +3 -18
- package/runtime-CK2CunDw.mjs.map +1 -0
- package/serve-DebGAHcM.mjs +1208 -0
- package/serve-DebGAHcM.mjs.map +1 -0
- package/{service-ClAs3abW.mjs → service-CChQUPxf.mjs} +8 -32
- package/service-CChQUPxf.mjs.map +1 -0
- package/{settings-Ct8kxLeD.mjs → settings-BzAk8lIo.mjs} +3 -3
- package/{settings-Ct8kxLeD.mjs.map → settings-BzAk8lIo.mjs.map} +1 -1
- package/{shared-CfaUYDk4.mjs → shared-BU8-Q5m8.mjs} +3 -3
- package/{shared-CfaUYDk4.mjs.map → shared-BU8-Q5m8.mjs.map} +1 -1
- package/{shared-5A9FR7Lo.mjs → shared-BnR3BFZM.mjs} +4 -4
- package/{shared-5A9FR7Lo.mjs.map → shared-BnR3BFZM.mjs.map} +1 -1
- package/{start-BPmacHoA.mjs → start-sg_R6Qmo.mjs} +4 -4
- package/{start-BPmacHoA.mjs.map → start-sg_R6Qmo.mjs.map} +1 -1
- package/{status-DDhz93PH.mjs → status-B-AAul1G.mjs} +4 -4
- package/{status-DDhz93PH.mjs.map → status-B-AAul1G.mjs.map} +1 -1
- package/{status-D6fIgnPp.mjs → status-BUGXzdh_.mjs} +4 -4
- package/{status-D6fIgnPp.mjs.map → status-BUGXzdh_.mjs.map} +1 -1
- package/{stop-DuDxGUsn.mjs → stop-B7SfRjDB.mjs} +4 -4
- package/{stop-DuDxGUsn.mjs.map → stop-B7SfRjDB.mjs.map} +1 -1
- package/{thread-skUkybyv.mjs → thread-BuNept5V.mjs} +2 -2
- package/{thread-skUkybyv.mjs.map → thread-BuNept5V.mjs.map} +1 -1
- package/{update-oK_209iL.mjs → update-DoS5AWg6.mjs} +4 -4
- package/{update-oK_209iL.mjs.map → update-DoS5AWg6.mjs.map} +1 -1
- package/disconnect-Dpt7LKVl.mjs +0 -2
- package/error-BVSfzBzb.mjs.map +0 -1
- package/package-D1wDsLSU.mjs +0 -6
- package/package-D1wDsLSU.mjs.map +0 -1
- package/reconnect-C4KrnFkT.mjs +0 -2
- package/runtime-CwoLsQy7.mjs.map +0 -1
- package/serve-CiiD_6i6.mjs +0 -488
- package/serve-CiiD_6i6.mjs.map +0 -1
- package/service-ClAs3abW.mjs.map +0 -1
- package/tui-Dp9hUjng.mjs +0 -76
- package/tui-Dp9hUjng.mjs.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as InvalidInputError } from "./error
|
|
1
|
+
import { t as InvalidInputError } from "./error--BWou73I.mjs";
|
|
2
2
|
import { Effect, FileSystem, Path } from "effect";
|
|
3
3
|
import { Plugin } from "@codeworksh/harness/effect";
|
|
4
4
|
import { applyEdits, modify, parse } from "jsonc-parser";
|
|
@@ -55,4 +55,4 @@ const locked = (path, edit) => Effect.gen(function* () {
|
|
|
55
55
|
//#endregion
|
|
56
56
|
export { read as n, write as r, locked as t };
|
|
57
57
|
|
|
58
|
-
//# sourceMappingURL=jsonc-
|
|
58
|
+
//# sourceMappingURL=jsonc-Cel7I0yd.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jsonc-
|
|
1
|
+
{"version":3,"file":"jsonc-Cel7I0yd.mjs","names":["parseJsonc"],"sources":["../../src/cli/jsonc.ts"],"sourcesContent":["import { Plugin } from \"@codeworksh/harness/effect\";\nimport { Effect, FileSystem, Path } from \"effect\";\nimport { applyEdits, modify, parse as parseJsonc, type ParseError } from \"jsonc-parser\";\nimport { InvalidInputError } from \"./error.ts\";\n\n/**\n * Reading and rewriting one value of a JSONC file the CLI edits for its owner: `settings.jsonc`,\n * `mcp.json`.\n *\n * Edits go through `jsonc-parser`, so a hand-written file keeps its comments, key order and\n * formatting. The write is a temp file renamed over the original, so an interrupted run leaves the\n * previous file intact rather than a half-written document.\n */\n\n/** The file's text and its top-level object; a missing file reads as `{}`. */\nexport const read = Effect.fn(\"CLI.jsonc.read\")(function* (path: string, what: string) {\n\tconst fs = yield* FileSystem.FileSystem;\n\tconst source = (yield* fs.exists(path)) ? yield* fs.readFileString(path) : \"{}\";\n\tconst errors: ParseError[] = [];\n\tconst document: unknown = parseJsonc(source, errors, { allowTrailingComma: true });\n\tif (errors.length > 0 || typeof document !== \"object\" || document === null || Array.isArray(document)) {\n\t\treturn yield* new InvalidInputError({ message: `${path} is not a valid ${what}` });\n\t}\n\treturn { source, document: document as Record<string, unknown> };\n});\n\n/** Set the value at `at` in `source`, or remove it when `value` is undefined, and write the file. */\nexport const write = Effect.fn(\"CLI.jsonc.write\")(function* (\n\tpath: string,\n\tsource: string,\n\tat: ReadonlyArray<string>,\n\tvalue: unknown,\n) {\n\tconst fs = yield* FileSystem.FileSystem;\n\tconst nodePath = yield* Path.Path;\n\t// A removal is not formatted: the formatter would reflow the sibling before it as well.\n\tconst edited = applyEdits(\n\t\tsource,\n\t\tmodify(\n\t\t\tsource,\n\t\t\t[...at],\n\t\t\tvalue,\n\t\t\tvalue === undefined ? {} : { formattingOptions: { tabSize: 2, insertSpaces: false } },\n\t\t),\n\t);\n\tconst directory = nodePath.dirname(path);\n\tyield* fs.makeDirectory(directory, { recursive: true });\n\tconst mode = (yield* fs.exists(path)) ? (yield* fs.stat(path)).mode & 0o777 : 0o600;\n\tconst temporary = yield* fs.makeTempFile({ directory, prefix: `.${nodePath.basename(path)}.`, suffix: \".tmp\" });\n\tyield* fs\n\t\t.writeFileString(temporary, edited.endsWith(\"\\n\") ? edited : `${edited}\\n`)\n\t\t.pipe(\n\t\t\tEffect.andThen(fs.chmod(temporary, mode)),\n\t\t\tEffect.andThen(fs.rename(temporary, path)),\n\t\t\tEffect.ensuring(fs.remove(temporary, { force: true }).pipe(Effect.ignore)),\n\t\t);\n});\n\n/**\n * Serialize one read-modify-rename of `path` across CLI processes. Only the local edit is locked, so\n * work that precedes it does not wait behind another process.\n */\nexport const locked = <A, E, R>(path: string, edit: Effect.Effect<A, E, R>) =>\n\tEffect.gen(function* () {\n\t\tconst fs = yield* FileSystem.FileSystem;\n\t\tconst nodePath = yield* Path.Path;\n\t\tyield* fs.makeDirectory(nodePath.dirname(path), { recursive: true });\n\t\tyield* Plugin.settingsLock(\n\t\t\t`${path}.lock`,\n\t\t\t() => new InvalidInputError({ message: `timed out waiting to edit ${path}` }),\n\t\t);\n\t\treturn yield* edit;\n\t}).pipe(Effect.scoped);\n\nexport * as Jsonc from \"./jsonc.ts\";\n"],"mappings":";;;;;;;;;;;;;;AAeA,MAAa,OAAO,OAAO,GAAG,gBAA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zC,OAAO,SAAS,GAAG,OAAO,WAAW,EAAE,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,OAAO,MAAM,CAAC,CAC1E;AACF,CAAC;;;;;AAMD,MAAa,UAAmB,MAAc,SAC7C,OAAO,IAAI,aAAa;CACvB,MAAM,KAAK,OAAO,WAAW;CAC7B,MAAM,WAAW,OAAO,KAAK;CAC7B,OAAO,GAAG,cAAc,SAAS,QAAQ,IAAI,GAAG,EAAE,WAAW,KAAK,CAAC;CACnE,OAAO,OAAO,aACb,GAAG,KAAK,cACF,IAAI,kBAAkB,EAAE,SAAS,6BAA6B,OAAO,CAAC,CAC7E;CACA,OAAO,OAAO;AACf,CAAC,CAAC,CAAC,KAAK,OAAO,MAAM"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as Cmd, t as handler } from "./runtime-
|
|
2
|
-
import { f as writeOut, i as reportFailure, m as make, p as layer } from "./error
|
|
1
|
+
import { i as Cmd, t as handler } from "./runtime-CK2CunDw.mjs";
|
|
2
|
+
import { f as writeOut, i as reportFailure, m as make, p as layer } from "./error--BWou73I.mjs";
|
|
3
3
|
import { Effect, Option, Path } from "effect";
|
|
4
4
|
import { Session } from "@codeworksh/harness/effect";
|
|
5
5
|
//#region src/cli/cmd/handlers/session/link.ts
|
|
@@ -38,4 +38,4 @@ var link_default = handler(Cmd.commands.session.commands.link, Effect.fn("CLI.se
|
|
|
38
38
|
//#endregion
|
|
39
39
|
export { link_default as default };
|
|
40
40
|
|
|
41
|
-
//# sourceMappingURL=link-
|
|
41
|
+
//# sourceMappingURL=link-CJE1PRTf.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"link-
|
|
1
|
+
{"version":3,"file":"link-CJE1PRTf.mjs","names":["Runtime.handler","Client.make","Client.layer"],"sources":["../../src/cli/cmd/handlers/session/link.ts"],"sourcesContent":["import { Session } from \"@codeworksh/harness/effect\";\nimport { Effect, Option, Path } from \"effect\";\nimport { Runtime } from \"../../../../framework/runtime.ts\";\nimport { reportFailure } from \"../../../error.ts\";\nimport { writeOut } from \"../../../output.ts\";\nimport { Client } from \"../../../../server/client.ts\";\nimport { Cmd } from \"../../cmd.ts\";\n\n/**\n * Sets `hostDir` on an existing session.\n *\n * **The session ID identifies it; the path is the target.** A project cannot identify a session --\n * it may have many or none, and it is the session that carries the field.\n *\n * The path defaults to the shell's directory, which is both the common case (you are standing in\n * the project you want to link) and safe to default: the CLI runs on the host, so the trust\n * question about naming host paths is about remote clients, not about a local shell's own cwd.\n *\n * Not `session relink`, which moves a session to another checkout of the same project. Different\n * axes -- `relink` changes where the *work* happens, `link` changes which host directory the\n * session is *anchored to* -- and conflating them would recreate the confusion the two names\n * exist to avoid.\n *\n * The anchor is not a settings mechanism. Settings discovery reads it, so do plugin installs, and\n * so will whatever needs a host-side directory next; naming any one of them in the description is\n * what made this read like a settings flag.\n */\nexport default Runtime.handler(\n\tCmd.commands.session.commands.link,\n\tEffect.fn(\"CLI.session.link\")(function* ({ session, path, unlink, server }) {\n\t\tconst program = Effect.gen(function* () {\n\t\t\tconst nodePath = yield* Path.Path;\n\t\t\tconst rpc = yield* Client.make;\n\t\t\tconst sessionId = Session.SessionSchema.ID.make(session);\n\t\t\tconst hostDir = unlink\n\t\t\t\t? undefined\n\t\t\t\t: Session.AbsolutePath.make(nodePath.resolve(Option.getOrElse(path, () => \".\")));\n\n\t\t\tconst info = yield* rpc[\"session.link\"]({\n\t\t\t\tsessionId,\n\t\t\t\t...(hostDir === undefined ? {} : { hostDir }),\n\t\t\t});\n\t\t\t// Settings are re-read every exchange, so this applies at the next one: no reload, no\n\t\t\t// restart, the project layer simply starts or stops being read.\n\t\t\tyield* writeOut(\n\t\t\t\tinfo.hostDir === undefined\n\t\t\t\t\t? `Unlinked ${info.id}; it now reads the user settings alone.\\n`\n\t\t\t\t\t: `Linked ${info.id} to ${info.hostDir}\\n`,\n\t\t\t);\n\t\t});\n\n\t\treturn yield* program.pipe(Effect.provide(Client.layer(server)), Effect.scoped, Effect.catch(reportFailure));\n\t}),\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AA2BA,IAAA,eAAeA,QACd,IAAI,SAAS,QAAQ,SAAS,MAC9B,OAAO,GAAG,kBAAkB,CAAC,CAAC,WAAW,EAAE,SAAS,MAAM,QAAQ,UAAU;CAsB3E,OAAO,OArBS,OAAO,IAAI,aAAa;EACvC,MAAM,WAAW,OAAO,KAAK;EAC7B,MAAM,MAAM,OAAOC;EACnB,MAAM,YAAY,QAAQ,cAAc,GAAG,KAAK,OAAO;EACvD,MAAM,UAAU,SACb,KAAA,IACA,QAAQ,aAAa,KAAK,SAAS,QAAQ,OAAO,UAAU,YAAY,GAAG,CAAC,CAAC;EAEhF,MAAM,OAAO,OAAO,IAAI,eAAe,CAAC;GACvC;GACA,GAAI,YAAY,KAAA,IAAY,CAAC,IAAI,EAAE,QAAQ;EAC5C,CAAC;EAGD,OAAO,SACN,KAAK,YAAY,KAAA,IACd,YAAY,KAAK,GAAG,6CACpB,UAAU,KAAK,GAAG,MAAM,KAAK,QAAQ,GACzC;CACD,CAEoB,CAAC,CAAC,KAAK,OAAO,QAAQC,MAAa,MAAM,CAAC,GAAG,OAAO,QAAQ,OAAO,MAAM,aAAa,CAAC;AAC5G,CAAC,CACF"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { i as Cmd, t as handler } from "./runtime-
|
|
2
|
-
import { f as writeOut, i as reportFailure } from "./error
|
|
3
|
-
import { n as configured, r as describe, t as MARKS } from "./shared-
|
|
1
|
+
import { i as Cmd, t as handler } from "./runtime-CK2CunDw.mjs";
|
|
2
|
+
import { f as writeOut, i as reportFailure } from "./error--BWou73I.mjs";
|
|
3
|
+
import { n as configured, r as describe, t as MARKS } from "./shared-BnR3BFZM.mjs";
|
|
4
4
|
import { Effect, Layer, References } from "effect";
|
|
5
5
|
import { Database, Event, Mcp } from "@codeworksh/harness/effect";
|
|
6
6
|
//#region src/cli/cmd/handlers/mcp/list.ts
|
|
@@ -68,4 +68,4 @@ var list_default = handler(Cmd.commands.mcp.commands.list, Effect.fn("CLI.mcp.li
|
|
|
68
68
|
//#endregion
|
|
69
69
|
export { list_default as default };
|
|
70
70
|
|
|
71
|
-
//# sourceMappingURL=list-
|
|
71
|
+
//# sourceMappingURL=list-B3kSn78f.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list-
|
|
1
|
+
{"version":3,"file":"list-B3kSn78f.mjs","names":["Runtime.handler"],"sources":["../../src/cli/cmd/handlers/mcp/list.ts"],"sourcesContent":["/* @effect-diagnostics preferSchemaOverJson:off -- `--json` prints the report as it is built. */\nimport { Database, Event, type EventList, Mcp } from \"@codeworksh/harness/effect\";\nimport { Effect, Layer, References } from \"effect\";\nimport { Runtime } from \"../../../../framework/runtime.ts\";\nimport { reportFailure } from \"../../../error.ts\";\nimport { writeOut } from \"../../../output.ts\";\nimport { Cmd } from \"../../cmd.ts\";\nimport { configured, describe, MARKS } from \"./shared.ts\";\n\ninterface Report {\n\treadonly name: string;\n\treadonly level: \"user\" | \"project\";\n\treadonly file: string;\n\t/** The project `mcp.json` that overrides `enabled` or exposure of this user server. */\n\treadonly override?: string;\n\treadonly enabled: boolean;\n\treadonly exposure: string;\n\treadonly transport: string;\n\treadonly state: Mcp.State;\n\treadonly tools: ReadonlyArray<string>;\n\t/** Tools it listed that were left out because the MCP SDK rejects them. */\n\treadonly skipped?: EventList.McpSkipped;\n\t/** Tools whose exposure differs from the server's, from `toolExposure`. */\n\treadonly toolExposure?: Record<string, string>;\n\t/** Whether the server offers resources. They are not listed: listing every one can take long. */\n\treadonly resources?: true;\n\treadonly error?: string;\n}\n\nexport default Runtime.handler(\n\tCmd.commands.mcp.commands.list,\n\tEffect.fn(\"CLI.mcp.list\")(function* ({ json }) {\n\t\tconst program = Effect.gen(function* () {\n\t\t\tconst { home, authFile, hostCwd, root, user, servers, errors } = yield* configured();\n\t\t\t// Every connect problem is in the report; the service's own logs would only repeat it.\n\t\t\tconst statuses = yield* Mcp.check({\n\t\t\t\tservers: servers.map((server) => [server.name, server.config] as const),\n\t\t\t\tdirectory: hostCwd,\n\t\t\t\thostDir: root ?? hostCwd,\n\t\t\t}).pipe(\n\t\t\t\t// Status events need an event service; nothing reads them here, so it keeps them in memory.\n\t\t\t\tEffect.provide(\n\t\t\t\t\tMcp.layer({ hostCwd, home, authFile }).pipe(\n\t\t\t\t\t\tLayer.provide(Event.layer.pipe(Layer.provide(Database.layer(\":memory:\")))),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tEffect.provideService(References.MinimumLogLevel, \"None\"),\n\t\t\t);\n\t\t\tconst reports = servers.map((server): Report => {\n\t\t\t\tconst { config } = server;\n\t\t\t\tconst status = statuses.find((one) => one.server === server.name);\n\t\t\t\tconst exposure = config.exposure ?? \"direct\";\n\t\t\t\tconst tools = status?.tools ?? [];\n\t\t\t\tconst overrides = tools.filter((tool) => tool.exposure !== exposure);\n\t\t\t\tconst state = status?.state ?? \"disabled\";\n\t\t\t\treturn {\n\t\t\t\t\tname: server.name,\n\t\t\t\t\tlevel: server.file === user ? \"user\" : \"project\",\n\t\t\t\t\tfile: server.file,\n\t\t\t\t\t...(server.override === undefined ? {} : { override: server.override }),\n\t\t\t\t\tenabled: config.enabled !== false,\n\t\t\t\t\texposure,\n\t\t\t\t\ttransport: \"url\" in config ? config.url : [config.command, ...(config.args ?? [])].join(\" \"),\n\t\t\t\t\tstate,\n\t\t\t\t\ttools: tools.map((tool) => tool.name),\n\t\t\t\t\t...(status?.skipped === undefined ? {} : { skipped: status.skipped }),\n\t\t\t\t\t...(overrides.length === 0\n\t\t\t\t\t\t? {}\n\t\t\t\t\t\t: { toolExposure: Object.fromEntries(overrides.map((tool) => [tool.name, tool.exposure])) }),\n\t\t\t\t\t...(status?.resources ? { resources: true as const } : {}),\n\t\t\t\t\t...(state !== \"connected\" && status?.error !== undefined ? { error: status.error } : {}),\n\t\t\t\t};\n\t\t\t});\n\t\t\tconst failed = errors.length > 0 || reports.some((report) => report.enabled && report.state !== \"connected\");\n\t\t\tif (failed)\n\t\t\t\tyield* Effect.sync(() => {\n\t\t\t\t\tprocess.exitCode = 1;\n\t\t\t\t});\n\n\t\t\tif (json) return yield* writeOut(`${JSON.stringify({ servers: reports, errors }, null, 2)}\\n`);\n\t\t\tconst lines: string[] = [];\n\t\t\tif (reports.length === 0 && errors.length === 0)\n\t\t\t\tlines.push(`No MCP servers configured. Add them to ${user} or .codework/mcp.json.`);\n\t\t\tconst width = Math.max(0, ...reports.map((report) => report.name.length));\n\t\t\tfor (const report of reports) {\n\t\t\t\tlines.push(\n\t\t\t\t\t`${MARKS[report.state]} ${report.name.padEnd(width)} ${describe(report.state, report.tools.length, report.skipped)} (${report.exposure}, ${report.level})`,\n\t\t\t\t);\n\t\t\t\tconst detail = (line: string) => lines.push(` ${line}`);\n\t\t\t\tdetail(report.transport);\n\t\t\t\tif (report.override !== undefined) detail(`project override: ${report.override}`);\n\t\t\t\tif (report.tools.length > 0)\n\t\t\t\t\tdetail(\n\t\t\t\t\t\t`tools: ${report.tools\n\t\t\t\t\t\t\t.map((tool) => {\n\t\t\t\t\t\t\t\tconst exposure = report.toolExposure?.[tool];\n\t\t\t\t\t\t\t\treturn exposure === undefined ? tool : `${tool} [${exposure}]`;\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t.join(\", \")}`,\n\t\t\t\t\t);\n\t\t\t\tif (report.resources) detail(\"offers resources\");\n\t\t\t\tif (report.error !== undefined) for (const line of report.error.split(\"\\n\")) detail(line);\n\t\t\t}\n\t\t\tfor (const error of errors) lines.push(`config error: ${error}`);\n\t\t\tyield* writeOut(`${lines.join(\"\\n\")}\\n`);\n\t\t});\n\t\treturn yield* program.pipe(Effect.catch(reportFailure));\n\t}),\n);\n"],"mappings":";;;;;;AA6BA,IAAA,eAAeA,QACd,IAAI,SAAS,IAAI,SAAS,MAC1B,OAAO,GAAG,cAAc,CAAC,CAAC,WAAW,EAAE,QAAQ;C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,IAAI,OAAO,WAAW,OAAO,kBAAkB;GAC/C,IAAI,OAAO,UAAU,KAAA,GAAW,KAAK,MAAM,QAAQ,OAAO,MAAM,MAAM,IAAI,GAAG,OAAO,IAAI;EACzF;EACA,KAAK,MAAM,SAAS,QAAQ,MAAM,KAAK,iBAAiB,OAAO;EAC/D,OAAO,SAAS,GAAG,MAAM,KAAK,IAAI,EAAE,GAAG;CACxC,CACoB,CAAC,CAAC,KAAK,OAAO,MAAM,aAAa,CAAC;AACvD,CAAC,CACF"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { i as Cmd, t as handler } from "./runtime-
|
|
2
|
-
import { f as writeOut, i as reportFailure, t as InvalidInputError } from "./error
|
|
3
|
-
import { n as synced } from "./catalog-
|
|
1
|
+
import { i as Cmd, t as handler } from "./runtime-CK2CunDw.mjs";
|
|
2
|
+
import { f as writeOut, i as reportFailure, t as InvalidInputError } from "./error--BWou73I.mjs";
|
|
3
|
+
import { n as synced } from "./catalog-XfqtqMDz.mjs";
|
|
4
4
|
import { Effect, Option } from "effect";
|
|
5
5
|
import { ModelCatalog } from "@codeworksh/harness/effect";
|
|
6
6
|
//#region src/cli/cmd/handlers/models/list.ts
|
|
@@ -27,4 +27,4 @@ var list_default = handler(Cmd.commands.models, Effect.fn("CLI.models.list")(fun
|
|
|
27
27
|
//#endregion
|
|
28
28
|
export { list_default as default };
|
|
29
29
|
|
|
30
|
-
//# sourceMappingURL=list-
|
|
30
|
+
//# sourceMappingURL=list-Cf-zESJf.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list-
|
|
1
|
+
{"version":3,"file":"list-Cf-zESJf.mjs","names":["Runtime.handler"],"sources":["../../src/cli/cmd/handlers/models/list.ts"],"sourcesContent":["import { ModelCatalog } from \"@codeworksh/harness/effect\";\nimport { Effect, Option } from \"effect\";\nimport { Runtime } from \"../../../../framework/runtime.ts\";\nimport { InvalidInputError, reportFailure } from \"../../../error.ts\";\nimport { writeOut } from \"../../../output.ts\";\nimport { Cmd } from \"../../cmd.ts\";\nimport { synced } from \"./catalog.ts\";\n\nexport default Runtime.handler(\n\tCmd.commands.models,\n\tEffect.fn(\"CLI.models.list\")(function* ({ provider }) {\n\t\tconst program = Effect.gen(function* () {\n\t\t\tyield* synced;\n\t\t\tconst catalog = yield* ModelCatalog.models;\n\t\t\tif (Option.isSome(provider)) {\n\t\t\t\tconst providerId = provider.value;\n\t\t\t\tif (!Object.hasOwn(catalog, providerId)) {\n\t\t\t\t\treturn yield* new InvalidInputError({\n\t\t\t\t\t\tmessage: `provider \"${providerId}\" is not in the catalog\\nhint: run \\`codework models providers\\``,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tconst sorted = Object.keys(catalog[providerId] ?? {}).sort((a, b) => a.localeCompare(b));\n\t\t\t\tyield* writeOut(sorted.map((modelId) => `${providerId}/${modelId}\\n`).join(\"\"));\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst lines: string[] = [];\n\t\t\tconst providers = Object.keys(catalog).sort((a, b) => a.localeCompare(b));\n\t\t\tfor (const providerId of providers) {\n\t\t\t\tconst providerModels = Object.keys(catalog[providerId] ?? {}).sort((a, b) => a.localeCompare(b));\n\t\t\t\tfor (const modelId of providerModels) {\n\t\t\t\t\tlines.push(`${providerId}/${modelId}\\n`);\n\t\t\t\t}\n\t\t\t}\n\t\t\tyield* writeOut(lines.join(\"\"));\n\t\t});\n\n\t\treturn yield* program.pipe(Effect.catch(reportFailure));\n\t}),\n);\n"],"mappings":";;;;;;AAQA,IAAA,eAAeA,QACd,IAAI,SAAS,QACb,OAAO,GAAG,iBAAiB,CAAC,CAAC,WAAW,EAAE,YAAY;CA2BrD,OAAO,OA1BS,OAAO,IAAI,aAAa;EACvC,OAAO;EACP,MAAM,UAAU,OAAO,aAAa;EACpC,IAAI,OAAO,OAAO,QAAQ,GAAG;GAC5B,MAAM,aAAa,SAAS;GAC5B,IAAI,CAAC,OAAO,OAAO,SAAS,UAAU,GACrC,OAAO,OAAO,IAAI,kBAAkB,EACnC,SAAS,aAAa,WAAW,kEAClC,CAAC;GAEF,MAAM,SAAS,OAAO,KAAK,QAAQ,eAAe,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,MAAM,EAAE,cAAc,CAAC,CAAC;GACvF,OAAO,SAAS,OAAO,KAAK,YAAY,GAAG,WAAW,GAAG,QAAQ,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC;GAC9E;EACD;EAEA,MAAM,QAAkB,CAAC;EACzB,MAAM,YAAY,OAAO,KAAK,OAAO,CAAC,CAAC,MAAM,GAAG,MAAM,EAAE,cAAc,CAAC,CAAC;EACxE,KAAK,MAAM,cAAc,WAAW;GACnC,MAAM,iBAAiB,OAAO,KAAK,QAAQ,eAAe,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,MAAM,EAAE,cAAc,CAAC,CAAC;GAC/F,KAAK,MAAM,WAAW,gBACrB,MAAM,KAAK,GAAG,WAAW,GAAG,QAAQ,GAAG;EAEzC;EACA,OAAO,SAAS,MAAM,KAAK,EAAE,CAAC;CAC/B,CAEoB,CAAC,CAAC,KAAK,OAAO,MAAM,aAAa,CAAC;AACvD,CAAC,CACF"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { i as Cmd, t as handler } from "./runtime-
|
|
2
|
-
import { f as writeOut, i as reportFailure } from "./error
|
|
3
|
-
import { i as read } from "./entries-
|
|
1
|
+
import { i as Cmd, t as handler } from "./runtime-CK2CunDw.mjs";
|
|
2
|
+
import { f as writeOut, i as reportFailure } from "./error--BWou73I.mjs";
|
|
3
|
+
import { i as read } from "./entries-DnbFTTLU.mjs";
|
|
4
4
|
import { Effect, Schema } from "effect";
|
|
5
5
|
import { Plugin } from "@codeworksh/harness/effect";
|
|
6
6
|
//#region src/cli/cmd/handlers/plugin/list.ts
|
|
@@ -74,4 +74,4 @@ var list_default = handler(Cmd.commands.plugin.commands.list, Effect.fn("CLI.plu
|
|
|
74
74
|
//#endregion
|
|
75
75
|
export { list_default as default };
|
|
76
76
|
|
|
77
|
-
//# sourceMappingURL=list-
|
|
77
|
+
//# sourceMappingURL=list-Df4ngZjL.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list-
|
|
1
|
+
{"version":3,"file":"list-Df4ngZjL.mjs","names":["Runtime.handler"],"sources":["../../src/cli/cmd/handlers/plugin/list.ts"],"sourcesContent":["import { Plugin } from \"@codeworksh/harness/effect\";\nimport { Effect, Schema } from \"effect\";\nimport { Runtime } from \"../../../../framework/runtime.ts\";\nimport { reportFailure } from \"../../../error.ts\";\nimport { writeOut } from \"../../../output.ts\";\nimport { Cmd } from \"../../cmd.ts\";\nimport { read } from \"./entries.ts\";\n\n/**\n * Two columns: what was written, and what it turned out to be.\n *\n * **The second column doubles as the state, for free.** An ID cannot be known without importing\n * the module -- the store records nothing about the plugin inside a package -- so printing one is\n * proof that everything worked: the entry parsed, the store had it, the import succeeded, and the\n * definition validated. When any of that fails there is no ID to print, and the reason goes in its\n * place.\n *\n * **Nothing is stored to make that work.** The reason is the live error from this run, not a\n * record of an older one: a stored failure goes stale the moment someone fixes the cause, and a\n * list still printing `plugin-import-failed` after you installed the missing dependency is worse\n * than one that says nothing. The work is cheap and local -- a parse, a lookup and an import.\n *\n * (`checkedAt`/`outdated` are stored, for the opposite reason: those come from the network, so\n * re-obtaining them is expensive and a slightly stale answer is the right trade. Local facts are\n * recomputed; remote facts are cached.)\n */\nconst isSourceError = Schema.is(Plugin.SourceError);\nconst isInstallError = Schema.is(Plugin.InstallError);\nconst isStoreError = Schema.is(Plugin.StoreError);\nconst isLoadError = Schema.is(Plugin.LoadError);\n\n/** The §5.5 reason slug, which is the same string the CLI prints and a log line carries. */\nconst reasonOf = (error: unknown): { readonly reason: string; readonly message: string } =>\n\tisSourceError(error) || isInstallError(error) || isStoreError(error) || isLoadError(error)\n\t\t? { reason: error.reason, message: error.message }\n\t\t: { reason: \"plugin-load-failed\", message: String(error) };\n\nexport default Runtime.handler(\n\tCmd.commands.plugin.commands.list,\n\tEffect.fn(\"CLI.plugin.list\")(function* ({ verbose }) {\n\t\tconst program = Effect.gen(function* () {\n\t\t\tconst shared = yield* Cmd.spec;\n\t\t\tconst { entries, cache } = yield* read(shared);\n\t\t\tif (entries.length === 0) {\n\t\t\t\tyield* writeOut(\"No plugins are configured.\\n\");\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst rows: Array<{ written: string; file: string; state: string; detail?: string }> = [];\n\t\t\tfor (const entry of entries) {\n\t\t\t\t// Resolve-only: listing what is configured must never install anything.\n\t\t\t\tconst inspected = yield* Plugin.inspect(entry.reference, {\n\t\t\t\t\tcache,\n\t\t\t\t\thostDir: entry.from,\n\t\t\t\t\tfile: entry.file,\n\t\t\t\t\tinstall: Plugin.resolveCached,\n\t\t\t\t}).pipe(Effect.result);\n\t\t\t\trows.push(\n\t\t\t\t\tinspected._tag === \"Success\"\n\t\t\t\t\t\t? { written: entry.written, file: entry.file, state: inspected.success.id }\n\t\t\t\t\t\t: {\n\t\t\t\t\t\t\t\twritten: entry.written,\n\t\t\t\t\t\t\t\tfile: entry.file,\n\t\t\t\t\t\t\t\tstate: reasonOf(inspected.failure).reason,\n\t\t\t\t\t\t\t\tdetail: reasonOf(inspected.failure).message,\n\t\t\t\t\t\t\t},\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// The left column is the reference exactly as the entry spells it, because that is the\n\t\t\t// string a person will search their settings for.\n\t\t\tconst width = Math.max(...rows.map((row) => row.written.length));\n\t\t\tfor (const row of rows) {\n\t\t\t\tyield* writeOut(`${row.written.padEnd(width)} ${row.state}\\n`);\n\t\t\t\tif (verbose) {\n\t\t\t\t\tif (row.detail !== undefined) yield* writeOut(`${\" \".repeat(width)} ${row.detail}\\n`);\n\t\t\t\t\tyield* writeOut(`${\" \".repeat(width)} declared in: ${row.file}\\n`);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\treturn yield* program.pipe(Effect.catch(reportFailure));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AAQ,MAAM,CAAC;EAC/D,KAAK,MAAM,OAAO,MAAM;GACvB,OAAO,SAAS,GAAG,IAAI,QAAQ,OAAO,KAAK,EAAE,IAAI,IAAI,MAAM,GAAG;GAC9D,IAAI,SAAS;IACZ,IAAI,IAAI,WAAW,KAAA,GAAW,OAAO,SAAS,GAAG,IAAI,OAAO,KAAK,EAAE,IAAI,IAAI,OAAO,GAAG;IACrF,OAAO,SAAS,GAAG,IAAI,OAAO,KAAK,EAAE,iBAAiB,IAAI,KAAK,GAAG;GACnE;EACD;CACD,CAEoB,CAAC,CAAC,KAAK,OAAO,MAAM,aAAa,CAAC;AACvD,CAAC,CACF"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as Cmd, t as handler } from "./runtime-
|
|
2
|
-
import { d as writeJson, f as writeOut, i as reportFailure, m as make, p as layer,
|
|
1
|
+
import { i as Cmd, t as handler } from "./runtime-CK2CunDw.mjs";
|
|
2
|
+
import { d as writeJson, f as writeOut, i as reportFailure, m as make, p as layer, y as ThreadInfo } from "./error--BWou73I.mjs";
|
|
3
3
|
import { Effect, Schema } from "effect";
|
|
4
4
|
import { Session } from "@codeworksh/harness/effect";
|
|
5
5
|
//#region src/cli/cmd/handlers/thread/list.ts
|
|
@@ -33,4 +33,4 @@ var list_default = handler(Cmd.commands.thread.commands.list, Effect.fn("CLI.thr
|
|
|
33
33
|
//#endregion
|
|
34
34
|
export { list_default as default };
|
|
35
35
|
|
|
36
|
-
//# sourceMappingURL=list-
|
|
36
|
+
//# sourceMappingURL=list-TLhgvlKp.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list-
|
|
1
|
+
{"version":3,"file":"list-TLhgvlKp.mjs","names":["Runtime.handler","Client.make","ThreadInfoSchema","Client.layer"],"sources":["../../src/cli/cmd/handlers/thread/list.ts"],"sourcesContent":["import { Session } from \"@codeworksh/harness/effect\";\nimport { Effect, Schema } from \"effect\";\nimport { Runtime } from \"../../../../framework/runtime.ts\";\nimport { Client } from \"../../../../server/client.ts\";\nimport { type ThreadInfo, ThreadInfo as ThreadInfoSchema } from \"../../../../server/contract.ts\";\nimport { reportFailure } from \"../../../error.ts\";\nimport { writeJson, writeOut } from \"../../../output.ts\";\nimport { Cmd } from \"../../cmd.ts\";\n\nconst origin = (info: ThreadInfo): string => {\n\tswitch (info.origin.kind) {\n\t\tcase \"main\":\n\t\t\treturn \"main\";\n\t\tcase \"fork\":\n\t\t\treturn `fork of ${info.origin.threadId}`;\n\t\tcase \"subagent\":\n\t\t\treturn `subagent of ${info.origin.threadId}`;\n\t}\n};\n\nconst cost = (info: ThreadInfo) => `$${info.usage.cost.toFixed(4)}`;\n\nexport default Runtime.handler(\n\tCmd.commands.thread.commands.list,\n\tEffect.fn(\"CLI.thread.list\")(function* ({ session, json, server }) {\n\t\tconst program = Effect.gen(function* () {\n\t\t\tconst rpc = yield* Client.make;\n\t\t\tconst threads = yield* rpc[\"thread.list\"]({ sessionId: Session.SessionSchema.ID.make(session) });\n\t\t\tif (json) return yield* writeJson(Schema.Array(ThreadInfoSchema), threads);\n\t\t\tif (threads.length === 0) return yield* writeOut(`No threads in ${session}.\\n`);\n\t\t\tconst rows = threads.map((info) => [\n\t\t\t\tinfo.id,\n\t\t\t\torigin(info),\n\t\t\t\tinfo.model === undefined ? \"-\" : `${info.model.provider}/${info.model.id}`,\n\t\t\t\t`${info.usage.input + info.usage.output} tok ${cost(info)}`,\n\t\t\t\tinfo.title ?? \"(untitled)\",\n\t\t\t]);\n\t\t\tconst widths = rows[0]?.map((_, column) => Math.max(...rows.map((row) => row[column]?.length ?? 0))) ?? [];\n\t\t\tfor (const row of rows) {\n\t\t\t\tconst last = row.length - 1;\n\t\t\t\tyield* writeOut(\n\t\t\t\t\t`${row.map((cell, column) => (column === last ? cell : cell.padEnd(widths[column] ?? 0))).join(\" \")}\\n`,\n\t\t\t\t);\n\t\t\t}\n\t\t});\n\n\t\treturn yield* program.pipe(Effect.provide(Client.layer(server)), Effect.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CAAC,CAAE,CAAC,CAAC,KAAK,IAAI,EAAE,GACtG;EACD;CACD,CAEoB,CAAC,CAAC,KAAK,OAAO,QAAQC,MAAa,MAAM,CAAC,GAAG,OAAO,QAAQ,OAAO,MAAM,aAAa,CAAC;AAC5G,CAAC,CACF"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { i as Cmd, t as handler } from "./runtime-
|
|
2
|
-
import { f as writeOut, i as reportFailure, n as OAuthError, u as writeError } from "./error
|
|
3
|
-
import { i as oauthServer } from "./shared-
|
|
1
|
+
import { i as Cmd, t as handler } from "./runtime-CK2CunDw.mjs";
|
|
2
|
+
import { f as writeOut, i as reportFailure, n as OAuthError, u as writeError } from "./error--BWou73I.mjs";
|
|
3
|
+
import { i as oauthServer } from "./shared-BnR3BFZM.mjs";
|
|
4
4
|
import { Duration, Effect, Logger } from "effect";
|
|
5
5
|
import { McpOAuth } from "@codeworksh/harness/effect";
|
|
6
6
|
import { openBrowser } from "@codeworksh/aikit/oauth/interactive";
|
|
@@ -56,4 +56,4 @@ var login_default = handler(Cmd.commands.mcp.commands.login, Effect.fn("CLI.mcp.
|
|
|
56
56
|
//#endregion
|
|
57
57
|
export { login_default as default };
|
|
58
58
|
|
|
59
|
-
//# sourceMappingURL=login-
|
|
59
|
+
//# sourceMappingURL=login-BJ3d7FM_.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"login-
|
|
1
|
+
{"version":3,"file":"login-BJ3d7FM_.mjs","names":["Runtime.handler"],"sources":["../../src/cli/cmd/handlers/mcp/login.ts"],"sourcesContent":["/* @effect-diagnostics nodeBuiltinImport:off -- the pasted redirect URL is read from standard input. */\nimport { createInterface } from \"node:readline\";\nimport { openBrowser } from \"@codeworksh/aikit/oauth/interactive\";\nimport { McpOAuth } from \"@codeworksh/harness/effect\";\nimport { Duration, Effect, Logger } from \"effect\";\nimport { Runtime } from \"../../../../framework/runtime.ts\";\nimport { OAuthError, reportFailure } from \"../../../error.ts\";\nimport { writeError, writeOut } from \"../../../output.ts\";\nimport { Cmd } from \"../../cmd.ts\";\nimport { oauthServer } from \"./shared.ts\";\n\n/**\n * The redirected URL, typed or piped in when the browser cannot reach this machine's callback (over\n * SSH, say). Piped input that ends without a line leaves the callback to finish the sign-in; a\n * terminal that closes (Ctrl+C, Ctrl+D) cancels it.\n */\nconst paste: Effect.Effect<string> = Effect.acquireUseRelease(\n\tEffect.sync(() => ({\n\t\treadline: createInterface({ input: process.stdin, output: process.stderr }),\n\t\tanswered: false,\n\t})),\n\t(asking) =>\n\t\tEffect.callback<string>((resume) => {\n\t\t\tconst answer = (line: string) => {\n\t\t\t\tasking.answered = true;\n\t\t\t\tresume(Effect.succeed(line));\n\t\t\t};\n\t\t\tasking.readline.question(\"Or paste the URL the browser was redirected to: \", answer);\n\t\t\t// An empty answer cancels the sign-in.\n\t\t\tif (process.stdin.isTTY) asking.readline.once(\"close\", () => answer(\"\"));\n\t\t}),\n\t(asking) =>\n\t\tEffect.sync(() => {\n\t\t\tconst unanswered = !asking.answered;\n\t\t\tasking.readline.close();\n\t\t\t// A pipe still open would keep the process alive after the sign-in.\n\t\t\tprocess.stdin.destroy();\n\t\t\t// What follows starts on its own line, not after the prompt.\n\t\t\tif (unanswered) process.stderr.write(\"\\n\");\n\t\t}),\n);\n\nexport default Runtime.handler(\n\tCmd.commands.mcp.commands.login,\n\tEffect.fn(\"CLI.mcp.login\")(function* ({ name, browser, timeout }) {\n\t\tconst program = Effect.gen(function* () {\n\t\t\tconst { store, config } = yield* oauthServer(name);\n\t\t\tconst limit = Duration.seconds(timeout);\n\t\t\tconst result = yield* McpOAuth.login({\n\t\t\t\tstore,\n\t\t\t\tname,\n\t\t\t\tconfig,\n\t\t\t\tprompt: {\n\t\t\t\t\tshow: (url) =>\n\t\t\t\t\t\tEffect.gen(function* () {\n\t\t\t\t\t\t\tyield* writeError(`Sign in to MCP server \"${name}\" in your browser:\\n${url.href}\\n`);\n\t\t\t\t\t\t\tif (browser)\n\t\t\t\t\t\t\t\tyield* Effect.sync(\n\t\t\t\t\t\t\t\t\t() =>\n\t\t\t\t\t\t\t\t\t\tvoid openBrowser(url.href, (error) =>\n\t\t\t\t\t\t\t\t\t\t\tprocess.stderr.write(`Failed to open browser: ${error.message}\\n`),\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}),\n\t\t\t\t\tpaste,\n\t\t\t\t},\n\t\t\t}).pipe(\n\t\t\t\tEffect.timeoutOrElse({\n\t\t\t\t\tduration: limit,\n\t\t\t\t\torElse: () =>\n\t\t\t\t\t\tEffect.fail(new OAuthError({ message: `sign-in timed out after ${Duration.format(limit)}` })),\n\t\t\t\t}),\n\t\t\t);\n\t\t\tconst tools = `${result.tools} tool${result.tools === 1 ? \"\" : \"s\"}`;\n\t\t\tyield* writeOut(\n\t\t\t\tresult.signedIn\n\t\t\t\t\t? `Signed in to MCP server \"${name}\" (${tools}).\\n`\n\t\t\t\t\t: `Already signed in to MCP server \"${name}\" (${tools}).\\n`,\n\t\t\t);\n\t\t});\n\t\t// Stdout carries only the outcome; harness logs go with the rest of the diagnostics.\n\t\treturn yield* program.pipe(Effect.provideService(Logger.LogToStderr, true), Effect.catch(reportFailure));\n\t}),\n);\n"],"mappings":";;;;;;;;;;;;;AAgBA,MAAM,QAA+B,OAAO,kBAC3C,OAAO,YAAY;CAClB,UAAU,gBAAgB;EAAE,OAAO,QAAQ;EAAO,QAAQ,QAAQ;CAAO,CAAC;CAC1E,UAAU;AACX,EAAE,IACD,WACA,OAAO,UAAkB,WAAW;CACnC,MAAM,UAAU,SAAiB;EAChC,OAAO,WAAW;EAClB,OAAO,OAAO,QAAQ,IAAI,CAAC;CAC5B;CACA,OAAO,SAAS,SAAS,oDAAoD,MAAM;CAEnF,IAAI,QAAQ,MAAM,OAAO,OAAO,SAAS,KAAK,eAAe,OAAO,EAAE,CAAC;AACxE,CAAC,IACD,WACA,OAAO,WAAW;CACjB,MAAM,aAAa,CAAC,OAAO;CAC3B,OAAO,SAAS,MAAM;CAEtB,QAAQ,MAAM,QAAQ;CAEtB,IAAI,YAAY,QAAQ,OAAO,MAAM,IAAI;AAC1C,CAAC,CACH;AAEA,IAAA,gBAAeA,QACd,IAAI,SAAS,IAAI,SAAS,OAC1B,OAAO,GAAG,eAAe,CAAC,CAAC,WAAW,EAAE,MAAM,SAAS,WAAW;CAqCjE,OAAO,OApCS,OAAO,IAAI,aAAa;EACvC,MAAM,EAAE,OAAO,WAAW,OAAO,YAAY,IAAI;EACjD,MAAM,QAAQ,SAAS,QAAQ,OAAO;EACtC,MAAM,SAAS,OAAO,SAAS,MAAM;GACpC;GACA;GACA;GACA,QAAQ;IACP,OAAO,QACN,OAAO,IAAI,aAAa;KACvB,OAAO,WAAW,0BAA0B,KAAK,sBAAsB,IAAI,KAAK,GAAG;KACnF,IAAI,SACH,OAAO,OAAO,WAEZ,KAAK,YAAY,IAAI,OAAO,UAC3B,QAAQ,OAAO,MAAM,2BAA2B,MAAM,QAAQ,GAAG,CAClE,CACF;IACF,CAAC;IACF;GACD;EACD,CAAC,CAAC,CAAC,KACF,OAAO,cAAc;GACpB,UAAU;GACV,cACC,OAAO,KAAK,IAAI,WAAW,EAAE,SAAS,2BAA2B,SAAS,OAAO,KAAK,IAAI,CAAC,CAAC;EAC9F,CAAC,CACF;EACA,MAAM,QAAQ,GAAG,OAAO,MAAM,OAAO,OAAO,UAAU,IAAI,KAAK;EAC/D,OAAO,SACN,OAAO,WACJ,4BAA4B,KAAK,KAAK,MAAM,QAC5C,oCAAoC,KAAK,KAAK,MAAM,KACxD;CACD,CAEoB,CAAC,CAAC,KAAK,OAAO,eAAe,OAAO,aAAa,IAAI,GAAG,OAAO,MAAM,aAAa,CAAC;AACxG,CAAC,CACF"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { i as Cmd, t as handler } from "./runtime-
|
|
2
|
-
import { f as writeOut, i as reportFailure, m as make, t as InvalidInputError, u as writeError } from "./error
|
|
3
|
-
import { a as oauthProviderLabel, i as makeOps, n as attempt, o as selectProvider, r as localOps, s as withServer, t as assertServerScope } from "./shared-
|
|
1
|
+
import { i as Cmd, t as handler } from "./runtime-CK2CunDw.mjs";
|
|
2
|
+
import { f as writeOut, i as reportFailure, m as make, t as InvalidInputError, u as writeError } from "./error--BWou73I.mjs";
|
|
3
|
+
import { a as oauthProviderLabel, i as makeOps, n as attempt, o as selectProvider, r as localOps, s as withServer, t as assertServerScope } from "./shared-BU8-Q5m8.mjs";
|
|
4
4
|
import { Effect, Option } from "effect";
|
|
5
5
|
import { formatOAuthSummary, oauthLoginIssue, oauthNotice } from "@codeworksh/aikit/oauth/summary";
|
|
6
6
|
//#region src/cli/cmd/handlers/auth/login.ts
|
|
@@ -42,4 +42,4 @@ var login_default = handler(Cmd.commands.auth.commands.login, Effect.fn("CLI.aut
|
|
|
42
42
|
//#endregion
|
|
43
43
|
export { login_default as default };
|
|
44
44
|
|
|
45
|
-
//# sourceMappingURL=login-
|
|
45
|
+
//# sourceMappingURL=login-oWLqnAQK.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"login-
|
|
1
|
+
{"version":3,"file":"login-oWLqnAQK.mjs","names":["Runtime.handler","Client.make"],"sources":["../../src/cli/cmd/handlers/auth/login.ts"],"sourcesContent":["import { formatOAuthSummary, oauthLoginIssue, oauthNotice } from \"@codeworksh/aikit/oauth/summary\";\nimport { Effect, Option } from \"effect\";\nimport { Runtime } from \"../../../../framework/runtime.ts\";\nimport { InvalidInputError, reportFailure } from \"../../../error.ts\";\nimport { writeError, writeOut } from \"../../../output.ts\";\nimport { Cmd } from \"../../cmd.ts\";\nimport {\n\tassertServerScope,\n\tattempt,\n\tClient,\n\tlocalOps,\n\tmakeOps,\n\toauthProviderLabel,\n\tselectProvider,\n\twithServer,\n\ttype LoginOptions,\n} from \"./shared.ts\";\n\nexport default Runtime.handler(\n\tCmd.commands.auth.commands.login,\n\tEffect.fn(\"CLI.auth.login\")(function* ({\n\t\tserver,\n\t\topenaiCodex,\n\t\tgithubCopilot,\n\t\tauthFile,\n\t\tbrowser,\n\t\tdevice,\n\t\tenterprise,\n\t\tenableModels,\n\t\tjson,\n\t}) {\n\t\tconst program = Effect.gen(function* () {\n\t\t\tconst provider = yield* selectProvider({ openaiCodex, githubCopilot });\n\t\t\tconst issue = oauthLoginIssue(provider, {\n\t\t\t\tdevice,\n\t\t\t\tenableModels,\n\t\t\t\t...(Option.isSome(enterprise) && { enterprise: enterprise.value }),\n\t\t\t});\n\t\t\tif (issue !== undefined) return yield* new InvalidInputError({ message: issue });\n\n\t\t\tconst name = oauthProviderLabel(provider);\n\t\t\tconst options: LoginOptions = { browser, device, enterprise, enableModels };\n\n\t\t\tif (Option.isSome(server)) {\n\t\t\t\tyield* assertServerScope(authFile);\n\t\t\t\treturn yield* withServer(\n\t\t\t\t\tserver.value,\n\t\t\t\t\tEffect.gen(function* () {\n\t\t\t\t\t\tconst rpc = yield* Client.make;\n\t\t\t\t\t\t// The browser callback and the device prompt both need this\n\t\t\t\t\t\t// terminal, so the login runs here and only the result travels.\n\t\t\t\t\t\tconst { wire } = yield* attempt(`${name} login failed`, () =>\n\t\t\t\t\t\t\tmakeOps(provider, { persist: false }).login(options),\n\t\t\t\t\t\t);\n\t\t\t\t\t\tconst info = yield* rpc[\"auth.save\"]({ credentials: wire });\n\t\t\t\t\t\tyield* writeError(`${oauthNotice(\"saved\", provider, \"the server\")}\\n`);\n\t\t\t\t\t\tyield* writeOut(formatOAuthSummary(info, { json }));\n\t\t\t\t\t}),\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tconst ops = yield* localOps(provider, authFile);\n\t\t\tconst { summary } = yield* attempt(`${name} login failed`, () => ops.login(options));\n\t\t\tyield* writeError(`${oauthNotice(\"saved\", provider, ops.path)}\\n`);\n\t\t\tyield* writeOut(formatOAuthSummary(summary, { json }));\n\t\t});\n\n\t\treturn yield* program.pipe(Effect.catch(reportFailure));\n\t}),\n);\n"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AE,KAAK,CAAC,CAAC;CACtD,CAEoB,CAAC,CAAC,KAAK,OAAO,MAAM,aAAa,CAAC;AACvD,CAAC,CACF"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { i as Cmd, t as handler } from "./runtime-
|
|
2
|
-
import { i as reportFailure, m as make, u as writeError } from "./error
|
|
3
|
-
import { a as oauthProviderLabel, n as attempt, o as selectProvider, r as localOps, s as withServer, t as assertServerScope } from "./shared-
|
|
1
|
+
import { i as Cmd, t as handler } from "./runtime-CK2CunDw.mjs";
|
|
2
|
+
import { i as reportFailure, m as make, u as writeError } from "./error--BWou73I.mjs";
|
|
3
|
+
import { a as oauthProviderLabel, n as attempt, o as selectProvider, r as localOps, s as withServer, t as assertServerScope } from "./shared-BU8-Q5m8.mjs";
|
|
4
4
|
import { Effect, Option } from "effect";
|
|
5
5
|
import { oauthNotice } from "@codeworksh/aikit/oauth/summary";
|
|
6
6
|
//#region src/cli/cmd/handlers/auth/logout.ts
|
|
@@ -26,4 +26,4 @@ var logout_default = handler(Cmd.commands.auth.commands.logout, Effect.fn("CLI.a
|
|
|
26
26
|
//#endregion
|
|
27
27
|
export { logout_default as default };
|
|
28
28
|
|
|
29
|
-
//# sourceMappingURL=logout-
|
|
29
|
+
//# sourceMappingURL=logout-ClrNQ8LO.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logout-
|
|
1
|
+
{"version":3,"file":"logout-ClrNQ8LO.mjs","names":["Runtime.handler","Client.make"],"sources":["../../src/cli/cmd/handlers/auth/logout.ts"],"sourcesContent":["import { oauthNotice } from \"@codeworksh/aikit/oauth/summary\";\nimport { Effect, Option } from \"effect\";\nimport { Runtime } from \"../../../../framework/runtime.ts\";\nimport { reportFailure } from \"../../../error.ts\";\nimport { writeError } from \"../../../output.ts\";\nimport { Cmd } from \"../../cmd.ts\";\nimport {\n\tassertServerScope,\n\tattempt,\n\tClient,\n\tlocalOps,\n\toauthProviderLabel,\n\tselectProvider,\n\twithServer,\n} from \"./shared.ts\";\n\nexport default Runtime.handler(\n\tCmd.commands.auth.commands.logout,\n\tEffect.fn(\"CLI.auth.logout\")(function* ({ server, openaiCodex, githubCopilot, authFile }) {\n\t\tconst program = Effect.gen(function* () {\n\t\t\tconst provider = yield* selectProvider({ openaiCodex, githubCopilot });\n\t\t\tconst name = oauthProviderLabel(provider);\n\n\t\t\tif (Option.isSome(server)) {\n\t\t\t\tyield* assertServerScope(authFile);\n\t\t\t\treturn yield* withServer(\n\t\t\t\t\tserver.value,\n\t\t\t\t\tEffect.gen(function* () {\n\t\t\t\t\t\tconst rpc = yield* Client.make;\n\t\t\t\t\t\tyield* rpc[\"auth.logout\"]({ provider });\n\t\t\t\t\t\tyield* writeError(`${oauthNotice(\"cleared\", provider, \"the server\")}\\n`);\n\t\t\t\t\t}),\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tconst ops = yield* localOps(provider, authFile);\n\t\t\tyield* attempt(`failed to clear ${name} credentials`, () => ops.logout());\n\t\t\tyield* writeError(`${oauthNotice(\"cleared\", provider, ops.path)}\\n`);\n\t\t});\n\n\t\treturn yield* program.pipe(Effect.catch(reportFailure));\n\t}),\n);\n"],"mappings":";;;;;;AAgBA,IAAA,iBAAeA,QACd,IAAI,SAAS,KAAK,SAAS,QAC3B,OAAO,GAAG,iBAAiB,CAAC,CAAC,WAAW,EAAE,QAAQ,aAAa,eAAe,YAAY;CAsBzF,OAAO,OArBS,OAAO,IAAI,aAAa;EACvC,MAAM,WAAW,OAAO,eAAe;GAAE;GAAa;EAAc,CAAC;EACrE,MAAM,OAAO,mBAAmB,QAAQ;EAExC,IAAI,OAAO,OAAO,MAAM,GAAG;GAC1B,OAAO,kBAAkB,QAAQ;GACjC,OAAO,OAAO,WACb,OAAO,OACP,OAAO,IAAI,aAAa;IAEvB,QAAO,OADYC,KAAAA,CACR,cAAc,CAAC,EAAE,SAAS,CAAC;IACtC,OAAO,WAAW,GAAG,YAAY,WAAW,UAAU,YAAY,EAAE,GAAG;GACxE,CAAC,CACF;EACD;EAEA,MAAM,MAAM,OAAO,SAAS,UAAU,QAAQ;EAC9C,OAAO,QAAQ,mBAAmB,KAAK,qBAAqB,IAAI,OAAO,CAAC;EACxE,OAAO,WAAW,GAAG,YAAY,WAAW,UAAU,IAAI,IAAI,EAAE,GAAG;CACpE,CAEoB,CAAC,CAAC,KAAK,OAAO,MAAM,aAAa,CAAC;AACvD,CAAC,CACF"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { i as Cmd, t as handler } from "./runtime-
|
|
2
|
-
import { f as writeOut, i as reportFailure } from "./error
|
|
3
|
-
import { i as oauthServer } from "./shared-
|
|
1
|
+
import { i as Cmd, t as handler } from "./runtime-CK2CunDw.mjs";
|
|
2
|
+
import { f as writeOut, i as reportFailure } from "./error--BWou73I.mjs";
|
|
3
|
+
import { i as oauthServer } from "./shared-BnR3BFZM.mjs";
|
|
4
4
|
import { Effect } from "effect";
|
|
5
5
|
import { McpOAuth } from "@codeworksh/harness/effect";
|
|
6
6
|
//#region src/cli/cmd/handlers/mcp/logout.ts
|
|
@@ -14,4 +14,4 @@ var logout_default = handler(Cmd.commands.mcp.commands.logout, Effect.fn("CLI.mc
|
|
|
14
14
|
//#endregion
|
|
15
15
|
export { logout_default as default };
|
|
16
16
|
|
|
17
|
-
//# sourceMappingURL=logout-
|
|
17
|
+
//# sourceMappingURL=logout-D44pgH6b.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logout-
|
|
1
|
+
{"version":3,"file":"logout-D44pgH6b.mjs","names":["Runtime.handler"],"sources":["../../src/cli/cmd/handlers/mcp/logout.ts"],"sourcesContent":["import { McpOAuth } from \"@codeworksh/harness/effect\";\nimport { Effect } from \"effect\";\nimport { Runtime } from \"../../../../framework/runtime.ts\";\nimport { reportFailure } from \"../../../error.ts\";\nimport { writeOut } from \"../../../output.ts\";\nimport { Cmd } from \"../../cmd.ts\";\nimport { oauthServer } from \"./shared.ts\";\n\nexport default Runtime.handler(\n\tCmd.commands.mcp.commands.logout,\n\tEffect.fn(\"CLI.mcp.logout\")(function* ({ name }) {\n\t\tconst program = Effect.gen(function* () {\n\t\t\tconst { store, server } = yield* oauthServer(name);\n\t\t\tconst removed = yield* McpOAuth.signOut(store, server);\n\t\t\tyield* writeOut(\n\t\t\t\tremoved ? `Signed out of MCP server \"${name}\".\\n` : `MCP server \"${name}\" has no stored sign-in.\\n`,\n\t\t\t);\n\t\t});\n\t\treturn yield* program.pipe(Effect.catch(reportFailure));\n\t}),\n);\n"],"mappings":";;;;;;AAQA,IAAA,iBAAeA,QACd,IAAI,SAAS,IAAI,SAAS,QAC1B,OAAO,GAAG,gBAAgB,CAAC,CAAC,WAAW,EAAE,QAAQ;CAQhD,OAAO,OAPS,OAAO,IAAI,aAAa;EACvC,MAAM,EAAE,OAAO,WAAW,OAAO,YAAY,IAAI;EACjD,MAAM,UAAU,OAAO,SAAS,QAAQ,OAAO,MAAM;EACrD,OAAO,SACN,UAAU,6BAA6B,KAAK,QAAQ,eAAe,KAAK,2BACzE;CACD,CACoB,CAAC,CAAC,KAAK,OAAO,MAAM,aAAa,CAAC;AACvD,CAAC,CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package-Be19GRQs.mjs","names":[],"sources":["../../package.json"],"sourcesContent":[""],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codeworksh/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0-canary.116.1.ga7e3ef29",
|
|
4
4
|
"description": "CLI for running CodeWork coding agent harness.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"agent",
|
|
@@ -40,9 +40,8 @@
|
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@agentclientprotocol/sdk": "1.5.1",
|
|
43
|
-
"@codeworksh/aikit": "
|
|
44
|
-
"@codeworksh/harness": "0.
|
|
45
|
-
"@codeworksh/tui": "0.1.0",
|
|
43
|
+
"@codeworksh/aikit": "0.13.0-canary.116.1.ga7e3ef29",
|
|
44
|
+
"@codeworksh/harness": "0.7.0-canary.116.1.ga7e3ef29",
|
|
46
45
|
"@effect/platform-node": "4.0.5",
|
|
47
46
|
"@effect/platform-node-shared": "4.0.5",
|
|
48
47
|
"effect": "4.0.5",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { i as Cmd, t as handler } from "./runtime-
|
|
2
|
-
import { f as writeOut, i as reportFailure } from "./error
|
|
3
|
-
import { n as synced } from "./catalog-
|
|
1
|
+
import { i as Cmd, t as handler } from "./runtime-CK2CunDw.mjs";
|
|
2
|
+
import { f as writeOut, i as reportFailure } from "./error--BWou73I.mjs";
|
|
3
|
+
import { n as synced } from "./catalog-XfqtqMDz.mjs";
|
|
4
4
|
import { Effect } from "effect";
|
|
5
5
|
import { ModelCatalog } from "@codeworksh/harness/effect";
|
|
6
6
|
//#region src/cli/cmd/handlers/models/providers.ts
|
|
@@ -14,4 +14,4 @@ var providers_default = handler(Cmd.commands.models.commands.providers, Effect.f
|
|
|
14
14
|
//#endregion
|
|
15
15
|
export { providers_default as default };
|
|
16
16
|
|
|
17
|
-
//# sourceMappingURL=providers-
|
|
17
|
+
//# sourceMappingURL=providers-ozcPo-AJ.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"providers-
|
|
1
|
+
{"version":3,"file":"providers-ozcPo-AJ.mjs","names":["Runtime.handler"],"sources":["../../src/cli/cmd/handlers/models/providers.ts"],"sourcesContent":["import { ModelCatalog } from \"@codeworksh/harness/effect\";\nimport { Effect } from \"effect\";\nimport { Runtime } from \"../../../../framework/runtime.ts\";\nimport { reportFailure } from \"../../../error.ts\";\nimport { writeOut } from \"../../../output.ts\";\nimport { Cmd } from \"../../cmd.ts\";\nimport { synced } from \"./catalog.ts\";\n\nexport default Runtime.handler(\n\tCmd.commands.models.commands.providers,\n\tEffect.fn(\"CLI.models.providers\")(function* () {\n\t\tconst program = Effect.gen(function* () {\n\t\t\tyield* synced;\n\t\t\tconst providers = yield* ModelCatalog.providers;\n\t\t\tconst sorted = [...providers].sort((a, b) => a.localeCompare(b));\n\t\t\tyield* writeOut(sorted.map((providerId) => `${providerId}\\n`).join(\"\"));\n\t\t});\n\n\t\treturn yield* program.pipe(Effect.catch(reportFailure));\n\t}),\n);\n"],"mappings":";;;;;;AAQA,IAAA,oBAAeA,QACd,IAAI,SAAS,OAAO,SAAS,WAC7B,OAAO,GAAG,sBAAsB,CAAC,CAAC,aAAa;CAQ9C,OAAO,OAPS,OAAO,IAAI,aAAa;EACvC,OAAO;EAEP,MAAM,SAAS,CAAC,GAAG,OADM,aAAa,SACV,CAAC,CAAC,MAAM,GAAG,MAAM,EAAE,cAAc,CAAC,CAAC;EAC/D,OAAO,SAAS,OAAO,KAAK,eAAe,GAAG,WAAW,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC;CACvE,CAEoB,CAAC,CAAC,KAAK,OAAO,MAAM,aAAa,CAAC;AACvD,CAAC,CACF"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { i as Cmd, t as handler } from "./runtime-
|
|
2
|
-
import { f as writeOut, i as reportFailure, u as writeError } from "./error
|
|
3
|
-
import { t as home } from "./catalog-
|
|
1
|
+
import { i as Cmd, t as handler } from "./runtime-CK2CunDw.mjs";
|
|
2
|
+
import { f as writeOut, i as reportFailure, u as writeError } from "./error--BWou73I.mjs";
|
|
3
|
+
import { t as home } from "./catalog-XfqtqMDz.mjs";
|
|
4
4
|
import { Effect } from "effect";
|
|
5
5
|
import { ModelCatalog } from "@codeworksh/harness/effect";
|
|
6
6
|
//#region src/cli/cmd/handlers/models/refresh.ts
|
|
@@ -14,4 +14,4 @@ var refresh_default = handler(Cmd.commands.models.commands.refresh, Effect.fn("C
|
|
|
14
14
|
//#endregion
|
|
15
15
|
export { refresh_default as default };
|
|
16
16
|
|
|
17
|
-
//# sourceMappingURL=refresh-
|
|
17
|
+
//# sourceMappingURL=refresh-B6iT5eWN.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"refresh-
|
|
1
|
+
{"version":3,"file":"refresh-B6iT5eWN.mjs","names":["Runtime.handler"],"sources":["../../src/cli/cmd/handlers/models/refresh.ts"],"sourcesContent":["import { ModelCatalog } from \"@codeworksh/harness/effect\";\nimport { Effect } from \"effect\";\nimport { Runtime } from \"../../../../framework/runtime.ts\";\nimport { reportFailure } from \"../../../error.ts\";\nimport { writeError, writeOut } from \"../../../output.ts\";\nimport { Cmd } from \"../../cmd.ts\";\nimport { home } from \"./catalog.ts\";\n\nexport default Runtime.handler(\n\tCmd.commands.models.commands.refresh,\n\tEffect.fn(\"CLI.models.refresh\")(function* ({ force }) {\n\t\tconst program = Effect.gen(function* () {\n\t\t\tconst status = yield* ModelCatalog.refresh(yield* home, { force });\n\t\t\tyield* writeError(\n\t\t\t\tstatus.refreshed\n\t\t\t\t\t? `Refreshed model catalog at ${status.path}\\n`\n\t\t\t\t\t: `Model catalog at ${status.path} is fresh; pass --force to download it anyway\\n`,\n\t\t\t);\n\t\t\tyield* writeOut(`${status.path}\\n`);\n\t\t});\n\n\t\treturn yield* program.pipe(Effect.catch(reportFailure));\n\t}),\n);\n"],"mappings":";;;;;;AAQA,IAAA,kBAAeA,QACd,IAAI,SAAS,OAAO,SAAS,SAC7B,OAAO,GAAG,oBAAoB,CAAC,CAAC,WAAW,EAAE,SAAS;CAWrD,OAAO,OAVS,OAAO,IAAI,aAAa;EACvC,MAAM,SAAS,OAAO,aAAa,QAAQ,OAAO,MAAM,EAAE,MAAM,CAAC;EACjE,OAAO,WACN,OAAO,YACJ,8BAA8B,OAAO,KAAK,MAC1C,oBAAoB,OAAO,KAAK,gDACpC;EACA,OAAO,SAAS,GAAG,OAAO,KAAK,GAAG;CACnC,CAEoB,CAAC,CAAC,KAAK,OAAO,MAAM,aAAa,CAAC;AACvD,CAAC,CACF"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { i as Cmd, t as handler } from "./runtime-
|
|
2
|
-
import { f as writeOut, i as reportFailure, m as make, n as OAuthError, t as InvalidInputError, u as writeError } from "./error
|
|
3
|
-
import { a as oauthProviderLabel, n as attempt, o as selectProvider, r as localOps, s as withServer, t as assertServerScope } from "./shared-
|
|
1
|
+
import { i as Cmd, t as handler } from "./runtime-CK2CunDw.mjs";
|
|
2
|
+
import { f as writeOut, i as reportFailure, m as make, n as OAuthError, t as InvalidInputError, u as writeError } from "./error--BWou73I.mjs";
|
|
3
|
+
import { a as oauthProviderLabel, n as attempt, o as selectProvider, r as localOps, s as withServer, t as assertServerScope } from "./shared-BU8-Q5m8.mjs";
|
|
4
4
|
import { Effect, Option } from "effect";
|
|
5
5
|
import { formatOAuthSummary, oauthNotice, oauthRefreshIssue } from "@codeworksh/aikit/oauth/summary";
|
|
6
6
|
//#region src/cli/cmd/handlers/auth/refresh.ts
|
|
@@ -32,4 +32,4 @@ var refresh_default = handler(Cmd.commands.auth.commands.refresh, Effect.fn("CLI
|
|
|
32
32
|
//#endregion
|
|
33
33
|
export { refresh_default as default };
|
|
34
34
|
|
|
35
|
-
//# sourceMappingURL=refresh-
|
|
35
|
+
//# sourceMappingURL=refresh-CH7lLrF3.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"refresh-
|
|
1
|
+
{"version":3,"file":"refresh-CH7lLrF3.mjs","names":["Runtime.handler","Client.make"],"sources":["../../src/cli/cmd/handlers/auth/refresh.ts"],"sourcesContent":["import { formatOAuthSummary, oauthNotice, oauthRefreshIssue } from \"@codeworksh/aikit/oauth/summary\";\nimport { Effect, Option } from \"effect\";\nimport { Runtime } from \"../../../../framework/runtime.ts\";\nimport { InvalidInputError, OAuthError, reportFailure } from \"../../../error.ts\";\nimport { writeError, writeOut } from \"../../../output.ts\";\nimport { Cmd } from \"../../cmd.ts\";\nimport {\n\tassertServerScope,\n\tattempt,\n\tClient,\n\tlocalOps,\n\toauthProviderLabel,\n\tselectProvider,\n\twithServer,\n} from \"./shared.ts\";\n\nexport default Runtime.handler(\n\tCmd.commands.auth.commands.refresh,\n\tEffect.fn(\"CLI.auth.refresh\")(function* ({ server, openaiCodex, githubCopilot, authFile, json }) {\n\t\tconst program = Effect.gen(function* () {\n\t\t\tconst provider = yield* selectProvider({ openaiCodex, githubCopilot });\n\t\t\tconst blocked = oauthRefreshIssue(provider);\n\t\t\tif (blocked !== undefined) return yield* new InvalidInputError({ message: blocked });\n\n\t\t\tconst name = oauthProviderLabel(provider);\n\n\t\t\tif (Option.isSome(server)) {\n\t\t\t\tyield* assertServerScope(authFile);\n\t\t\t\treturn yield* withServer(\n\t\t\t\t\tserver.value,\n\t\t\t\t\tEffect.gen(function* () {\n\t\t\t\t\t\tconst rpc = yield* Client.make;\n\t\t\t\t\t\tconst info = yield* rpc[\"auth.refresh\"]({ provider });\n\t\t\t\t\t\tif (info === null) {\n\t\t\t\t\t\t\treturn yield* new OAuthError({ message: oauthNotice(\"missing\", provider, \"the server\") });\n\t\t\t\t\t\t}\n\t\t\t\t\t\tyield* writeError(`${oauthNotice(\"refreshed\", provider, \"the server\")}\\n`);\n\t\t\t\t\t\tyield* writeOut(formatOAuthSummary(info, { json }));\n\t\t\t\t\t}),\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tconst ops = yield* localOps(provider, authFile);\n\t\t\tconst summary = yield* attempt(`failed to read ${name} credentials`, () => ops.refreshed());\n\t\t\tif (summary === undefined) {\n\t\t\t\treturn yield* new OAuthError({ message: oauthNotice(\"missing\", provider, ops.path) });\n\t\t\t}\n\t\t\tyield* writeError(`${oauthNotice(\"refreshed\", provider, ops.path)}\\n`);\n\t\t\tyield* writeOut(formatOAuthSummary(summary, { json }));\n\t\t});\n\n\t\treturn yield* program.pipe(Effect.catch(reportFailure));\n\t}),\n);\n"],"mappings":";;;;;;AAgBA,IAAA,kBAAeA,QACd,IAAI,SAAS,KAAK,SAAS,SAC3B,OA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|
|
2
|
-
import { d as writeJson, f as writeOut, i as reportFailure, m as make, p as layer,
|
|
3
|
-
import { t as threadFlag } from "./thread-
|
|
1
|
+
import { i as Cmd, t as handler } from "./runtime-CK2CunDw.mjs";
|
|
2
|
+
import { d as writeJson, f as writeOut, i as reportFailure, m as make, p as layer, y as ThreadInfo } from "./error--BWou73I.mjs";
|
|
3
|
+
import { t as threadFlag } from "./thread-BuNept5V.mjs";
|
|
4
4
|
import { Effect, Option } from "effect";
|
|
5
5
|
import { Sandbox, Session } from "@codeworksh/harness/effect";
|
|
6
6
|
//#region src/cli/cmd/handlers/session/relink.ts
|
|
@@ -20,4 +20,4 @@ var relink_default = handler(Cmd.commands.session.commands.relink, Effect.fn("CL
|
|
|
20
20
|
//#endregion
|
|
21
21
|
export { relink_default as default };
|
|
22
22
|
|
|
23
|
-
//# sourceMappingURL=relink-
|
|
23
|
+
//# sourceMappingURL=relink-BvrynRLV.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"relink-
|
|
1
|
+
{"version":3,"file":"relink-BvrynRLV.mjs","names":["Runtime.handler","Client.make","Client.layer"],"sources":["../../src/cli/cmd/handlers/session/relink.ts"],"sourcesContent":["import { Sandbox, Session } from \"@codeworksh/harness/effect\";\nimport { Effect, Option } from \"effect\";\nimport { Runtime } from \"../../../../framework/runtime.ts\";\nimport { Client } from \"../../../../server/client.ts\";\nimport { ThreadInfo } from \"../../../../server/contract.ts\";\nimport { reportFailure } from \"../../../error.ts\";\nimport { writeJson, writeOut } from \"../../../output.ts\";\nimport { threadFlag } from \"../../../thread.ts\";\nimport { Cmd } from \"../../cmd.ts\";\n\nexport default Runtime.handler(\n\tCmd.commands.session.commands.relink,\n\tEffect.fn(\"CLI.session.relink\")(function* ({ session, thread, directory, sandboxId, json, server }) {\n\t\tconst program = Effect.gen(function* () {\n\t\t\tconst threadId = yield* threadFlag(thread);\n\t\t\tconst rpc = yield* Client.make;\n\t\t\tconst info = yield* rpc[\"session.relink\"]({\n\t\t\t\tsessionId: Session.SessionSchema.ID.make(session),\n\t\t\t\t...(threadId === undefined ? {} : { threadId }),\n\t\t\t\t...(Option.isNone(sandboxId) ? {} : { sandbox: { id: Sandbox.SandboxInstance.ID.make(sandboxId.value) } }),\n\t\t\t\t...(Option.isNone(directory) ? {} : { directory: directory.value }),\n\t\t\t});\n\t\t\tif (json) return yield* writeJson(ThreadInfo, info);\n\t\t\t// Without `--thread` the session's default moved; a thread with its own placement stays put.\n\t\t\tyield* writeOut(\n\t\t\t\tthreadId === undefined\n\t\t\t\t\t? `Moved ${info.session.id} to ${info.session.directory}\\n`\n\t\t\t\t\t: `Moved thread ${info.id} of ${info.session.id} to ${info.placement?.directory ?? info.session.directory}\\n`,\n\t\t\t);\n\t\t});\n\n\t\treturn yield* program.pipe(Effect.provide(Client.layer(server)), Effect.scoped, Effect.catch(reportFailure));\n\t}),\n);\n"],"mappings":";;;;;;AAUA,IAAA,iBAAeA,QACd,IAAI,SAAS,QAAQ,SAAS,QAC9B,OAAO,GAAG,oBAAoB,CAAC,CAAC,WAAW,EAAE,SAAS,QAAQ,WAAW,WAAW,MAAM,UAAU;CAmBnG,OAAO,OAlBS,OAAO,IAAI,aAAa;EACvC,MAAM,WAAW,OAAO,WAAW,MAAM;EAEzC,MAAM,OAAO,QAAO,OADDC,KAAAA,CACK,iBAAiB,CAAC;GACzC,WAAW,QAAQ,cAAc,GAAG,KAAK,OAAO;GAChD,GAAI,aAAa,KAAA,IAAY,CAAC,IAAI,EAAE,SAAS;GAC7C,GAAI,OAAO,OAAO,SAAS,IAAI,CAAC,IAAI,EAAE,SAAS,EAAE,IAAI,QAAQ,gBAAgB,GAAG,KAAK,UAAU,KAAK,EAAE,EAAE;GACxG,GAAI,OAAO,OAAO,SAAS,IAAI,CAAC,IAAI,EAAE,WAAW,UAAU,MAAM;EAClE,CAAC;EACD,IAAI,MAAM,OAAO,OAAO,UAAU,YAAY,IAAI;EAElD,OAAO,SACN,aAAa,KAAA,IACV,SAAS,KAAK,QAAQ,GAAG,MAAM,KAAK,QAAQ,UAAU,MACtD,gBAAgB,KAAK,GAAG,MAAM,KAAK,QAAQ,GAAG,MAAM,KAAK,WAAW,aAAa,KAAK,QAAQ,UAAU,GAC5G;CACD,CAEoB,CAAC,CAAC,KAAK,OAAO,QAAQC,MAAa,MAAM,CAAC,GAAG,OAAO,QAAQ,OAAO,MAAM,aAAa,CAAC;AAC5G,CAAC,CACF"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as Cmd, t as handler } from "./runtime-
|
|
2
|
-
import { f as writeOut, i as reportFailure, m as make, p as layer } from "./error
|
|
1
|
+
import { i as Cmd, t as handler } from "./runtime-CK2CunDw.mjs";
|
|
2
|
+
import { f as writeOut, i as reportFailure, m as make, p as layer } from "./error--BWou73I.mjs";
|
|
3
3
|
import { Effect } from "effect";
|
|
4
4
|
//#region src/cli/cmd/handlers/plugin/reload.ts
|
|
5
5
|
/**
|
|
@@ -23,4 +23,4 @@ var reload_default = handler(Cmd.commands.plugin.commands.reload, Effect.fn("CLI
|
|
|
23
23
|
//#endregion
|
|
24
24
|
export { reload_default as default };
|
|
25
25
|
|
|
26
|
-
//# sourceMappingURL=reload-
|
|
26
|
+
//# sourceMappingURL=reload-qYk-KlpL.mjs.map
|