@codeworksh/cli 0.0.1-dev.20260918042316 → 0.0.1-dev.20260922183613
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +94 -0
- package/add--i7mPR73.mjs +81 -0
- package/add--i7mPR73.mjs.map +1 -0
- package/{catalog-Cv1zoZ5S.mjs → catalog-DJxy_lne.mjs} +2 -2
- package/{catalog-Cv1zoZ5S.mjs.map → catalog-DJxy_lne.mjs.map} +1 -1
- package/check-Dq2WOgap.mjs +47 -0
- package/check-Dq2WOgap.mjs.map +1 -0
- package/commonjs-BDiLMfFF.mjs +160 -0
- package/commonjs-BDiLMfFF.mjs.map +1 -0
- package/definitions-Dfwyyv_K.mjs +3348 -0
- package/definitions-Dfwyyv_K.mjs.map +1 -0
- package/entries-Gfsq7U4P.mjs +48 -0
- package/entries-Gfsq7U4P.mjs.map +1 -0
- package/{error-zJGKAF4a.mjs → error-BrbT9_4g.mjs} +2470 -1853
- package/error-BrbT9_4g.mjs.map +1 -0
- package/{generate-DdscbX3w.mjs → generate-DrGYpD3l.mjs} +3 -3
- package/{generate-DdscbX3w.mjs.map → generate-DrGYpD3l.mjs.map} +1 -1
- package/{harness-BBTdWdhx.mjs → harness-Bgvrr0ZB.mjs} +2 -2
- package/{harness-BBTdWdhx.mjs.map → harness-Bgvrr0ZB.mjs.map} +1 -1
- package/index.d.mts +6 -1
- package/index.mjs +22 -6
- package/index.mjs.map +1 -1
- package/install-DoO4D3fk.mjs +53 -0
- package/install-DoO4D3fk.mjs.map +1 -0
- package/lib-BkWR53Bz.mjs +37659 -0
- package/lib-BkWR53Bz.mjs.map +1 -0
- package/lib-CyynPpjH.mjs +846 -0
- package/lib-CyynPpjH.mjs.map +1 -0
- package/lib-Dw7R2suc.mjs +16078 -0
- package/lib-Dw7R2suc.mjs.map +1 -0
- package/lib-JQygPqgO.mjs +10868 -0
- package/lib-JQygPqgO.mjs.map +1 -0
- package/link-B1zfETsS.mjs +40 -0
- package/link-B1zfETsS.mjs.map +1 -0
- package/list-3OR68HpY.mjs +76 -0
- package/list-3OR68HpY.mjs.map +1 -0
- package/{list-C6BrwuV-.mjs → list-CfPfmfe0.mjs} +4 -4
- package/{list-C6BrwuV-.mjs.map → list-CfPfmfe0.mjs.map} +1 -1
- package/login-GFV3Z9f2.mjs +45 -0
- package/login-GFV3Z9f2.mjs.map +1 -0
- package/logout-D17TQUfo.mjs +29 -0
- package/logout-D17TQUfo.mjs.map +1 -0
- package/p-map-C2WSUhyP.mjs +116 -0
- package/p-map-C2WSUhyP.mjs.map +1 -0
- package/package.json +12 -9
- package/{providers-fO-GJuXn.mjs → providers-DLXs9aWZ.mjs} +4 -4
- package/{providers-fO-GJuXn.mjs.map → providers-DLXs9aWZ.mjs.map} +1 -1
- package/refresh-BTNuP1zL.mjs +35 -0
- package/refresh-BTNuP1zL.mjs.map +1 -0
- package/reload-BzwsCBQq.mjs +26 -0
- package/reload-BzwsCBQq.mjs.map +1 -0
- package/remove-DgB3l5JL.mjs +36 -0
- package/remove-DgB3l5JL.mjs.map +1 -0
- package/{run-CgPOJ-wJ.mjs → run-BVo4XsL6.mjs} +11 -8
- package/run-BVo4XsL6.mjs.map +1 -0
- package/runtime-Dl621FOp.mjs +345 -0
- package/runtime-Dl621FOp.mjs.map +1 -0
- package/{serve-Du6luqoi.mjs → serve-Dpep18-A.mjs} +93 -17
- package/serve-Dpep18-A.mjs.map +1 -0
- package/settings-C52IrA72.mjs +215 -0
- package/settings-C52IrA72.mjs.map +1 -0
- package/shared-Uwjcofff.mjs +115 -0
- package/shared-Uwjcofff.mjs.map +1 -0
- package/status-DPYq2Sx4.mjs +31 -0
- package/status-DPYq2Sx4.mjs.map +1 -0
- package/type-defs-BZxrtlVD.mjs +538 -0
- package/type-defs-BZxrtlVD.mjs.map +1 -0
- package/update-CJrBbHwq.mjs +44 -0
- package/update-CJrBbHwq.mjs.map +1 -0
- package/valid-BWgW_TUl.mjs +354 -0
- package/valid-BWgW_TUl.mjs.map +1 -0
- package/error-zJGKAF4a.mjs.map +0 -1
- package/run-CgPOJ-wJ.mjs.map +0 -1
- package/runtime-DuL-GGrx.mjs +0 -163
- package/runtime-DuL-GGrx.mjs.map +0 -1
- package/serve-Du6luqoi.mjs.map +0 -1
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { St as schema_exports, a as reportFailure, f as writeOut, m as make, p as layer, xt as ID } from "./error-BrbT9_4g.mjs";
|
|
2
|
+
import { i as Cmd, t as handler } from "./runtime-Dl621FOp.mjs";
|
|
3
|
+
import { Effect, Option, Path } from "effect";
|
|
4
|
+
//#region src/cli/cmd/handlers/session/link.ts
|
|
5
|
+
/**
|
|
6
|
+
* Sets `hostDir` on an existing session.
|
|
7
|
+
*
|
|
8
|
+
* **The session ID identifies it; the path is the target.** A project cannot identify a session --
|
|
9
|
+
* it may have many or none, and it is the session that carries the field.
|
|
10
|
+
*
|
|
11
|
+
* The path defaults to the shell's directory, which is both the common case (you are standing in
|
|
12
|
+
* the project you want to link) and safe to default: the CLI runs on the host, so the trust
|
|
13
|
+
* question about naming host paths is about remote clients, not about a local shell's own cwd.
|
|
14
|
+
*
|
|
15
|
+
* Not `session relink`, which moves a session to another checkout of the same project. Different
|
|
16
|
+
* axes -- `relink` changes where the *work* happens, `link` changes which host directory the
|
|
17
|
+
* session is *anchored to* -- and conflating them would recreate the confusion the two names
|
|
18
|
+
* exist to avoid.
|
|
19
|
+
*
|
|
20
|
+
* The anchor is not a settings mechanism. Settings discovery reads it, so do plugin installs, and
|
|
21
|
+
* so will whatever needs a host-side directory next; naming any one of them in the description is
|
|
22
|
+
* what made this read like a settings flag.
|
|
23
|
+
*/
|
|
24
|
+
var link_default = handler(Cmd.commands.session.commands.link, Effect.fn("CLI.session.link")(function* ({ session, path, unlink, server }) {
|
|
25
|
+
return yield* Effect.gen(function* () {
|
|
26
|
+
const nodePath = yield* Path.Path;
|
|
27
|
+
const rpc = yield* make;
|
|
28
|
+
const sessionId = ID.make(session);
|
|
29
|
+
const hostDir = unlink ? void 0 : schema_exports.AbsolutePath.make(nodePath.resolve(Option.getOrElse(path, () => ".")));
|
|
30
|
+
const info = yield* rpc["session.link"]({
|
|
31
|
+
sessionId,
|
|
32
|
+
...hostDir === void 0 ? {} : { hostDir }
|
|
33
|
+
});
|
|
34
|
+
yield* writeOut(info.hostDir === void 0 ? `Unlinked ${info.id}; it now reads the user settings alone.\n` : `Linked ${info.id} to ${info.hostDir}\n`);
|
|
35
|
+
}).pipe(Effect.provide(layer(server)), Effect.scoped, Effect.catch(reportFailure));
|
|
36
|
+
}));
|
|
37
|
+
//#endregion
|
|
38
|
+
export { link_default as default };
|
|
39
|
+
|
|
40
|
+
//# sourceMappingURL=link-B1zfETsS.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"link-B1zfETsS.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,YAAA,GAAqC,KAAK,OAAO;EACvD,MAAM,UAAU,SACb,KAAA,IAAA,eAAA,aACqB,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"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { B as inspect, H as required, J as InstallError, X as SourceError, Y as LoadError, Z as StoreError, a as reportFailure, f as writeOut } from "./error-BrbT9_4g.mjs";
|
|
2
|
+
import { i as Cmd, t as handler } from "./runtime-Dl621FOp.mjs";
|
|
3
|
+
import { r as read } from "./entries-Gfsq7U4P.mjs";
|
|
4
|
+
import { Effect, Schema } from "effect";
|
|
5
|
+
//#region src/cli/cmd/handlers/plugin/list.ts
|
|
6
|
+
/**
|
|
7
|
+
* Two columns: what was written, and what it turned out to be.
|
|
8
|
+
*
|
|
9
|
+
* **The second column doubles as the state, for free.** An ID cannot be known without importing
|
|
10
|
+
* the module -- the store records nothing about the plugin inside a package -- so printing one is
|
|
11
|
+
* proof that everything worked: the entry parsed, the store had it, the import succeeded, and the
|
|
12
|
+
* definition validated. When any of that fails there is no ID to print, and the reason goes in its
|
|
13
|
+
* place.
|
|
14
|
+
*
|
|
15
|
+
* **Nothing is stored to make that work.** The reason is the live error from this run, not a
|
|
16
|
+
* record of an older one: a stored failure goes stale the moment someone fixes the cause, and a
|
|
17
|
+
* list still printing `plugin-import-failed` after you installed the missing dependency is worse
|
|
18
|
+
* than one that says nothing. The work is cheap and local -- a parse, a lookup and an import.
|
|
19
|
+
*
|
|
20
|
+
* (`checkedAt`/`outdated` are stored, for the opposite reason: those come from the network, so
|
|
21
|
+
* re-obtaining them is expensive and a slightly stale answer is the right trade. Local facts are
|
|
22
|
+
* recomputed; remote facts are cached.)
|
|
23
|
+
*/
|
|
24
|
+
const isSourceError = Schema.is(SourceError);
|
|
25
|
+
const isInstallError = Schema.is(InstallError);
|
|
26
|
+
const isStoreError = Schema.is(StoreError);
|
|
27
|
+
const isLoadError = Schema.is(LoadError);
|
|
28
|
+
/** The §5.5 reason slug, which is the same string the CLI prints and a log line carries. */
|
|
29
|
+
const reasonOf = (error) => isSourceError(error) || isInstallError(error) || isStoreError(error) || isLoadError(error) ? {
|
|
30
|
+
reason: error.reason,
|
|
31
|
+
message: error.message
|
|
32
|
+
} : {
|
|
33
|
+
reason: "plugin-load-failed",
|
|
34
|
+
message: String(error)
|
|
35
|
+
};
|
|
36
|
+
var list_default = handler(Cmd.commands.plugin.commands.list, Effect.fn("CLI.plugin.list")(function* ({ verbose }) {
|
|
37
|
+
return yield* Effect.gen(function* () {
|
|
38
|
+
const shared = yield* Cmd.spec;
|
|
39
|
+
const { entries, cache } = yield* read(shared);
|
|
40
|
+
if (entries.length === 0) {
|
|
41
|
+
yield* writeOut("No plugins are configured.\n");
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
const rows = [];
|
|
45
|
+
for (const entry of entries) {
|
|
46
|
+
const inspected = yield* inspect(entry.reference, {
|
|
47
|
+
cache,
|
|
48
|
+
hostDir: entry.from,
|
|
49
|
+
file: entry.file,
|
|
50
|
+
install: required
|
|
51
|
+
}).pipe(Effect.result);
|
|
52
|
+
rows.push(inspected._tag === "Success" ? {
|
|
53
|
+
written: entry.written,
|
|
54
|
+
file: entry.file,
|
|
55
|
+
state: inspected.success.id
|
|
56
|
+
} : {
|
|
57
|
+
written: entry.written,
|
|
58
|
+
file: entry.file,
|
|
59
|
+
state: reasonOf(inspected.failure).reason,
|
|
60
|
+
detail: reasonOf(inspected.failure).message
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
const width = Math.max(...rows.map((row) => row.written.length));
|
|
64
|
+
for (const row of rows) {
|
|
65
|
+
yield* writeOut(`${row.written.padEnd(width)} ${row.state}\n`);
|
|
66
|
+
if (verbose) {
|
|
67
|
+
if (row.detail !== void 0) yield* writeOut(`${" ".repeat(width)} ${row.detail}\n`);
|
|
68
|
+
yield* writeOut(`${" ".repeat(width)} declared in: ${row.file}\n`);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}).pipe(Effect.catch(reportFailure));
|
|
72
|
+
}));
|
|
73
|
+
//#endregion
|
|
74
|
+
export { list_default as default };
|
|
75
|
+
|
|
76
|
+
//# sourceMappingURL=list-3OR68HpY.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-3OR68HpY.mjs","names":["Plugin.SourceError","Plugin.InstallError","Plugin.StoreError","Plugin.LoadError","Runtime.handler","Plugin.inspect","Plugin.resolveCached"],"sources":["../../src/cli/cmd/handlers/plugin/list.ts"],"sourcesContent":["import { Plugin } from \"@codeworksh/harness/effect\";\nimport { Effect, Schema } from \"effect\";\nimport { Runtime } from \"../../../../framework/runtime.ts\";\nimport { reportFailure } from \"../../../error.ts\";\nimport { writeOut } from \"../../../output.ts\";\nimport { Cmd } from \"../../cmd.ts\";\nimport { read } from \"./entries.ts\";\n\n/**\n * Two columns: what was written, and what it turned out to be.\n *\n * **The second column doubles as the state, for free.** An ID cannot be known without importing\n * the module -- the store records nothing about the plugin inside a package -- so printing one is\n * proof that everything worked: the entry parsed, the store had it, the import succeeded, and the\n * definition validated. When any of that fails there is no ID to print, and the reason goes in its\n * place.\n *\n * **Nothing is stored to make that work.** The reason is the live error from this run, not a\n * record of an older one: a stored failure goes stale the moment someone fixes the cause, and a\n * list still printing `plugin-import-failed` after you installed the missing dependency is worse\n * than one that says nothing. The work is cheap and local -- a parse, a lookup and an import.\n *\n * (`checkedAt`/`outdated` are stored, for the opposite reason: those come from the network, so\n * re-obtaining them is expensive and a slightly stale answer is the right trade. Local facts are\n * recomputed; remote facts are cached.)\n */\nconst isSourceError = Schema.is(Plugin.SourceError);\nconst isInstallError = Schema.is(Plugin.InstallError);\nconst isStoreError = Schema.is(Plugin.StoreError);\nconst isLoadError = Schema.is(Plugin.LoadError);\n\n/** The §5.5 reason slug, which is the same string the CLI prints and a log line carries. */\nconst reasonOf = (error: unknown): { readonly reason: string; readonly message: string } =>\n\tisSourceError(error) || isInstallError(error) || isStoreError(error) || isLoadError(error)\n\t\t? { reason: error.reason, message: error.message }\n\t\t: { reason: \"plugin-load-failed\", message: String(error) };\n\nexport default Runtime.handler(\n\tCmd.commands.plugin.commands.list,\n\tEffect.fn(\"CLI.plugin.list\")(function* ({ verbose }) {\n\t\tconst program = Effect.gen(function* () {\n\t\t\tconst shared = yield* Cmd.spec;\n\t\t\tconst { entries, cache } = yield* read(shared);\n\t\t\tif (entries.length === 0) {\n\t\t\t\tyield* writeOut(\"No plugins are configured.\\n\");\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst rows: Array<{ written: string; file: string; state: string; detail?: string }> = [];\n\t\t\tfor (const entry of entries) {\n\t\t\t\t// Resolve-only: listing what is configured must never install anything.\n\t\t\t\tconst inspected = yield* Plugin.inspect(entry.reference, {\n\t\t\t\t\tcache,\n\t\t\t\t\thostDir: entry.from,\n\t\t\t\t\tfile: entry.file,\n\t\t\t\t\tinstall: Plugin.resolveCached,\n\t\t\t\t}).pipe(Effect.result);\n\t\t\t\trows.push(\n\t\t\t\t\tinspected._tag === \"Success\"\n\t\t\t\t\t\t? { written: entry.written, file: entry.file, state: inspected.success.id }\n\t\t\t\t\t\t: {\n\t\t\t\t\t\t\t\twritten: entry.written,\n\t\t\t\t\t\t\t\tfile: entry.file,\n\t\t\t\t\t\t\t\tstate: reasonOf(inspected.failure).reason,\n\t\t\t\t\t\t\t\tdetail: reasonOf(inspected.failure).message,\n\t\t\t\t\t\t\t},\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// The left column is the reference exactly as the entry spells it, because that is the\n\t\t\t// string a person will search their settings for.\n\t\t\tconst width = Math.max(...rows.map((row) => row.written.length));\n\t\t\tfor (const row of rows) {\n\t\t\t\tyield* writeOut(`${row.written.padEnd(width)} ${row.state}\\n`);\n\t\t\t\tif (verbose) {\n\t\t\t\t\tif (row.detail !== undefined) yield* writeOut(`${\" \".repeat(width)} ${row.detail}\\n`);\n\t\t\t\t\tyield* writeOut(`${\" \".repeat(width)} declared in: ${row.file}\\n`);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\treturn yield* program.pipe(Effect.catch(reportFailure));\n\t}),\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AA0BA,MAAM,gBAAgB,OAAO,GAAGA,WAAkB;AAClD,MAAM,iBAAiB,OAAO,GAAGC,YAAmB;AACpD,MAAM,eAAe,OAAO,GAAGC,UAAiB;AAChD,MAAM,cAAc,OAAO,GAAGC,SAAgB;;AAG9C,MAAM,YAAY,UACjB,cAAc,KAAK,KAAK,eAAe,KAAK,KAAK,aAAa,KAAK,KAAK,YAAY,KAAK,IACtF;CAAE,QAAQ,MAAM;CAAQ,SAAS,MAAM;AAAQ,IAC/C;CAAE,QAAQ;CAAsB,SAAS,OAAO,KAAK;AAAE;AAE3D,IAAA,eAAeC,QACd,IAAI,SAAS,OAAO,SAAS,MAC7B,OAAO,GAAG,iBAAiB,CAAC,CAAC,WAAW,EAAE,WAAW;CA0CpD,OAAO,OAzCS,OAAO,IAAI,aAAa;EACvC,MAAM,SAAS,OAAO,IAAI;EAC1B,MAAM,EAAE,SAAS,UAAU,OAAO,KAAK,MAAM;EAC7C,IAAI,QAAQ,WAAW,GAAG;GACzB,OAAO,SAAS,8BAA8B;GAC9C;EACD;EAEA,MAAM,OAAiF,CAAC;EACxF,KAAK,MAAM,SAAS,SAAS;GAE5B,MAAM,YAAY,OAAOC,QAAe,MAAM,WAAW;IACxD;IACA,SAAS,MAAM;IACf,MAAM,MAAM;IACZ,SAASC;GACV,CAAC,CAAC,CAAC,KAAK,OAAO,MAAM;GACrB,KAAK,KACJ,UAAU,SAAS,YAChB;IAAE,SAAS,MAAM;IAAS,MAAM,MAAM;IAAM,OAAO,UAAU,QAAQ;GAAG,IACxE;IACA,SAAS,MAAM;IACf,MAAM,MAAM;IACZ,OAAO,SAAS,UAAU,OAAO,CAAC,CAAC;IACnC,QAAQ,SAAS,UAAU,OAAO,CAAC,CAAC;GACrC,CACH;EACD;EAIA,MAAM,QAAQ,KAAK,IAAI,GAAG,KAAK,KAAK,QAAQ,IAAI,QAAQ,MAAM,CAAC;EAC/D,KAAK,MAAM,OAAO,MAAM;GACvB,OAAO,SAAS,GAAG,IAAI,QAAQ,OAAO,KAAK,EAAE,IAAI,IAAI,MAAM,GAAG;GAC9D,IAAI,SAAS;IACZ,IAAI,IAAI,WAAW,KAAA,GAAW,OAAO,SAAS,GAAG,IAAI,OAAO,KAAK,EAAE,IAAI,IAAI,OAAO,GAAG;IACrF,OAAO,SAAS,GAAG,IAAI,OAAO,KAAK,EAAE,iBAAiB,IAAI,KAAK,GAAG;GACnE;EACD;CACD,CAEoB,CAAC,CAAC,KAAK,OAAO,MAAM,aAAa,CAAC;AACvD,CAAC,CACF"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { t as loadCatalog } from "./catalog-
|
|
1
|
+
import { a as reportFailure, f as writeOut, t as InvalidInputError } from "./error-BrbT9_4g.mjs";
|
|
2
|
+
import { i as Cmd, t as handler } from "./runtime-Dl621FOp.mjs";
|
|
3
|
+
import { t as loadCatalog } from "./catalog-DJxy_lne.mjs";
|
|
4
4
|
import { Effect, Option } from "effect";
|
|
5
5
|
//#region src/cli/cmd/handlers/models/list.ts
|
|
6
6
|
var list_default = handler(Cmd.commands.models, Effect.fn("CLI.models.list")(function* ({ provider }) {
|
|
@@ -25,4 +25,4 @@ var list_default = handler(Cmd.commands.models, Effect.fn("CLI.models.list")(fun
|
|
|
25
25
|
//#endregion
|
|
26
26
|
export { list_default as default };
|
|
27
27
|
|
|
28
|
-
//# sourceMappingURL=list-
|
|
28
|
+
//# sourceMappingURL=list-CfPfmfe0.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list-
|
|
1
|
+
{"version":3,"file":"list-CfPfmfe0.mjs","names":["Runtime.handler"],"sources":["../../src/cli/cmd/handlers/models/list.ts"],"sourcesContent":["import { 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 { loadCatalog } 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\tconst catalog = yield* loadCatalog;\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":";;;;;AAOA,IAAA,eAAeA,QACd,IAAI,SAAS,QACb,OAAO,GAAG,iBAAiB,CAAC,CAAC,WAAW,EAAE,YAAY;CA0BrD,OAAO,OAzBS,OAAO,IAAI,aAAa;EACvC,MAAM,UAAU,OAAO;EACvB,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"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { a as reportFailure, d as writeError, f as writeOut, m as make, t as InvalidInputError } from "./error-BrbT9_4g.mjs";
|
|
2
|
+
import { i as Cmd, t as handler } from "./runtime-Dl621FOp.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-Uwjcofff.mjs";
|
|
4
|
+
import { Effect, Option } from "effect";
|
|
5
|
+
import { formatOAuthSummary, oauthLoginIssue, oauthNotice } from "@codeworksh/aikit/oauth/summary";
|
|
6
|
+
//#region src/cli/cmd/handlers/auth/login.ts
|
|
7
|
+
var login_default = handler(Cmd.commands.auth.commands.login, Effect.fn("CLI.auth.login")(function* ({ server, openaiCodex, githubCopilot, authFile, browser, device, enterprise, enableModels, json }) {
|
|
8
|
+
return yield* Effect.gen(function* () {
|
|
9
|
+
const provider = yield* selectProvider({
|
|
10
|
+
openaiCodex,
|
|
11
|
+
githubCopilot
|
|
12
|
+
});
|
|
13
|
+
const issue = oauthLoginIssue(provider, {
|
|
14
|
+
device,
|
|
15
|
+
enableModels,
|
|
16
|
+
...Option.isSome(enterprise) && { enterprise: enterprise.value }
|
|
17
|
+
});
|
|
18
|
+
if (issue !== void 0) return yield* new InvalidInputError({ message: issue });
|
|
19
|
+
const name = oauthProviderLabel(provider);
|
|
20
|
+
const options = {
|
|
21
|
+
browser,
|
|
22
|
+
device,
|
|
23
|
+
enterprise,
|
|
24
|
+
enableModels
|
|
25
|
+
};
|
|
26
|
+
if (Option.isSome(server)) {
|
|
27
|
+
yield* assertServerScope(authFile);
|
|
28
|
+
return yield* withServer(server.value, Effect.gen(function* () {
|
|
29
|
+
const rpc = yield* make;
|
|
30
|
+
const { wire } = yield* attempt(`${name} login failed`, () => makeOps(provider, { persist: false }).login(options));
|
|
31
|
+
const info = yield* rpc["auth.save"]({ credentials: wire });
|
|
32
|
+
yield* writeError(`${oauthNotice("saved", provider, "the server")}\n`);
|
|
33
|
+
yield* writeOut(formatOAuthSummary(info, { json }));
|
|
34
|
+
}));
|
|
35
|
+
}
|
|
36
|
+
const ops = yield* localOps(provider, authFile);
|
|
37
|
+
const { summary } = yield* attempt(`${name} login failed`, () => ops.login(options));
|
|
38
|
+
yield* writeError(`${oauthNotice("saved", provider, ops.path)}\n`);
|
|
39
|
+
yield* writeOut(formatOAuthSummary(summary, { json }));
|
|
40
|
+
}).pipe(Effect.catch(reportFailure));
|
|
41
|
+
}));
|
|
42
|
+
//#endregion
|
|
43
|
+
export { login_default as default };
|
|
44
|
+
|
|
45
|
+
//# sourceMappingURL=login-GFV3Z9f2.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"login-GFV3Z9f2.mjs","names":["Runtime.handler","Client.make"],"sources":["../../src/cli/cmd/handlers/auth/login.ts"],"sourcesContent":["import { formatOAuthSummary, oauthLoginIssue, oauthNotice } from \"@codeworksh/aikit/oauth/summary\";\nimport { Effect, Option } from \"effect\";\nimport { Runtime } from \"../../../../framework/runtime.ts\";\nimport { InvalidInputError, reportFailure } from \"../../../error.ts\";\nimport { writeError, writeOut } from \"../../../output.ts\";\nimport { Cmd } from \"../../cmd.ts\";\nimport {\n\tassertServerScope,\n\tattempt,\n\tClient,\n\tlocalOps,\n\tmakeOps,\n\toauthProviderLabel,\n\tselectProvider,\n\twithServer,\n\ttype LoginOptions,\n} from \"./shared.ts\";\n\nexport default Runtime.handler(\n\tCmd.commands.auth.commands.login,\n\tEffect.fn(\"CLI.auth.login\")(function* ({\n\t\tserver,\n\t\topenaiCodex,\n\t\tgithubCopilot,\n\t\tauthFile,\n\t\tbrowser,\n\t\tdevice,\n\t\tenterprise,\n\t\tenableModels,\n\t\tjson,\n\t}) {\n\t\tconst program = Effect.gen(function* () {\n\t\t\tconst provider = yield* selectProvider({ openaiCodex, githubCopilot });\n\t\t\tconst issue = oauthLoginIssue(provider, {\n\t\t\t\tdevice,\n\t\t\t\tenableModels,\n\t\t\t\t...(Option.isSome(enterprise) && { enterprise: enterprise.value }),\n\t\t\t});\n\t\t\tif (issue !== undefined) return yield* new InvalidInputError({ message: issue });\n\n\t\t\tconst name = oauthProviderLabel(provider);\n\t\t\tconst options: LoginOptions = { browser, device, enterprise, enableModels };\n\n\t\t\tif (Option.isSome(server)) {\n\t\t\t\tyield* assertServerScope(authFile);\n\t\t\t\treturn yield* withServer(\n\t\t\t\t\tserver.value,\n\t\t\t\t\tEffect.gen(function* () {\n\t\t\t\t\t\tconst rpc = yield* Client.make;\n\t\t\t\t\t\t// The browser callback and the device prompt both need this\n\t\t\t\t\t\t// terminal, so the login runs here and only the result travels.\n\t\t\t\t\t\tconst { wire } = yield* attempt(`${name} login failed`, () =>\n\t\t\t\t\t\t\tmakeOps(provider, { persist: false }).login(options),\n\t\t\t\t\t\t);\n\t\t\t\t\t\tconst info = yield* rpc[\"auth.save\"]({ credentials: wire });\n\t\t\t\t\t\tyield* writeError(`${oauthNotice(\"saved\", provider, \"the server\")}\\n`);\n\t\t\t\t\t\tyield* writeOut(formatOAuthSummary(info, { json }));\n\t\t\t\t\t}),\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tconst ops = yield* localOps(provider, authFile);\n\t\t\tconst { summary } = yield* attempt(`${name} login failed`, () => ops.login(options));\n\t\t\tyield* writeError(`${oauthNotice(\"saved\", provider, ops.path)}\\n`);\n\t\t\tyield* writeOut(formatOAuthSummary(summary, { json }));\n\t\t});\n\n\t\treturn yield* program.pipe(Effect.catch(reportFailure));\n\t}),\n);\n"],"mappings":";;;;;;AAkBA,IAAA,gBAAeA,QACd,IAAI,SAAS,KAAK,SAAS,OAC3B,OAAO,GAAG,gBAAgB,CAAC,CAAC,WAAW,EACtC,QACA,aACA,eACA,UACA,SACA,QACA,YACA,cACA,QACE;CAqCF,OAAO,OApCS,OAAO,IAAI,aAAa;EACvC,MAAM,WAAW,OAAO,eAAe;GAAE;GAAa;EAAc,CAAC;EACrE,MAAM,QAAQ,gBAAgB,UAAU;GACvC;GACA;GACA,GAAI,OAAO,OAAO,UAAU,KAAK,EAAE,YAAY,WAAW,MAAM;EACjE,CAAC;EACD,IAAI,UAAU,KAAA,GAAW,OAAO,OAAO,IAAI,kBAAkB,EAAE,SAAS,MAAM,CAAC;EAE/E,MAAM,OAAO,mBAAmB,QAAQ;EACxC,MAAM,UAAwB;GAAE;GAAS;GAAQ;GAAY;EAAa;EAE1E,IAAI,OAAO,OAAO,MAAM,GAAG;GAC1B,OAAO,kBAAkB,QAAQ;GACjC,OAAO,OAAO,WACb,OAAO,OACP,OAAO,IAAI,aAAa;IACvB,MAAM,MAAM,OAAOC;IAGnB,MAAM,EAAE,SAAS,OAAO,QAAQ,GAAG,KAAK,sBACvC,QAAQ,UAAU,EAAE,SAAS,MAAM,CAAC,CAAC,CAAC,MAAM,OAAO,CACpD;IACA,MAAM,OAAO,OAAO,IAAI,YAAY,CAAC,EAAE,aAAa,KAAK,CAAC;IAC1D,OAAO,WAAW,GAAG,YAAY,SAAS,UAAU,YAAY,EAAE,GAAG;IACrE,OAAO,SAAS,mBAAmB,MAAM,EAAE,KAAK,CAAC,CAAC;GACnD,CAAC,CACF;EACD;EAEA,MAAM,MAAM,OAAO,SAAS,UAAU,QAAQ;EAC9C,MAAM,EAAE,YAAY,OAAO,QAAQ,GAAG,KAAK,sBAAsB,IAAI,MAAM,OAAO,CAAC;EACnF,OAAO,WAAW,GAAG,YAAY,SAAS,UAAU,IAAI,IAAI,EAAE,GAAG;EACjE,OAAO,SAAS,mBAAmB,SAAS,EAAE,KAAK,CAAC,CAAC;CACtD,CAEoB,CAAC,CAAC,KAAK,OAAO,MAAM,aAAa,CAAC;AACvD,CAAC,CACF"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { a as reportFailure, d as writeError, m as make } from "./error-BrbT9_4g.mjs";
|
|
2
|
+
import { i as Cmd, t as handler } from "./runtime-Dl621FOp.mjs";
|
|
3
|
+
import { a as oauthProviderLabel, n as attempt, o as selectProvider, r as localOps, s as withServer, t as assertServerScope } from "./shared-Uwjcofff.mjs";
|
|
4
|
+
import { Effect, Option } from "effect";
|
|
5
|
+
import { oauthNotice } from "@codeworksh/aikit/oauth/summary";
|
|
6
|
+
//#region src/cli/cmd/handlers/auth/logout.ts
|
|
7
|
+
var logout_default = handler(Cmd.commands.auth.commands.logout, Effect.fn("CLI.auth.logout")(function* ({ server, openaiCodex, githubCopilot, authFile }) {
|
|
8
|
+
return yield* Effect.gen(function* () {
|
|
9
|
+
const provider = yield* selectProvider({
|
|
10
|
+
openaiCodex,
|
|
11
|
+
githubCopilot
|
|
12
|
+
});
|
|
13
|
+
const name = oauthProviderLabel(provider);
|
|
14
|
+
if (Option.isSome(server)) {
|
|
15
|
+
yield* assertServerScope(authFile);
|
|
16
|
+
return yield* withServer(server.value, Effect.gen(function* () {
|
|
17
|
+
yield* (yield* make)["auth.logout"]({ provider });
|
|
18
|
+
yield* writeError(`${oauthNotice("cleared", provider, "the server")}\n`);
|
|
19
|
+
}));
|
|
20
|
+
}
|
|
21
|
+
const ops = yield* localOps(provider, authFile);
|
|
22
|
+
yield* attempt(`failed to clear ${name} credentials`, () => ops.logout());
|
|
23
|
+
yield* writeError(`${oauthNotice("cleared", provider, ops.path)}\n`);
|
|
24
|
+
}).pipe(Effect.catch(reportFailure));
|
|
25
|
+
}));
|
|
26
|
+
//#endregion
|
|
27
|
+
export { logout_default as default };
|
|
28
|
+
|
|
29
|
+
//# sourceMappingURL=logout-D17TQUfo.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logout-D17TQUfo.mjs","names":["Runtime.handler","Client.make"],"sources":["../../src/cli/cmd/handlers/auth/logout.ts"],"sourcesContent":["import { oauthNotice } from \"@codeworksh/aikit/oauth/summary\";\nimport { Effect, Option } from \"effect\";\nimport { Runtime } from \"../../../../framework/runtime.ts\";\nimport { reportFailure } from \"../../../error.ts\";\nimport { writeError } from \"../../../output.ts\";\nimport { Cmd } from \"../../cmd.ts\";\nimport {\n\tassertServerScope,\n\tattempt,\n\tClient,\n\tlocalOps,\n\toauthProviderLabel,\n\tselectProvider,\n\twithServer,\n} from \"./shared.ts\";\n\nexport default Runtime.handler(\n\tCmd.commands.auth.commands.logout,\n\tEffect.fn(\"CLI.auth.logout\")(function* ({ server, openaiCodex, githubCopilot, authFile }) {\n\t\tconst program = Effect.gen(function* () {\n\t\t\tconst provider = yield* selectProvider({ openaiCodex, githubCopilot });\n\t\t\tconst name = oauthProviderLabel(provider);\n\n\t\t\tif (Option.isSome(server)) {\n\t\t\t\tyield* assertServerScope(authFile);\n\t\t\t\treturn yield* withServer(\n\t\t\t\t\tserver.value,\n\t\t\t\t\tEffect.gen(function* () {\n\t\t\t\t\t\tconst rpc = yield* Client.make;\n\t\t\t\t\t\tyield* rpc[\"auth.logout\"]({ provider });\n\t\t\t\t\t\tyield* writeError(`${oauthNotice(\"cleared\", provider, \"the server\")}\\n`);\n\t\t\t\t\t}),\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tconst ops = yield* localOps(provider, authFile);\n\t\t\tyield* attempt(`failed to clear ${name} credentials`, () => ops.logout());\n\t\t\tyield* writeError(`${oauthNotice(\"cleared\", provider, ops.path)}\\n`);\n\t\t});\n\n\t\treturn yield* program.pipe(Effect.catch(reportFailure));\n\t}),\n);\n"],"mappings":";;;;;;AAgBA,IAAA,iBAAeA,QACd,IAAI,SAAS,KAAK,SAAS,QAC3B,OAAO,GAAG,iBAAiB,CAAC,CAAC,WAAW,EAAE,QAAQ,aAAa,eAAe,YAAY;CAsBzF,OAAO,OArBS,OAAO,IAAI,aAAa;EACvC,MAAM,WAAW,OAAO,eAAe;GAAE;GAAa;EAAc,CAAC;EACrE,MAAM,OAAO,mBAAmB,QAAQ;EAExC,IAAI,OAAO,OAAO,MAAM,GAAG;GAC1B,OAAO,kBAAkB,QAAQ;GACjC,OAAO,OAAO,WACb,OAAO,OACP,OAAO,IAAI,aAAa;IAEvB,QAAO,OADYC,KAAAA,CACR,cAAc,CAAC,EAAE,SAAS,CAAC;IACtC,OAAO,WAAW,GAAG,YAAY,WAAW,UAAU,YAAY,EAAE,GAAG;GACxE,CAAC,CACF;EACD;EAEA,MAAM,MAAM,OAAO,SAAS,UAAU,QAAQ;EAC9C,OAAO,QAAQ,mBAAmB,KAAK,qBAAqB,IAAI,OAAO,CAAC;EACxE,OAAO,WAAW,GAAG,YAAY,WAAW,UAAU,IAAI,IAAI,EAAE,GAAG;CACpE,CAEoB,CAAC,CAAC,KAAK,OAAO,MAAM,aAAa,CAAC;AACvD,CAAC,CACF"}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { wt as __esmMin } from "./error-BrbT9_4g.mjs";
|
|
2
|
+
//#region ../../node_modules/.pnpm/p-map@7.0.8/node_modules/p-map/index.js
|
|
3
|
+
async function pMap(iterable, mapper, { concurrency = Number.POSITIVE_INFINITY, stopOnError = true, signal } = {}) {
|
|
4
|
+
return new Promise((resolve_, reject_) => {
|
|
5
|
+
if (iterable[Symbol.iterator] === void 0 && iterable[Symbol.asyncIterator] === void 0) throw new TypeError(`Expected \`input\` to be either an \`Iterable\` or \`AsyncIterable\`, got (${typeof iterable})`);
|
|
6
|
+
if (typeof mapper !== "function") throw new TypeError("Mapper function is required");
|
|
7
|
+
if (!(Number.isSafeInteger(concurrency) && concurrency >= 1 || concurrency === Number.POSITIVE_INFINITY)) throw new TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${concurrency}\` (${typeof concurrency})`);
|
|
8
|
+
const result = [];
|
|
9
|
+
const errors = [];
|
|
10
|
+
const skippedIndexesMap = /* @__PURE__ */ new Map();
|
|
11
|
+
let isRejected = false;
|
|
12
|
+
let isResolved = false;
|
|
13
|
+
let isIterableDone = false;
|
|
14
|
+
let resolvingCount = 0;
|
|
15
|
+
let currentIndex = 0;
|
|
16
|
+
const iterator = iterable[Symbol.asyncIterator] === void 0 ? iterable[Symbol.iterator]() : iterable[Symbol.asyncIterator]();
|
|
17
|
+
const signalListener = () => {
|
|
18
|
+
reject(signal.reason);
|
|
19
|
+
};
|
|
20
|
+
const cleanup = () => {
|
|
21
|
+
signal?.removeEventListener("abort", signalListener);
|
|
22
|
+
};
|
|
23
|
+
const resolve = (value) => {
|
|
24
|
+
resolve_(value);
|
|
25
|
+
cleanup();
|
|
26
|
+
};
|
|
27
|
+
const reject = (reason) => {
|
|
28
|
+
if (isResolved) return;
|
|
29
|
+
isRejected = true;
|
|
30
|
+
isResolved = true;
|
|
31
|
+
reject_(reason);
|
|
32
|
+
cleanup();
|
|
33
|
+
if (!isIterableDone) closeIterator(iterator);
|
|
34
|
+
};
|
|
35
|
+
if (signal) {
|
|
36
|
+
if (signal.aborted) {
|
|
37
|
+
reject(signal.reason);
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
signal.addEventListener("abort", signalListener, { once: true });
|
|
41
|
+
}
|
|
42
|
+
const next = async () => {
|
|
43
|
+
if (isResolved) return;
|
|
44
|
+
const nextItem = isIterableDone ? { done: true } : await iterator.next();
|
|
45
|
+
const index = currentIndex;
|
|
46
|
+
currentIndex++;
|
|
47
|
+
if (nextItem.done) {
|
|
48
|
+
isIterableDone = true;
|
|
49
|
+
if (resolvingCount === 0 && !isResolved) {
|
|
50
|
+
if (!stopOnError && errors.length > 0) {
|
|
51
|
+
reject(new AggregateError(errors));
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
isResolved = true;
|
|
55
|
+
if (skippedIndexesMap.size === 0) {
|
|
56
|
+
resolve(result);
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
const pureResult = [];
|
|
60
|
+
for (const [index, value] of result.entries()) {
|
|
61
|
+
if (skippedIndexesMap.get(index) === pMapSkip) continue;
|
|
62
|
+
pureResult.push(value);
|
|
63
|
+
}
|
|
64
|
+
resolve(pureResult);
|
|
65
|
+
}
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
resolvingCount++;
|
|
69
|
+
(async () => {
|
|
70
|
+
try {
|
|
71
|
+
const element = await nextItem.value;
|
|
72
|
+
if (isResolved) return;
|
|
73
|
+
const value = await mapper(element, index);
|
|
74
|
+
if (value === pMapSkip) skippedIndexesMap.set(index, value);
|
|
75
|
+
result[index] = value;
|
|
76
|
+
} catch (error) {
|
|
77
|
+
if (stopOnError) {
|
|
78
|
+
reject(error);
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
errors.push(error);
|
|
82
|
+
}
|
|
83
|
+
resolvingCount--;
|
|
84
|
+
try {
|
|
85
|
+
await next();
|
|
86
|
+
} catch (error) {
|
|
87
|
+
reject(error);
|
|
88
|
+
}
|
|
89
|
+
})();
|
|
90
|
+
};
|
|
91
|
+
(async () => {
|
|
92
|
+
for (let index = 0; index < concurrency; index++) {
|
|
93
|
+
try {
|
|
94
|
+
await next();
|
|
95
|
+
} catch (error) {
|
|
96
|
+
reject(error);
|
|
97
|
+
break;
|
|
98
|
+
}
|
|
99
|
+
if (isIterableDone || isRejected) break;
|
|
100
|
+
}
|
|
101
|
+
})();
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
async function closeIterator(iterator) {
|
|
105
|
+
try {
|
|
106
|
+
await iterator.return?.();
|
|
107
|
+
} catch {}
|
|
108
|
+
}
|
|
109
|
+
var pMapSkip;
|
|
110
|
+
//#endregion
|
|
111
|
+
__esmMin((() => {
|
|
112
|
+
pMapSkip = Symbol("skip");
|
|
113
|
+
}))();
|
|
114
|
+
export { pMap as default };
|
|
115
|
+
|
|
116
|
+
//# sourceMappingURL=p-map-C2WSUhyP.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"p-map-C2WSUhyP.mjs","names":[],"sources":["../../../../node_modules/.pnpm/p-map@7.0.8/node_modules/p-map/index.js"],"sourcesContent":["export default async function pMap(\n\titerable,\n\tmapper,\n\t{\n\t\tconcurrency = Number.POSITIVE_INFINITY,\n\t\tstopOnError = true,\n\t\tsignal,\n\t} = {},\n) {\n\treturn new Promise((resolve_, reject_) => {\n\t\tif (iterable[Symbol.iterator] === undefined && iterable[Symbol.asyncIterator] === undefined) {\n\t\t\tthrow new TypeError(`Expected \\`input\\` to be either an \\`Iterable\\` or \\`AsyncIterable\\`, got (${typeof iterable})`);\n\t\t}\n\n\t\tif (typeof mapper !== 'function') {\n\t\t\tthrow new TypeError('Mapper function is required');\n\t\t}\n\n\t\tif (!((Number.isSafeInteger(concurrency) && concurrency >= 1) || concurrency === Number.POSITIVE_INFINITY)) {\n\t\t\tthrow new TypeError(`Expected \\`concurrency\\` to be an integer from 1 and up or \\`Infinity\\`, got \\`${concurrency}\\` (${typeof concurrency})`);\n\t\t}\n\n\t\tconst result = [];\n\t\tconst errors = [];\n\t\tconst skippedIndexesMap = new Map();\n\t\tlet isRejected = false;\n\t\tlet isResolved = false;\n\t\tlet isIterableDone = false;\n\t\tlet resolvingCount = 0;\n\t\tlet currentIndex = 0;\n\t\tconst iterator = iterable[Symbol.asyncIterator] === undefined ? iterable[Symbol.iterator]() : iterable[Symbol.asyncIterator]();\n\n\t\tconst signalListener = () => {\n\t\t\treject(signal.reason);\n\t\t};\n\n\t\tconst cleanup = () => {\n\t\t\tsignal?.removeEventListener('abort', signalListener);\n\t\t};\n\n\t\tconst resolve = value => {\n\t\t\tresolve_(value);\n\t\t\tcleanup();\n\t\t};\n\n\t\tconst reject = reason => {\n\t\t\tif (isResolved) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tisRejected = true;\n\t\t\tisResolved = true;\n\t\t\treject_(reason);\n\t\t\tcleanup();\n\n\t\t\tif (!isIterableDone) {\n\t\t\t\tcloseIterator(iterator);\n\t\t\t}\n\t\t};\n\n\t\tif (signal) {\n\t\t\tif (signal.aborted) {\n\t\t\t\treject(signal.reason);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tsignal.addEventListener('abort', signalListener, {once: true});\n\t\t}\n\n\t\tconst next = async () => {\n\t\t\tif (isResolved) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Once the source reported `done`, don't pull again like `for await`. A source like a queue may block in `next()` after it is exhausted, which would hang the completion below.\n\t\t\tconst nextItem = isIterableDone ? {done: true} : await iterator.next();\n\n\t\t\tconst index = currentIndex;\n\t\t\tcurrentIndex++;\n\n\t\t\t// Note: `iterator.next()` can be called many times in parallel.\n\t\t\t// This can cause multiple calls to this `next()` function to\n\t\t\t// receive a `nextItem` with `done === true`.\n\t\t\t// The shutdown logic that rejects/resolves must be protected\n\t\t\t// so it runs only one time as the `skippedIndex` logic is\n\t\t\t// non-idempotent.\n\t\t\tif (nextItem.done) {\n\t\t\t\tisIterableDone = true;\n\n\t\t\t\tif (resolvingCount === 0 && !isResolved) {\n\t\t\t\t\tif (!stopOnError && errors.length > 0) {\n\t\t\t\t\t\treject(new AggregateError(errors)); // eslint-disable-line unicorn/error-message\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tisResolved = true;\n\n\t\t\t\t\tif (skippedIndexesMap.size === 0) {\n\t\t\t\t\t\tresolve(result);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst pureResult = [];\n\n\t\t\t\t\t// Support multiple `pMapSkip`'s.\n\t\t\t\t\tfor (const [index, value] of result.entries()) {\n\t\t\t\t\t\tif (skippedIndexesMap.get(index) === pMapSkip) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tpureResult.push(value);\n\t\t\t\t\t}\n\n\t\t\t\t\tresolve(pureResult);\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tresolvingCount++;\n\n\t\t\t// Intentionally detached\n\t\t\t(async () => {\n\t\t\t\ttry {\n\t\t\t\t\tconst element = await nextItem.value;\n\n\t\t\t\t\tif (isResolved) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst value = await mapper(element, index);\n\n\t\t\t\t\t// Use Map to stage the index of the element.\n\t\t\t\t\tif (value === pMapSkip) {\n\t\t\t\t\t\tskippedIndexesMap.set(index, value);\n\t\t\t\t\t}\n\n\t\t\t\t\tresult[index] = value;\n\t\t\t\t} catch (error) {\n\t\t\t\t\tif (stopOnError) {\n\t\t\t\t\t\treject(error);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\terrors.push(error);\n\t\t\t\t}\n\n\t\t\t\tresolvingCount--;\n\n\t\t\t\t// If the iterable throws we can't really continue regardless of `stopOnError` state\n\t\t\t\t// since an iterable is likely to continue throwing after it throws once.\n\t\t\t\t// If we continue calling `next()` indefinitely we will likely end up\n\t\t\t\t// in an infinite loop of failed iteration.\n\t\t\t\ttry {\n\t\t\t\t\tawait next();\n\t\t\t\t} catch (error) {\n\t\t\t\t\treject(error);\n\t\t\t\t}\n\t\t\t})();\n\t\t};\n\n\t\t// Create the concurrent runners in a detached (non-awaited)\n\t\t// promise. We need this so we can await the `next()` calls\n\t\t// to stop creating runners before hitting the concurrency limit\n\t\t// if the iterable has already been marked as done.\n\t\t// NOTE: We *must* do this for async iterators otherwise we'll spin up\n\t\t// infinite `next()` calls by default and never start the event loop.\n\t\t(async () => {\n\t\t\tfor (let index = 0; index < concurrency; index++) {\n\t\t\t\ttry {\n\t\t\t\t\t// eslint-disable-next-line no-await-in-loop\n\t\t\t\t\tawait next();\n\t\t\t\t} catch (error) {\n\t\t\t\t\treject(error);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif (isIterableDone || isRejected) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t})();\n\t});\n}\n\nexport function pMapIterable(\n\titerable,\n\tmapper,\n\t{\n\t\tconcurrency = Number.POSITIVE_INFINITY,\n\t\tbackpressure = concurrency,\n\t} = {},\n) {\n\tif (iterable[Symbol.iterator] === undefined && iterable[Symbol.asyncIterator] === undefined) {\n\t\tthrow new TypeError(`Expected \\`input\\` to be either an \\`Iterable\\` or \\`AsyncIterable\\`, got (${typeof iterable})`);\n\t}\n\n\tif (typeof mapper !== 'function') {\n\t\tthrow new TypeError('Mapper function is required');\n\t}\n\n\tif (!((Number.isSafeInteger(concurrency) && concurrency >= 1) || concurrency === Number.POSITIVE_INFINITY)) {\n\t\tthrow new TypeError(`Expected \\`concurrency\\` to be an integer from 1 and up or \\`Infinity\\`, got \\`${concurrency}\\` (${typeof concurrency})`);\n\t}\n\n\tif (!((Number.isSafeInteger(backpressure) && backpressure >= concurrency) || backpressure === Number.POSITIVE_INFINITY)) {\n\t\tthrow new TypeError(`Expected \\`backpressure\\` to be an integer from \\`concurrency\\` (${concurrency}) and up or \\`Infinity\\`, got \\`${backpressure}\\` (${typeof backpressure})`);\n\t}\n\n\treturn {\n\t\tasync * [Symbol.asyncIterator]() {\n\t\t\tconst iterator = iterable[Symbol.asyncIterator] === undefined ? iterable[Symbol.iterator]() : iterable[Symbol.asyncIterator]();\n\n\t\t\tconst promises = [];\n\t\t\tlet pendingPromisesCount = 0;\n\t\t\tlet isDone = false;\n\t\t\tlet isIterableDone = false;\n\t\t\tlet index = 0;\n\n\t\t\tfunction trySpawn() {\n\t\t\t\t// Don't pull again once the source reported `done`, like `for await`. A source like a queue may block in `next()` after it is exhausted.\n\t\t\t\tif (isDone || isIterableDone || !(pendingPromisesCount < concurrency && promises.length < backpressure)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tpendingPromisesCount++;\n\n\t\t\t\t// Errors must be returned as a value instead of rejecting, otherwise a promise that\n\t\t\t\t// the consumer abandons after an earlier error becomes an unhandled rejection.\n\t\t\t\tconst promise = (async () => {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst {done, value} = await iterator.next();\n\n\t\t\t\t\t\tif (done) {\n\t\t\t\t\t\t\tisIterableDone = true;\n\t\t\t\t\t\t\tpendingPromisesCount--;\n\t\t\t\t\t\t\treturn {done: true};\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Spawn if still below concurrency and backpressure limit\n\t\t\t\t\t\ttrySpawn();\n\n\t\t\t\t\t\tconst currentIndex = index++;\n\t\t\t\t\t\tconst element = await value;\n\n\t\t\t\t\t\t// The consumer stopped iterating or a mapper threw while this input was pending, so drop it instead of doing work nobody will consume.\n\t\t\t\t\t\tif (isDone) {\n\t\t\t\t\t\t\tpendingPromisesCount--;\n\t\t\t\t\t\t\treturn {done: false, value: pMapSkip};\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst returnValue = await mapper(element, currentIndex);\n\n\t\t\t\t\t\tpendingPromisesCount--;\n\n\t\t\t\t\t\tif (returnValue === pMapSkip) {\n\t\t\t\t\t\t\tconst index = promises.indexOf(promise);\n\n\t\t\t\t\t\t\tif (index > 0) {\n\t\t\t\t\t\t\t\tpromises.splice(index, 1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Spawn if still below backpressure limit and just dropped below concurrency limit\n\t\t\t\t\t\ttrySpawn();\n\n\t\t\t\t\t\treturn {done: false, value: returnValue};\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\tpendingPromisesCount--;\n\t\t\t\t\t\tisDone = true;\n\t\t\t\t\t\treturn {error};\n\t\t\t\t\t}\n\t\t\t\t})();\n\n\t\t\t\tpromises.push(promise);\n\t\t\t}\n\n\t\t\ttrySpawn();\n\n\t\t\ttry {\n\t\t\t\twhile (promises.length > 0) {\n\t\t\t\t\tconst result = await promises[0]; // eslint-disable-line no-await-in-loop\n\t\t\t\t\tconst {done, value} = result;\n\n\t\t\t\t\tpromises.shift();\n\n\t\t\t\t\tif (Object.hasOwn(result, 'error')) {\n\t\t\t\t\t\tthrow result.error;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (done) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Spawn if just dropped below backpressure limit and below the concurrency limit\n\t\t\t\t\ttrySpawn();\n\n\t\t\t\t\tif (value === pMapSkip) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tyield value;\n\t\t\t\t}\n\t\t\t} finally {\n\t\t\t\t// Stop pulling input once the consumer stops iterating, otherwise pending skipped mappers keep spawning work.\n\t\t\t\tisDone = true;\n\n\t\t\t\tif (!isIterableDone) {\n\t\t\t\t\tcloseIterator(iterator);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t};\n}\n\nexport const pMapSkip = Symbol('skip');\n\n// Close the source so it can release its resources, like `for await` does.\n// Callers must not await this so a source that is blocked in `next()` cannot block them.\nasync function closeIterator(iterator) {\n\ttry {\n\t\tawait iterator.return?.();\n\t} catch {}\n}\n"],"x_google_ignoreList":[0],"mappings":";;AAAA,eAA8B,KAC7B,UACA,QACA,EACC,cAAc,OAAO,mBACrB,cAAc,MACd,WACG,CAAC,GACJ;CACD,OAAO,IAAI,SAAS,UAAU,YAAY;EACzC,IAAI,SAAS,OAAO,cAAc,KAAA,KAAa,SAAS,OAAO,mBAAmB,KAAA,GACjF,MAAM,IAAI,UAAU,8EAA8E,OAAO,SAAS,EAAE;EAGrH,IAAI,OAAO,WAAW,YACrB,MAAM,IAAI,UAAU,6BAA6B;EAGlD,IAAI,EAAG,OAAO,cAAc,WAAW,KAAK,eAAe,KAAM,gBAAgB,OAAO,oBACvF,MAAM,IAAI,UAAU,kFAAkF,YAAY,MAAM,OAAO,YAAY,EAAE;EAG9I,MAAM,SAAS,CAAC;EAChB,MAAM,SAAS,CAAC;EAChB,MAAM,oCAAoB,IAAI,IAAI;EAClC,IAAI,aAAa;EACjB,IAAI,aAAa;EACjB,IAAI,iBAAiB;EACrB,IAAI,iBAAiB;EACrB,IAAI,eAAe;EACnB,MAAM,WAAW,SAAS,OAAO,mBAAmB,KAAA,IAAY,SAAS,OAAO,SAAS,CAAC,IAAI,SAAS,OAAO,cAAc,CAAC;EAE7H,MAAM,uBAAuB;GAC5B,OAAO,OAAO,MAAM;EACrB;EAEA,MAAM,gBAAgB;GACrB,QAAQ,oBAAoB,SAAS,cAAc;EACpD;EAEA,MAAM,WAAU,UAAS;GACxB,SAAS,KAAK;GACd,QAAQ;EACT;EAEA,MAAM,UAAS,WAAU;GACxB,IAAI,YACH;GAGD,aAAa;GACb,aAAa;GACb,QAAQ,MAAM;GACd,QAAQ;GAER,IAAI,CAAC,gBACJ,cAAc,QAAQ;EAExB;EAEA,IAAI,QAAQ;GACX,IAAI,OAAO,SAAS;IACnB,OAAO,OAAO,MAAM;IACpB;GACD;GAEA,OAAO,iBAAiB,SAAS,gBAAgB,EAAC,MAAM,KAAI,CAAC;EAC9D;EAEA,MAAM,OAAO,YAAY;GACxB,IAAI,YACH;GAID,MAAM,WAAW,iBAAiB,EAAC,MAAM,KAAI,IAAI,MAAM,SAAS,KAAK;GAErE,MAAM,QAAQ;GACd;GAQA,IAAI,SAAS,MAAM;IAClB,iBAAiB;IAEjB,IAAI,mBAAmB,KAAK,CAAC,YAAY;KACxC,IAAI,CAAC,eAAe,OAAO,SAAS,GAAG;MACtC,OAAO,IAAI,eAAe,MAAM,CAAC;MACjC;KACD;KAEA,aAAa;KAEb,IAAI,kBAAkB,SAAS,GAAG;MACjC,QAAQ,MAAM;MACd;KACD;KAEA,MAAM,aAAa,CAAC;KAGpB,KAAK,MAAM,CAAC,OAAO,UAAU,OAAO,QAAQ,GAAG;MAC9C,IAAI,kBAAkB,IAAI,KAAK,MAAM,UACpC;MAGD,WAAW,KAAK,KAAK;KACtB;KAEA,QAAQ,UAAU;IACnB;IAEA;GACD;GAEA;GAGA,CAAC,YAAY;IACZ,IAAI;KACH,MAAM,UAAU,MAAM,SAAS;KAE/B,IAAI,YACH;KAGD,MAAM,QAAQ,MAAM,OAAO,SAAS,KAAK;KAGzC,IAAI,UAAU,UACb,kBAAkB,IAAI,OAAO,KAAK;KAGnC,OAAO,SAAS;IACjB,SAAS,OAAO;KACf,IAAI,aAAa;MAChB,OAAO,KAAK;MACZ;KACD;KAEA,OAAO,KAAK,KAAK;IAClB;IAEA;IAMA,IAAI;KACH,MAAM,KAAK;IACZ,SAAS,OAAO;KACf,OAAO,KAAK;IACb;GACD,EAAA,CAAG;EACJ;EAQA,CAAC,YAAY;GACZ,KAAK,IAAI,QAAQ,GAAG,QAAQ,aAAa,SAAS;IACjD,IAAI;KAEH,MAAM,KAAK;IACZ,SAAS,OAAO;KACf,OAAO,KAAK;KACZ;IACD;IAEA,IAAI,kBAAkB,YACrB;GAEF;EACD,EAAA,CAAG;CACJ,CAAC;AACF;AAwIA,eAAe,cAAc,UAAU;CACtC,IAAI;EACH,MAAM,SAAS,SAAS;CACzB,QAAQ,CAAC;AACV;;;;CARa,WAAW,OAAO,MAAM"}
|
package/package.json
CHANGED
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codeworksh/cli",
|
|
3
|
-
"version": "0.0.1-dev.
|
|
4
|
-
"description": "CLI for running CodeWork coding
|
|
3
|
+
"version": "0.0.1-dev.20260922183613",
|
|
4
|
+
"description": "CLI for running CodeWork coding agent harness.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"agent",
|
|
7
7
|
"ai",
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
"
|
|
8
|
+
"ai-sdk",
|
|
9
|
+
"anthropic",
|
|
10
|
+
"grok",
|
|
11
|
+
"harness",
|
|
12
|
+
"llm",
|
|
13
|
+
"node",
|
|
14
|
+
"openai"
|
|
12
15
|
],
|
|
13
|
-
"homepage": "https://
|
|
16
|
+
"homepage": "https://www.codework.sh",
|
|
14
17
|
"bugs": {
|
|
15
18
|
"url": "https://github.com/codeworksh/codework/issues"
|
|
16
19
|
},
|
|
@@ -27,7 +30,6 @@
|
|
|
27
30
|
},
|
|
28
31
|
"exports": {
|
|
29
32
|
".": {
|
|
30
|
-
"development": "./src/index.ts",
|
|
31
33
|
"types": "./index.d.mts",
|
|
32
34
|
"import": "./index.mjs",
|
|
33
35
|
"default": "./index.mjs"
|
|
@@ -46,7 +48,8 @@
|
|
|
46
48
|
"node": ">=24.14.1"
|
|
47
49
|
},
|
|
48
50
|
"dependencies": {
|
|
49
|
-
"@codeworksh/aikit": "0.8.0",
|
|
51
|
+
"@codeworksh/aikit": "0.8.0-dev.20260905193244",
|
|
52
|
+
"@codeworksh/plugin": "0.0.1-dev.20260922135956",
|
|
50
53
|
"@effect/platform-node": "4.0.0-rc.115",
|
|
51
54
|
"@effect/platform-node-shared": "4.0.0-rc.115",
|
|
52
55
|
"@effect/sql-sqlite-node": "4.0.0-rc.115",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { n as loadProviders } from "./catalog-
|
|
1
|
+
import { a as reportFailure, f as writeOut } from "./error-BrbT9_4g.mjs";
|
|
2
|
+
import { i as Cmd, t as handler } from "./runtime-Dl621FOp.mjs";
|
|
3
|
+
import { n as loadProviders } from "./catalog-DJxy_lne.mjs";
|
|
4
4
|
import { Effect } from "effect";
|
|
5
5
|
//#region src/cli/cmd/handlers/models/providers.ts
|
|
6
6
|
var providers_default = handler(Cmd.commands.models.commands.providers, Effect.fn("CLI.models.providers")(function* () {
|
|
@@ -12,4 +12,4 @@ var providers_default = handler(Cmd.commands.models.commands.providers, Effect.f
|
|
|
12
12
|
//#endregion
|
|
13
13
|
export { providers_default as default };
|
|
14
14
|
|
|
15
|
-
//# sourceMappingURL=providers-
|
|
15
|
+
//# sourceMappingURL=providers-DLXs9aWZ.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"providers-
|
|
1
|
+
{"version":3,"file":"providers-DLXs9aWZ.mjs","names":["Runtime.handler"],"sources":["../../src/cli/cmd/handlers/models/providers.ts"],"sourcesContent":["import { 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 { loadProviders } 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\tconst providers = yield* loadProviders;\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":";;;;;AAOA,IAAA,oBAAeA,QACd,IAAI,SAAS,OAAO,SAAS,WAC7B,OAAO,GAAG,sBAAsB,CAAC,CAAC,aAAa;CAO9C,OAAO,OANS,OAAO,IAAI,aAAa;EAEvC,MAAM,SAAS,CAAC,GAAG,OADM,aACG,CAAC,CAAC,MAAM,GAAG,MAAM,EAAE,cAAc,CAAC,CAAC;EAC/D,OAAO,SAAS,OAAO,KAAK,eAAe,GAAG,WAAW,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC;CACvE,CAEoB,CAAC,CAAC,KAAK,OAAO,MAAM,aAAa,CAAC;AACvD,CAAC,CACF"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { a as reportFailure, d as writeError, f as writeOut, m as make, r as OAuthError, t as InvalidInputError } from "./error-BrbT9_4g.mjs";
|
|
2
|
+
import { i as Cmd, t as handler } from "./runtime-Dl621FOp.mjs";
|
|
3
|
+
import { a as oauthProviderLabel, n as attempt, o as selectProvider, r as localOps, s as withServer, t as assertServerScope } from "./shared-Uwjcofff.mjs";
|
|
4
|
+
import { Effect, Option } from "effect";
|
|
5
|
+
import { formatOAuthSummary, oauthNotice, oauthRefreshIssue } from "@codeworksh/aikit/oauth/summary";
|
|
6
|
+
//#region src/cli/cmd/handlers/auth/refresh.ts
|
|
7
|
+
var refresh_default = handler(Cmd.commands.auth.commands.refresh, Effect.fn("CLI.auth.refresh")(function* ({ server, openaiCodex, githubCopilot, authFile, json }) {
|
|
8
|
+
return yield* Effect.gen(function* () {
|
|
9
|
+
const provider = yield* selectProvider({
|
|
10
|
+
openaiCodex,
|
|
11
|
+
githubCopilot
|
|
12
|
+
});
|
|
13
|
+
const blocked = oauthRefreshIssue(provider);
|
|
14
|
+
if (blocked !== void 0) return yield* new InvalidInputError({ message: blocked });
|
|
15
|
+
const name = oauthProviderLabel(provider);
|
|
16
|
+
if (Option.isSome(server)) {
|
|
17
|
+
yield* assertServerScope(authFile);
|
|
18
|
+
return yield* withServer(server.value, Effect.gen(function* () {
|
|
19
|
+
const info = yield* (yield* make)["auth.refresh"]({ provider });
|
|
20
|
+
if (info === null) return yield* new OAuthError({ message: oauthNotice("missing", provider, "the server") });
|
|
21
|
+
yield* writeError(`${oauthNotice("refreshed", provider, "the server")}\n`);
|
|
22
|
+
yield* writeOut(formatOAuthSummary(info, { json }));
|
|
23
|
+
}));
|
|
24
|
+
}
|
|
25
|
+
const ops = yield* localOps(provider, authFile);
|
|
26
|
+
const summary = yield* attempt(`failed to read ${name} credentials`, () => ops.refreshed());
|
|
27
|
+
if (summary === void 0) return yield* new OAuthError({ message: oauthNotice("missing", provider, ops.path) });
|
|
28
|
+
yield* writeError(`${oauthNotice("refreshed", provider, ops.path)}\n`);
|
|
29
|
+
yield* writeOut(formatOAuthSummary(summary, { json }));
|
|
30
|
+
}).pipe(Effect.catch(reportFailure));
|
|
31
|
+
}));
|
|
32
|
+
//#endregion
|
|
33
|
+
export { refresh_default as default };
|
|
34
|
+
|
|
35
|
+
//# sourceMappingURL=refresh-BTNuP1zL.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"refresh-BTNuP1zL.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,OAAO,GAAG,kBAAkB,CAAC,CAAC,WAAW,EAAE,QAAQ,aAAa,eAAe,UAAU,QAAQ;CAiChG,OAAO,OAhCS,OAAO,IAAI,aAAa;EACvC,MAAM,WAAW,OAAO,eAAe;GAAE;GAAa;EAAc,CAAC;EACrE,MAAM,UAAU,kBAAkB,QAAQ;EAC1C,IAAI,YAAY,KAAA,GAAW,OAAO,OAAO,IAAI,kBAAkB,EAAE,SAAS,QAAQ,CAAC;EAEnF,MAAM,OAAO,mBAAmB,QAAQ;EAExC,IAAI,OAAO,OAAO,MAAM,GAAG;GAC1B,OAAO,kBAAkB,QAAQ;GACjC,OAAO,OAAO,WACb,OAAO,OACP,OAAO,IAAI,aAAa;IAEvB,MAAM,OAAO,QAAO,OADDC,KAAAA,CACK,eAAe,CAAC,EAAE,SAAS,CAAC;IACpD,IAAI,SAAS,MACZ,OAAO,OAAO,IAAI,WAAW,EAAE,SAAS,YAAY,WAAW,UAAU,YAAY,EAAE,CAAC;IAEzF,OAAO,WAAW,GAAG,YAAY,aAAa,UAAU,YAAY,EAAE,GAAG;IACzE,OAAO,SAAS,mBAAmB,MAAM,EAAE,KAAK,CAAC,CAAC;GACnD,CAAC,CACF;EACD;EAEA,MAAM,MAAM,OAAO,SAAS,UAAU,QAAQ;EAC9C,MAAM,UAAU,OAAO,QAAQ,kBAAkB,KAAK,qBAAqB,IAAI,UAAU,CAAC;EAC1F,IAAI,YAAY,KAAA,GACf,OAAO,OAAO,IAAI,WAAW,EAAE,SAAS,YAAY,WAAW,UAAU,IAAI,IAAI,EAAE,CAAC;EAErF,OAAO,WAAW,GAAG,YAAY,aAAa,UAAU,IAAI,IAAI,EAAE,GAAG;EACrE,OAAO,SAAS,mBAAmB,SAAS,EAAE,KAAK,CAAC,CAAC;CACtD,CAEoB,CAAC,CAAC,KAAK,OAAO,MAAM,aAAa,CAAC;AACvD,CAAC,CACF"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { a as reportFailure, f as writeOut, m as make, p as layer } from "./error-BrbT9_4g.mjs";
|
|
2
|
+
import { i as Cmd, t as handler } from "./runtime-Dl621FOp.mjs";
|
|
3
|
+
import { Effect } from "effect";
|
|
4
|
+
//#region src/cli/cmd/handlers/plugin/reload.ts
|
|
5
|
+
/**
|
|
6
|
+
* Re-import every configured plugin in a running server.
|
|
7
|
+
*
|
|
8
|
+
* It exists for exactly one case: a **local** plugin edited in place. Nothing in settings changed
|
|
9
|
+
* and no generation moved -- a local source is never copied into the store, so it has none -- and
|
|
10
|
+
* the module registry holds the old module against an unchanged URL. Everything else the runtime
|
|
11
|
+
* notices for itself at the next exchange.
|
|
12
|
+
*
|
|
13
|
+
* There is no local form, and that is not an omission. In a CLI every run is a fresh process, so
|
|
14
|
+
* the load pass happens at startup and a reload would have nothing to do.
|
|
15
|
+
*/
|
|
16
|
+
var reload_default = handler(Cmd.commands.plugin.commands.reload, Effect.fn("CLI.plugin.reload")(function* ({ server }) {
|
|
17
|
+
return yield* Effect.gen(function* () {
|
|
18
|
+
const result = yield* (yield* make)["plugin.reload"]({});
|
|
19
|
+
yield* writeOut(result.failure === void 0 ? `Reloaded ${result.plugins} plugin${result.plugins === 1 ? "" : "s"}.\n` : `Reload failed, keeping ${result.plugins} loaded: ${result.failure}\n`);
|
|
20
|
+
if (result.failure !== void 0) process.exitCode = 1;
|
|
21
|
+
}).pipe(Effect.provide(layer(server)), Effect.scoped, Effect.catch(reportFailure));
|
|
22
|
+
}));
|
|
23
|
+
//#endregion
|
|
24
|
+
export { reload_default as default };
|
|
25
|
+
|
|
26
|
+
//# sourceMappingURL=reload-BzwsCBQq.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reload-BzwsCBQq.mjs","names":["Runtime.handler","Client.make","Client.layer"],"sources":["../../src/cli/cmd/handlers/plugin/reload.ts"],"sourcesContent":["import { Effect } 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 * Re-import every configured plugin in a running server.\n *\n * It exists for exactly one case: a **local** plugin edited in place. Nothing in settings changed\n * and no generation moved -- a local source is never copied into the store, so it has none -- and\n * the module registry holds the old module against an unchanged URL. Everything else the runtime\n * notices for itself at the next exchange.\n *\n * There is no local form, and that is not an omission. In a CLI every run is a fresh process, so\n * the load pass happens at startup and a reload would have nothing to do.\n */\nexport default Runtime.handler(\n\tCmd.commands.plugin.commands.reload,\n\tEffect.fn(\"CLI.plugin.reload\")(function* ({ server }) {\n\t\tconst program = Effect.gen(function* () {\n\t\t\tconst rpc = yield* Client.make;\n\t\t\tconst result = yield* rpc[\"plugin.reload\"]({});\n\t\t\t// A reload that failed still reports the set that stayed loaded: the server kept\n\t\t\t// working, which is the whole point of not failing it.\n\t\t\tyield* writeOut(\n\t\t\t\tresult.failure === undefined\n\t\t\t\t\t? `Reloaded ${result.plugins} plugin${result.plugins === 1 ? \"\" : \"s\"}.\\n`\n\t\t\t\t\t: `Reload failed, keeping ${result.plugins} loaded: ${result.failure}\\n`,\n\t\t\t);\n\t\t\tif (result.failure !== undefined) process.exitCode = 1;\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":";;;;;;;;;;;;;;;AAkBA,IAAA,iBAAeA,QACd,IAAI,SAAS,OAAO,SAAS,QAC7B,OAAO,GAAG,mBAAmB,CAAC,CAAC,WAAW,EAAE,UAAU;CAcrD,OAAO,OAbS,OAAO,IAAI,aAAa;EAEvC,MAAM,SAAS,QAAO,OADHC,KAAAA,CACO,gBAAgB,CAAC,CAAC,CAAC;EAG7C,OAAO,SACN,OAAO,YAAY,KAAA,IAChB,YAAY,OAAO,QAAQ,SAAS,OAAO,YAAY,IAAI,KAAK,IAAI,OACpE,0BAA0B,OAAO,QAAQ,WAAW,OAAO,QAAQ,GACvE;EACA,IAAI,OAAO,YAAY,KAAA,GAAW,QAAQ,WAAW;CACtD,CAEoB,CAAC,CAAC,KAAK,OAAO,QAAQC,MAAa,MAAM,CAAC,GAAG,OAAO,QAAQ,OAAO,MAAM,aAAa,CAAC;AAC5G,CAAC,CACF"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { a as reportFailure, bt as resolve, f as writeOut } from "./error-BrbT9_4g.mjs";
|
|
2
|
+
import { i as Cmd, t as handler } from "./runtime-Dl621FOp.mjs";
|
|
3
|
+
import { a as resolveTarget, c as writePlugins, i as readPlugins, o as spellings, r as matching, s as withPluginsLock, t as identify } from "./settings-C52IrA72.mjs";
|
|
4
|
+
import { Effect, FileSystem, Option, Path } from "effect";
|
|
5
|
+
//#region src/cli/cmd/handlers/plugin/remove.ts
|
|
6
|
+
var remove_default = handler(Cmd.commands.plugin.commands.remove, Effect.fn("CLI.plugin.remove")(function* ({ package: reference, global: userWide }) {
|
|
7
|
+
return yield* Effect.gen(function* () {
|
|
8
|
+
const shared = yield* Cmd.spec;
|
|
9
|
+
const path = yield* Path.Path;
|
|
10
|
+
const fs = yield* FileSystem.FileSystem;
|
|
11
|
+
const paths = yield* resolve(Option.isNone(shared.home) ? {} : { home: shared.home.value });
|
|
12
|
+
const target = yield* resolveTarget(shared, userWide, void 0, false);
|
|
13
|
+
if (!(yield* fs.exists(path.dirname(target.path)))) {
|
|
14
|
+
yield* writeOut(`Plugin "${reference}" is not configured in ${target.path}\n`);
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
const spelled = yield* spellings(reference, path.resolve("."));
|
|
18
|
+
yield* withPluginsLock(target.path, Effect.gen(function* () {
|
|
19
|
+
const { source, plugins } = yield* readPlugins(target.path);
|
|
20
|
+
const entries = yield* identify(plugins, target.path, paths.cache);
|
|
21
|
+
const selected = matching(entries, spelled);
|
|
22
|
+
const kept = entries.filter((entry) => !selected.has(entry)).map((entry) => entry.value);
|
|
23
|
+
if (kept.length === plugins.length) {
|
|
24
|
+
yield* writeOut(`Plugin "${reference}" is not configured in ${target.path}\n`);
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
yield* writePlugins(target.path, source, kept);
|
|
28
|
+
const dropped = plugins.length - kept.length;
|
|
29
|
+
yield* writeOut(`Removed ${dropped} ${dropped === 1 ? "entry" : "entries"} for "${reference}" from ${target.path}\n`);
|
|
30
|
+
}));
|
|
31
|
+
}).pipe(Effect.catch(reportFailure));
|
|
32
|
+
}));
|
|
33
|
+
//#endregion
|
|
34
|
+
export { remove_default as default };
|
|
35
|
+
|
|
36
|
+
//# sourceMappingURL=remove-DgB3l5JL.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remove-DgB3l5JL.mjs","names":["Runtime.handler","Global.resolve"],"sources":["../../src/cli/cmd/handlers/plugin/remove.ts"],"sourcesContent":["import { Global } from \"@codeworksh/harness/effect\";\nimport { Effect, FileSystem, Option, Path } from \"effect\";\nimport { 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,OAAOC,QAAe,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"}
|