@bizzywork/routing 0.1.0 → 0.3.0
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 +3 -1
- package/dist/bundle/THIRD-PARTY-NOTICES.txt +160 -0
- package/dist/bundle/bizzy-routing.js +12 -21
- package/dist/bundle/chunk-RYVRLJBJ.js +62 -0
- package/dist/bundle/clack-ui-KG2I32T5.js +1406 -0
- package/dist/bundle/harnesses/claude-code/hooks/register.ts +11 -2
- package/dist/bundle/{main-VPXMU5TG.js → main-6WPWCLN3.js} +346 -264
- package/dist/bundle/ui-PEKFVWX7.js +44 -0
- package/package.json +2 -1
|
@@ -3,54 +3,14 @@ import { fileURLToPath as __bizzyPath } from "node:url";
|
|
|
3
3
|
const require = __bizzyRequire(import.meta.url);
|
|
4
4
|
const __filename = __bizzyPath(import.meta.url);
|
|
5
5
|
const __dirname = __bizzyPath(new URL(".", import.meta.url));
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}) : x)(function(x) {
|
|
15
|
-
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
16
|
-
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
17
|
-
});
|
|
18
|
-
var __esm = (fn, res, err) => function __init() {
|
|
19
|
-
if (err) throw err[0];
|
|
20
|
-
try {
|
|
21
|
-
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
22
|
-
} catch (e) {
|
|
23
|
-
throw err = [e], e;
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
var __commonJS = (cb, mod) => function __require2() {
|
|
27
|
-
try {
|
|
28
|
-
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
29
|
-
} catch (e) {
|
|
30
|
-
throw mod = 0, e;
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
var __export = (target, all) => {
|
|
34
|
-
for (var name in all)
|
|
35
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
36
|
-
};
|
|
37
|
-
var __copyProps = (to, from, except, desc) => {
|
|
38
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
39
|
-
for (let key of __getOwnPropNames(from))
|
|
40
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
41
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
42
|
-
}
|
|
43
|
-
return to;
|
|
44
|
-
};
|
|
45
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
46
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
47
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
48
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
49
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
50
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
51
|
-
mod
|
|
52
|
-
));
|
|
53
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
6
|
+
import {
|
|
7
|
+
__commonJS,
|
|
8
|
+
__esm,
|
|
9
|
+
__export,
|
|
10
|
+
__require,
|
|
11
|
+
__toCommonJS,
|
|
12
|
+
__toESM
|
|
13
|
+
} from "./chunk-RYVRLJBJ.js";
|
|
54
14
|
|
|
55
15
|
// node_modules/fastify-plugin/lib/getPluginName.js
|
|
56
16
|
var require_getPluginName = __commonJS({
|
|
@@ -9202,8 +9162,8 @@ var require_common = __commonJS({
|
|
|
9202
9162
|
}
|
|
9203
9163
|
return debug;
|
|
9204
9164
|
}
|
|
9205
|
-
function extend2(namespace,
|
|
9206
|
-
const newDebug = createDebug(this.namespace + (typeof
|
|
9165
|
+
function extend2(namespace, delimiter2) {
|
|
9166
|
+
const newDebug = createDebug(this.namespace + (typeof delimiter2 === "undefined" ? ":" : delimiter2) + namespace);
|
|
9207
9167
|
newDebug.log = this.log;
|
|
9208
9168
|
return newDebug;
|
|
9209
9169
|
}
|
|
@@ -10003,11 +9963,11 @@ var require_definitions = __commonJS({
|
|
|
10003
9963
|
walkSchema(value, visit2, pointer, baseId, baseDepth);
|
|
10004
9964
|
pointer.pop();
|
|
10005
9965
|
} else if (SCHEMA_MAP_KEYWORDS2.has(key) && isObject2(value)) {
|
|
10006
|
-
const
|
|
9966
|
+
const names2 = Object.keys(value);
|
|
10007
9967
|
pointer.push(key);
|
|
10008
|
-
for (let j = 0; j <
|
|
10009
|
-
pointer.push(
|
|
10010
|
-
walkSchema(value[
|
|
9968
|
+
for (let j = 0; j < names2.length; j++) {
|
|
9969
|
+
pointer.push(names2[j]);
|
|
9970
|
+
walkSchema(value[names2[j]], visit2, pointer, baseId, baseDepth);
|
|
10011
9971
|
pointer.pop();
|
|
10012
9972
|
}
|
|
10013
9973
|
pointer.pop();
|
|
@@ -16053,7 +16013,7 @@ var require_send = __commonJS({
|
|
|
16053
16013
|
var { parseTokenList } = require_parseTokenList();
|
|
16054
16014
|
var { createHttpError } = require_createHttpError();
|
|
16055
16015
|
var extname = path.extname;
|
|
16056
|
-
var
|
|
16016
|
+
var join12 = path.join;
|
|
16057
16017
|
var normalize = path.normalize;
|
|
16058
16018
|
var resolve3 = path.resolve;
|
|
16059
16019
|
var sep = path.sep;
|
|
@@ -16148,7 +16108,7 @@ var require_send = __commonJS({
|
|
|
16148
16108
|
return { statusCode: 403 };
|
|
16149
16109
|
}
|
|
16150
16110
|
parts = path2.split(sep);
|
|
16151
|
-
path2 = normalize(
|
|
16111
|
+
path2 = normalize(join12(root, path2));
|
|
16152
16112
|
} else {
|
|
16153
16113
|
if (UP_PATH_REGEXP.test(path2)) {
|
|
16154
16114
|
debug('malicious path "%s"', path2);
|
|
@@ -16434,7 +16394,7 @@ var require_send = __commonJS({
|
|
|
16434
16394
|
let err;
|
|
16435
16395
|
for (let i = 0; i < options.index.length; i++) {
|
|
16436
16396
|
const index = options.index[i];
|
|
16437
|
-
const p =
|
|
16397
|
+
const p = join12(path2, index);
|
|
16438
16398
|
const { error: error62, stat } = await tryStat(p);
|
|
16439
16399
|
if (error62) {
|
|
16440
16400
|
err = error62;
|
|
@@ -25960,7 +25920,7 @@ var require_on_exit_leak_free = __commonJS({
|
|
|
25960
25920
|
registry3 = new FinalizationRegistry(clear);
|
|
25961
25921
|
}
|
|
25962
25922
|
}
|
|
25963
|
-
function
|
|
25923
|
+
function install(event) {
|
|
25964
25924
|
if (refs[event].length > 0) {
|
|
25965
25925
|
return;
|
|
25966
25926
|
}
|
|
@@ -26002,7 +25962,7 @@ var require_on_exit_leak_free = __commonJS({
|
|
|
26002
25962
|
if (obj === void 0) {
|
|
26003
25963
|
throw new Error("the object can't be undefined");
|
|
26004
25964
|
}
|
|
26005
|
-
|
|
25965
|
+
install(event);
|
|
26006
25966
|
const ref2 = new WeakRef(obj);
|
|
26007
25967
|
ref2.fn = fn;
|
|
26008
25968
|
ensureRegistry();
|
|
@@ -26173,7 +26133,7 @@ var require_thread_stream = __commonJS({
|
|
|
26173
26133
|
var { version: version2 } = require_package();
|
|
26174
26134
|
var { EventEmitter } = __require("events");
|
|
26175
26135
|
var { Worker } = __require("worker_threads");
|
|
26176
|
-
var { join:
|
|
26136
|
+
var { join: join12 } = __require("path");
|
|
26177
26137
|
var { pathToFileURL } = __require("url");
|
|
26178
26138
|
var { wait } = require_wait();
|
|
26179
26139
|
var {
|
|
@@ -26224,7 +26184,7 @@ var require_thread_stream = __commonJS({
|
|
|
26224
26184
|
function createWorker(stream, opts) {
|
|
26225
26185
|
const { filename, workerData } = opts;
|
|
26226
26186
|
const bundlerOverrides = "__bundlerPathsOverrides" in globalThis ? globalThis.__bundlerPathsOverrides : {};
|
|
26227
|
-
const toExecute = bundlerOverrides["thread-stream-worker"] ||
|
|
26187
|
+
const toExecute = bundlerOverrides["thread-stream-worker"] || join12(__dirname, "lib", "worker.js");
|
|
26228
26188
|
const worker = new Worker(toExecute, {
|
|
26229
26189
|
...opts.workerOpts,
|
|
26230
26190
|
name: opts.workerOpts?.name || "thread-stream",
|
|
@@ -26690,9 +26650,9 @@ var require_transport = __commonJS({
|
|
|
26690
26650
|
"node_modules/pino/lib/transport.js"(exports, module) {
|
|
26691
26651
|
"use strict";
|
|
26692
26652
|
var { createRequire } = __require("module");
|
|
26693
|
-
var { existsSync:
|
|
26653
|
+
var { existsSync: existsSync6 } = __require("node:fs");
|
|
26694
26654
|
var getCallers = require_caller();
|
|
26695
|
-
var { join:
|
|
26655
|
+
var { join: join12, isAbsolute, sep } = __require("node:path");
|
|
26696
26656
|
var { fileURLToPath } = __require("node:url");
|
|
26697
26657
|
var sleep = require_atomic_sleep();
|
|
26698
26658
|
var onExit = require_on_exit_leak_free();
|
|
@@ -26765,7 +26725,7 @@ var require_transport = __commonJS({
|
|
|
26765
26725
|
return false;
|
|
26766
26726
|
}
|
|
26767
26727
|
}
|
|
26768
|
-
return isAbsolute(path) && !
|
|
26728
|
+
return isAbsolute(path) && !existsSync6(path);
|
|
26769
26729
|
}
|
|
26770
26730
|
function stripQuotes(value) {
|
|
26771
26731
|
const first = value[0];
|
|
@@ -26847,7 +26807,7 @@ var require_transport = __commonJS({
|
|
|
26847
26807
|
throw new Error("only one of target or targets can be specified");
|
|
26848
26808
|
}
|
|
26849
26809
|
if (targets) {
|
|
26850
|
-
target = bundlerOverrides["pino-worker"] ||
|
|
26810
|
+
target = bundlerOverrides["pino-worker"] || join12(__dirname, "worker.js");
|
|
26851
26811
|
options.targets = targets.filter((dest) => dest.target).map((dest) => {
|
|
26852
26812
|
return {
|
|
26853
26813
|
...dest,
|
|
@@ -26868,7 +26828,7 @@ var require_transport = __commonJS({
|
|
|
26868
26828
|
const pipelinesHaveLevel = options.pipelines.some((p) => p.some((t) => t.level != null));
|
|
26869
26829
|
usesMultistream = options.targets.length + options.pipelines.length > 1 || targetsHaveLevel || pipelinesHaveLevel;
|
|
26870
26830
|
} else if (pipeline) {
|
|
26871
|
-
target = bundlerOverrides["pino-worker"] ||
|
|
26831
|
+
target = bundlerOverrides["pino-worker"] || join12(__dirname, "worker.js");
|
|
26872
26832
|
options.pipelines = [pipeline.map((dest) => {
|
|
26873
26833
|
return {
|
|
26874
26834
|
...dest,
|
|
@@ -26895,7 +26855,7 @@ var require_transport = __commonJS({
|
|
|
26895
26855
|
return origin;
|
|
26896
26856
|
}
|
|
26897
26857
|
if (origin === "pino/file") {
|
|
26898
|
-
return
|
|
26858
|
+
return join12(__dirname, "..", "file.js");
|
|
26899
26859
|
}
|
|
26900
26860
|
let fixTarget2;
|
|
26901
26861
|
for (const filePath of callers) {
|
|
@@ -27875,7 +27835,7 @@ var require_safe_stable_stringify = __commonJS({
|
|
|
27875
27835
|
return circularValue;
|
|
27876
27836
|
}
|
|
27877
27837
|
let res = "";
|
|
27878
|
-
let
|
|
27838
|
+
let join12 = ",";
|
|
27879
27839
|
const originalIndentation = indentation;
|
|
27880
27840
|
if (Array.isArray(value)) {
|
|
27881
27841
|
if (value.length === 0) {
|
|
@@ -27889,7 +27849,7 @@ var require_safe_stable_stringify = __commonJS({
|
|
|
27889
27849
|
indentation += spacer;
|
|
27890
27850
|
res += `
|
|
27891
27851
|
${indentation}`;
|
|
27892
|
-
|
|
27852
|
+
join12 = `,
|
|
27893
27853
|
${indentation}`;
|
|
27894
27854
|
}
|
|
27895
27855
|
const maximumValuesToStringify = Math.min(value.length, maximumBreadth);
|
|
@@ -27897,13 +27857,13 @@ ${indentation}`;
|
|
|
27897
27857
|
for (; i < maximumValuesToStringify - 1; i++) {
|
|
27898
27858
|
const tmp2 = stringifyFnReplacer(String(i), value, stack, replacer, spacer, indentation);
|
|
27899
27859
|
res += tmp2 !== void 0 ? tmp2 : "null";
|
|
27900
|
-
res +=
|
|
27860
|
+
res += join12;
|
|
27901
27861
|
}
|
|
27902
27862
|
const tmp = stringifyFnReplacer(String(i), value, stack, replacer, spacer, indentation);
|
|
27903
27863
|
res += tmp !== void 0 ? tmp : "null";
|
|
27904
27864
|
if (value.length - 1 > maximumBreadth) {
|
|
27905
27865
|
const removedKeys = value.length - maximumBreadth - 1;
|
|
27906
|
-
res += `${
|
|
27866
|
+
res += `${join12}"... ${getItemCount(removedKeys)} not stringified"`;
|
|
27907
27867
|
}
|
|
27908
27868
|
if (spacer !== "") {
|
|
27909
27869
|
res += `
|
|
@@ -27924,7 +27884,7 @@ ${originalIndentation}`;
|
|
|
27924
27884
|
let separator = "";
|
|
27925
27885
|
if (spacer !== "") {
|
|
27926
27886
|
indentation += spacer;
|
|
27927
|
-
|
|
27887
|
+
join12 = `,
|
|
27928
27888
|
${indentation}`;
|
|
27929
27889
|
whitespace = " ";
|
|
27930
27890
|
}
|
|
@@ -27938,13 +27898,13 @@ ${indentation}`;
|
|
|
27938
27898
|
const tmp = stringifyFnReplacer(key2, value, stack, replacer, spacer, indentation);
|
|
27939
27899
|
if (tmp !== void 0) {
|
|
27940
27900
|
res += `${separator}${strEscape(key2)}:${whitespace}${tmp}`;
|
|
27941
|
-
separator =
|
|
27901
|
+
separator = join12;
|
|
27942
27902
|
}
|
|
27943
27903
|
}
|
|
27944
27904
|
if (keyLength > maximumBreadth) {
|
|
27945
27905
|
const removedKeys = keyLength - maximumBreadth;
|
|
27946
27906
|
res += `${separator}"...":${whitespace}"${getItemCount(removedKeys)} not stringified"`;
|
|
27947
|
-
separator =
|
|
27907
|
+
separator = join12;
|
|
27948
27908
|
}
|
|
27949
27909
|
if (spacer !== "" && separator.length > 1) {
|
|
27950
27910
|
res = `
|
|
@@ -27985,7 +27945,7 @@ ${originalIndentation}`;
|
|
|
27985
27945
|
}
|
|
27986
27946
|
const originalIndentation = indentation;
|
|
27987
27947
|
let res = "";
|
|
27988
|
-
let
|
|
27948
|
+
let join12 = ",";
|
|
27989
27949
|
if (Array.isArray(value)) {
|
|
27990
27950
|
if (value.length === 0) {
|
|
27991
27951
|
return "[]";
|
|
@@ -27998,7 +27958,7 @@ ${originalIndentation}`;
|
|
|
27998
27958
|
indentation += spacer;
|
|
27999
27959
|
res += `
|
|
28000
27960
|
${indentation}`;
|
|
28001
|
-
|
|
27961
|
+
join12 = `,
|
|
28002
27962
|
${indentation}`;
|
|
28003
27963
|
}
|
|
28004
27964
|
const maximumValuesToStringify = Math.min(value.length, maximumBreadth);
|
|
@@ -28006,13 +27966,13 @@ ${indentation}`;
|
|
|
28006
27966
|
for (; i < maximumValuesToStringify - 1; i++) {
|
|
28007
27967
|
const tmp2 = stringifyArrayReplacer(String(i), value[i], stack, replacer, spacer, indentation);
|
|
28008
27968
|
res += tmp2 !== void 0 ? tmp2 : "null";
|
|
28009
|
-
res +=
|
|
27969
|
+
res += join12;
|
|
28010
27970
|
}
|
|
28011
27971
|
const tmp = stringifyArrayReplacer(String(i), value[i], stack, replacer, spacer, indentation);
|
|
28012
27972
|
res += tmp !== void 0 ? tmp : "null";
|
|
28013
27973
|
if (value.length - 1 > maximumBreadth) {
|
|
28014
27974
|
const removedKeys = value.length - maximumBreadth - 1;
|
|
28015
|
-
res += `${
|
|
27975
|
+
res += `${join12}"... ${getItemCount(removedKeys)} not stringified"`;
|
|
28016
27976
|
}
|
|
28017
27977
|
if (spacer !== "") {
|
|
28018
27978
|
res += `
|
|
@@ -28025,7 +27985,7 @@ ${originalIndentation}`;
|
|
|
28025
27985
|
let whitespace = "";
|
|
28026
27986
|
if (spacer !== "") {
|
|
28027
27987
|
indentation += spacer;
|
|
28028
|
-
|
|
27988
|
+
join12 = `,
|
|
28029
27989
|
${indentation}`;
|
|
28030
27990
|
whitespace = " ";
|
|
28031
27991
|
}
|
|
@@ -28034,7 +27994,7 @@ ${indentation}`;
|
|
|
28034
27994
|
const tmp = stringifyArrayReplacer(key2, value[key2], stack, replacer, spacer, indentation);
|
|
28035
27995
|
if (tmp !== void 0) {
|
|
28036
27996
|
res += `${separator}${strEscape(key2)}:${whitespace}${tmp}`;
|
|
28037
|
-
separator =
|
|
27997
|
+
separator = join12;
|
|
28038
27998
|
}
|
|
28039
27999
|
}
|
|
28040
28000
|
if (spacer !== "" && separator.length > 1) {
|
|
@@ -28092,20 +28052,20 @@ ${originalIndentation}`;
|
|
|
28092
28052
|
indentation += spacer;
|
|
28093
28053
|
let res2 = `
|
|
28094
28054
|
${indentation}`;
|
|
28095
|
-
const
|
|
28055
|
+
const join13 = `,
|
|
28096
28056
|
${indentation}`;
|
|
28097
28057
|
const maximumValuesToStringify = Math.min(value.length, maximumBreadth);
|
|
28098
28058
|
let i = 0;
|
|
28099
28059
|
for (; i < maximumValuesToStringify - 1; i++) {
|
|
28100
28060
|
const tmp2 = stringifyIndent(String(i), value[i], stack, spacer, indentation);
|
|
28101
28061
|
res2 += tmp2 !== void 0 ? tmp2 : "null";
|
|
28102
|
-
res2 +=
|
|
28062
|
+
res2 += join13;
|
|
28103
28063
|
}
|
|
28104
28064
|
const tmp = stringifyIndent(String(i), value[i], stack, spacer, indentation);
|
|
28105
28065
|
res2 += tmp !== void 0 ? tmp : "null";
|
|
28106
28066
|
if (value.length - 1 > maximumBreadth) {
|
|
28107
28067
|
const removedKeys = value.length - maximumBreadth - 1;
|
|
28108
|
-
res2 += `${
|
|
28068
|
+
res2 += `${join13}"... ${getItemCount(removedKeys)} not stringified"`;
|
|
28109
28069
|
}
|
|
28110
28070
|
res2 += `
|
|
28111
28071
|
${originalIndentation}`;
|
|
@@ -28121,16 +28081,16 @@ ${originalIndentation}`;
|
|
|
28121
28081
|
return '"[Object]"';
|
|
28122
28082
|
}
|
|
28123
28083
|
indentation += spacer;
|
|
28124
|
-
const
|
|
28084
|
+
const join12 = `,
|
|
28125
28085
|
${indentation}`;
|
|
28126
28086
|
let res = "";
|
|
28127
28087
|
let separator = "";
|
|
28128
28088
|
let maximumPropertiesToStringify = Math.min(keyLength, maximumBreadth);
|
|
28129
28089
|
if (isTypedArrayWithEntries(value)) {
|
|
28130
|
-
res += stringifyTypedArray(value,
|
|
28090
|
+
res += stringifyTypedArray(value, join12, maximumBreadth);
|
|
28131
28091
|
keys = keys.slice(value.length);
|
|
28132
28092
|
maximumPropertiesToStringify -= value.length;
|
|
28133
|
-
separator =
|
|
28093
|
+
separator = join12;
|
|
28134
28094
|
}
|
|
28135
28095
|
if (deterministic) {
|
|
28136
28096
|
keys = sort(keys, comparator);
|
|
@@ -28141,13 +28101,13 @@ ${indentation}`;
|
|
|
28141
28101
|
const tmp = stringifyIndent(key2, value[key2], stack, spacer, indentation);
|
|
28142
28102
|
if (tmp !== void 0) {
|
|
28143
28103
|
res += `${separator}${strEscape(key2)}: ${tmp}`;
|
|
28144
|
-
separator =
|
|
28104
|
+
separator = join12;
|
|
28145
28105
|
}
|
|
28146
28106
|
}
|
|
28147
28107
|
if (keyLength > maximumBreadth) {
|
|
28148
28108
|
const removedKeys = keyLength - maximumBreadth;
|
|
28149
28109
|
res += `${separator}"...": "${getItemCount(removedKeys)} not stringified"`;
|
|
28150
|
-
separator =
|
|
28110
|
+
separator = join12;
|
|
28151
28111
|
}
|
|
28152
28112
|
if (separator !== "") {
|
|
28153
28113
|
res = `
|
|
@@ -32383,10 +32343,10 @@ var require_code = __commonJS({
|
|
|
32383
32343
|
}
|
|
32384
32344
|
get names() {
|
|
32385
32345
|
var _a3;
|
|
32386
|
-
return (_a3 = this._names) !== null && _a3 !== void 0 ? _a3 : this._names = this._items.reduce((
|
|
32346
|
+
return (_a3 = this._names) !== null && _a3 !== void 0 ? _a3 : this._names = this._items.reduce((names2, c) => {
|
|
32387
32347
|
if (c instanceof Name)
|
|
32388
|
-
|
|
32389
|
-
return
|
|
32348
|
+
names2[c.str] = (names2[c.str] || 0) + 1;
|
|
32349
|
+
return names2;
|
|
32390
32350
|
}, {});
|
|
32391
32351
|
}
|
|
32392
32352
|
};
|
|
@@ -32712,11 +32672,11 @@ var require_codegen = __commonJS({
|
|
|
32712
32672
|
const rhs = this.rhs === void 0 ? "" : ` = ${this.rhs}`;
|
|
32713
32673
|
return `${varKind} ${this.name}${rhs};` + _n;
|
|
32714
32674
|
}
|
|
32715
|
-
optimizeNames(
|
|
32716
|
-
if (!
|
|
32675
|
+
optimizeNames(names2, constants5) {
|
|
32676
|
+
if (!names2[this.name.str])
|
|
32717
32677
|
return;
|
|
32718
32678
|
if (this.rhs)
|
|
32719
|
-
this.rhs = optimizeExpr(this.rhs,
|
|
32679
|
+
this.rhs = optimizeExpr(this.rhs, names2, constants5);
|
|
32720
32680
|
return this;
|
|
32721
32681
|
}
|
|
32722
32682
|
get names() {
|
|
@@ -32733,15 +32693,15 @@ var require_codegen = __commonJS({
|
|
|
32733
32693
|
render({ _n }) {
|
|
32734
32694
|
return `${this.lhs} = ${this.rhs};` + _n;
|
|
32735
32695
|
}
|
|
32736
|
-
optimizeNames(
|
|
32737
|
-
if (this.lhs instanceof code_1.Name && !
|
|
32696
|
+
optimizeNames(names2, constants5) {
|
|
32697
|
+
if (this.lhs instanceof code_1.Name && !names2[this.lhs.str] && !this.sideEffects)
|
|
32738
32698
|
return;
|
|
32739
|
-
this.rhs = optimizeExpr(this.rhs,
|
|
32699
|
+
this.rhs = optimizeExpr(this.rhs, names2, constants5);
|
|
32740
32700
|
return this;
|
|
32741
32701
|
}
|
|
32742
32702
|
get names() {
|
|
32743
|
-
const
|
|
32744
|
-
return addExprNames(
|
|
32703
|
+
const names2 = this.lhs instanceof code_1.Name ? {} : { ...this.lhs.names };
|
|
32704
|
+
return addExprNames(names2, this.rhs);
|
|
32745
32705
|
}
|
|
32746
32706
|
};
|
|
32747
32707
|
var AssignOp = class extends Assign {
|
|
@@ -32797,8 +32757,8 @@ var require_codegen = __commonJS({
|
|
|
32797
32757
|
optimizeNodes() {
|
|
32798
32758
|
return `${this.code}` ? this : void 0;
|
|
32799
32759
|
}
|
|
32800
|
-
optimizeNames(
|
|
32801
|
-
this.code = optimizeExpr(this.code,
|
|
32760
|
+
optimizeNames(names2, constants5) {
|
|
32761
|
+
this.code = optimizeExpr(this.code, names2, constants5);
|
|
32802
32762
|
return this;
|
|
32803
32763
|
}
|
|
32804
32764
|
get names() {
|
|
@@ -32827,20 +32787,20 @@ var require_codegen = __commonJS({
|
|
|
32827
32787
|
}
|
|
32828
32788
|
return nodes.length > 0 ? this : void 0;
|
|
32829
32789
|
}
|
|
32830
|
-
optimizeNames(
|
|
32790
|
+
optimizeNames(names2, constants5) {
|
|
32831
32791
|
const { nodes } = this;
|
|
32832
32792
|
let i = nodes.length;
|
|
32833
32793
|
while (i--) {
|
|
32834
32794
|
const n = nodes[i];
|
|
32835
|
-
if (n.optimizeNames(
|
|
32795
|
+
if (n.optimizeNames(names2, constants5))
|
|
32836
32796
|
continue;
|
|
32837
|
-
subtractNames(
|
|
32797
|
+
subtractNames(names2, n.names);
|
|
32838
32798
|
nodes.splice(i, 1);
|
|
32839
32799
|
}
|
|
32840
32800
|
return nodes.length > 0 ? this : void 0;
|
|
32841
32801
|
}
|
|
32842
32802
|
get names() {
|
|
32843
|
-
return this.nodes.reduce((
|
|
32803
|
+
return this.nodes.reduce((names2, n) => addNames(names2, n.names), {});
|
|
32844
32804
|
}
|
|
32845
32805
|
};
|
|
32846
32806
|
var BlockNode = class extends ParentNode {
|
|
@@ -32885,20 +32845,20 @@ var require_codegen = __commonJS({
|
|
|
32885
32845
|
return void 0;
|
|
32886
32846
|
return this;
|
|
32887
32847
|
}
|
|
32888
|
-
optimizeNames(
|
|
32848
|
+
optimizeNames(names2, constants5) {
|
|
32889
32849
|
var _a3;
|
|
32890
|
-
this.else = (_a3 = this.else) === null || _a3 === void 0 ? void 0 : _a3.optimizeNames(
|
|
32891
|
-
if (!(super.optimizeNames(
|
|
32850
|
+
this.else = (_a3 = this.else) === null || _a3 === void 0 ? void 0 : _a3.optimizeNames(names2, constants5);
|
|
32851
|
+
if (!(super.optimizeNames(names2, constants5) || this.else))
|
|
32892
32852
|
return;
|
|
32893
|
-
this.condition = optimizeExpr(this.condition,
|
|
32853
|
+
this.condition = optimizeExpr(this.condition, names2, constants5);
|
|
32894
32854
|
return this;
|
|
32895
32855
|
}
|
|
32896
32856
|
get names() {
|
|
32897
|
-
const
|
|
32898
|
-
addExprNames(
|
|
32857
|
+
const names2 = super.names;
|
|
32858
|
+
addExprNames(names2, this.condition);
|
|
32899
32859
|
if (this.else)
|
|
32900
|
-
addNames(
|
|
32901
|
-
return
|
|
32860
|
+
addNames(names2, this.else.names);
|
|
32861
|
+
return names2;
|
|
32902
32862
|
}
|
|
32903
32863
|
};
|
|
32904
32864
|
If.kind = "if";
|
|
@@ -32913,10 +32873,10 @@ var require_codegen = __commonJS({
|
|
|
32913
32873
|
render(opts) {
|
|
32914
32874
|
return `for(${this.iteration})` + super.render(opts);
|
|
32915
32875
|
}
|
|
32916
|
-
optimizeNames(
|
|
32917
|
-
if (!super.optimizeNames(
|
|
32876
|
+
optimizeNames(names2, constants5) {
|
|
32877
|
+
if (!super.optimizeNames(names2, constants5))
|
|
32918
32878
|
return;
|
|
32919
|
-
this.iteration = optimizeExpr(this.iteration,
|
|
32879
|
+
this.iteration = optimizeExpr(this.iteration, names2, constants5);
|
|
32920
32880
|
return this;
|
|
32921
32881
|
}
|
|
32922
32882
|
get names() {
|
|
@@ -32937,8 +32897,8 @@ var require_codegen = __commonJS({
|
|
|
32937
32897
|
return `for(${varKind} ${name}=${from}; ${name}<${to}; ${name}++)` + super.render(opts);
|
|
32938
32898
|
}
|
|
32939
32899
|
get names() {
|
|
32940
|
-
const
|
|
32941
|
-
return addExprNames(
|
|
32900
|
+
const names2 = addExprNames(super.names, this.from);
|
|
32901
|
+
return addExprNames(names2, this.to);
|
|
32942
32902
|
}
|
|
32943
32903
|
};
|
|
32944
32904
|
var ForIter = class extends For {
|
|
@@ -32952,10 +32912,10 @@ var require_codegen = __commonJS({
|
|
|
32952
32912
|
render(opts) {
|
|
32953
32913
|
return `for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})` + super.render(opts);
|
|
32954
32914
|
}
|
|
32955
|
-
optimizeNames(
|
|
32956
|
-
if (!super.optimizeNames(
|
|
32915
|
+
optimizeNames(names2, constants5) {
|
|
32916
|
+
if (!super.optimizeNames(names2, constants5))
|
|
32957
32917
|
return;
|
|
32958
|
-
this.iterable = optimizeExpr(this.iterable,
|
|
32918
|
+
this.iterable = optimizeExpr(this.iterable, names2, constants5);
|
|
32959
32919
|
return this;
|
|
32960
32920
|
}
|
|
32961
32921
|
get names() {
|
|
@@ -32997,20 +32957,20 @@ var require_codegen = __commonJS({
|
|
|
32997
32957
|
(_b = this.finally) === null || _b === void 0 ? void 0 : _b.optimizeNodes();
|
|
32998
32958
|
return this;
|
|
32999
32959
|
}
|
|
33000
|
-
optimizeNames(
|
|
32960
|
+
optimizeNames(names2, constants5) {
|
|
33001
32961
|
var _a3, _b;
|
|
33002
|
-
super.optimizeNames(
|
|
33003
|
-
(_a3 = this.catch) === null || _a3 === void 0 ? void 0 : _a3.optimizeNames(
|
|
33004
|
-
(_b = this.finally) === null || _b === void 0 ? void 0 : _b.optimizeNames(
|
|
32962
|
+
super.optimizeNames(names2, constants5);
|
|
32963
|
+
(_a3 = this.catch) === null || _a3 === void 0 ? void 0 : _a3.optimizeNames(names2, constants5);
|
|
32964
|
+
(_b = this.finally) === null || _b === void 0 ? void 0 : _b.optimizeNames(names2, constants5);
|
|
33005
32965
|
return this;
|
|
33006
32966
|
}
|
|
33007
32967
|
get names() {
|
|
33008
|
-
const
|
|
32968
|
+
const names2 = super.names;
|
|
33009
32969
|
if (this.catch)
|
|
33010
|
-
addNames(
|
|
32970
|
+
addNames(names2, this.catch.names);
|
|
33011
32971
|
if (this.finally)
|
|
33012
|
-
addNames(
|
|
33013
|
-
return
|
|
32972
|
+
addNames(names2, this.finally.names);
|
|
32973
|
+
return names2;
|
|
33014
32974
|
}
|
|
33015
32975
|
};
|
|
33016
32976
|
var Catch = class extends BlockNode {
|
|
@@ -33294,15 +33254,15 @@ var require_codegen = __commonJS({
|
|
|
33294
33254
|
}
|
|
33295
33255
|
};
|
|
33296
33256
|
exports.CodeGen = CodeGen;
|
|
33297
|
-
function addNames(
|
|
33257
|
+
function addNames(names2, from) {
|
|
33298
33258
|
for (const n in from)
|
|
33299
|
-
|
|
33300
|
-
return
|
|
33259
|
+
names2[n] = (names2[n] || 0) + (from[n] || 0);
|
|
33260
|
+
return names2;
|
|
33301
33261
|
}
|
|
33302
|
-
function addExprNames(
|
|
33303
|
-
return from instanceof code_1._CodeOrName ? addNames(
|
|
33262
|
+
function addExprNames(names2, from) {
|
|
33263
|
+
return from instanceof code_1._CodeOrName ? addNames(names2, from.names) : names2;
|
|
33304
33264
|
}
|
|
33305
|
-
function optimizeExpr(expr,
|
|
33265
|
+
function optimizeExpr(expr, names2, constants5) {
|
|
33306
33266
|
if (expr instanceof code_1.Name)
|
|
33307
33267
|
return replaceName(expr);
|
|
33308
33268
|
if (!canOptimize(expr))
|
|
@@ -33318,18 +33278,18 @@ var require_codegen = __commonJS({
|
|
|
33318
33278
|
}, []));
|
|
33319
33279
|
function replaceName(n) {
|
|
33320
33280
|
const c = constants5[n.str];
|
|
33321
|
-
if (c === void 0 ||
|
|
33281
|
+
if (c === void 0 || names2[n.str] !== 1)
|
|
33322
33282
|
return n;
|
|
33323
|
-
delete
|
|
33283
|
+
delete names2[n.str];
|
|
33324
33284
|
return c;
|
|
33325
33285
|
}
|
|
33326
33286
|
function canOptimize(e) {
|
|
33327
|
-
return e instanceof code_1._Code && e._items.some((c) => c instanceof code_1.Name &&
|
|
33287
|
+
return e instanceof code_1._Code && e._items.some((c) => c instanceof code_1.Name && names2[c.str] === 1 && constants5[c.str] !== void 0);
|
|
33328
33288
|
}
|
|
33329
33289
|
}
|
|
33330
|
-
function subtractNames(
|
|
33290
|
+
function subtractNames(names2, from) {
|
|
33331
33291
|
for (const n in from)
|
|
33332
|
-
|
|
33292
|
+
names2[n] = (names2[n] || 0) - (from[n] || 0);
|
|
33333
33293
|
}
|
|
33334
33294
|
function not(x) {
|
|
33335
33295
|
return typeof x == "boolean" || typeof x == "number" || x === null ? !x : (0, code_1._)`!${par(x)}`;
|
|
@@ -33527,7 +33487,7 @@ var require_names = __commonJS({
|
|
|
33527
33487
|
"use strict";
|
|
33528
33488
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33529
33489
|
var codegen_1 = require_codegen();
|
|
33530
|
-
var
|
|
33490
|
+
var names2 = {
|
|
33531
33491
|
// validation function arguments
|
|
33532
33492
|
data: new codegen_1.Name("data"),
|
|
33533
33493
|
// data passed to validation function
|
|
@@ -33556,7 +33516,7 @@ var require_names = __commonJS({
|
|
|
33556
33516
|
jsonLen: new codegen_1.Name("jsonLen"),
|
|
33557
33517
|
jsonPart: new codegen_1.Name("jsonPart")
|
|
33558
33518
|
};
|
|
33559
|
-
exports.default =
|
|
33519
|
+
exports.default = names2;
|
|
33560
33520
|
}
|
|
33561
33521
|
});
|
|
33562
33522
|
|
|
@@ -42928,8 +42888,8 @@ var require_standalone = __commonJS({
|
|
|
42928
42888
|
}
|
|
42929
42889
|
function setUsedState(name, state) {
|
|
42930
42890
|
const { prefix } = name;
|
|
42931
|
-
const
|
|
42932
|
-
|
|
42891
|
+
const names2 = usedValues[prefix] = usedValues[prefix] || /* @__PURE__ */ new Map();
|
|
42892
|
+
names2.set(name, state);
|
|
42933
42893
|
}
|
|
42934
42894
|
}
|
|
42935
42895
|
}
|
|
@@ -58762,8 +58722,8 @@ function emoji() {
|
|
|
58762
58722
|
}
|
|
58763
58723
|
var ipv4 = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/;
|
|
58764
58724
|
var ipv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/;
|
|
58765
|
-
var mac = (
|
|
58766
|
-
const escapedDelim = escapeRegex(
|
|
58725
|
+
var mac = (delimiter2) => {
|
|
58726
|
+
const escapedDelim = escapeRegex(delimiter2 ?? ":");
|
|
58767
58727
|
return new RegExp(`^(?:[0-9A-F]{2}${escapedDelim}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${escapedDelim}){5}[0-9a-f]{2}$`);
|
|
58768
58728
|
};
|
|
58769
58729
|
var cidrv4 = /^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/;
|
|
@@ -73407,12 +73367,12 @@ function rewriteKeyNames(ctx) {
|
|
|
73407
73367
|
const rewrites = /* @__PURE__ */ new Map();
|
|
73408
73368
|
for (const record5 of pendingRecords.get(ctx) ?? []) {
|
|
73409
73369
|
const seen = ctx.seen.get(record5);
|
|
73410
|
-
const
|
|
73411
|
-
if (!
|
|
73370
|
+
const names2 = (seen?.def ?? seen?.schema)?.propertyNames;
|
|
73371
|
+
if (!names2 || names2 === true || rewrites.has(names2))
|
|
73412
73372
|
continue;
|
|
73413
|
-
const rewritten = stringifyKeyNames(bySchema,
|
|
73414
|
-
if (rewritten !==
|
|
73415
|
-
rewrites.set(
|
|
73373
|
+
const rewritten = stringifyKeyNames(bySchema, names2, /* @__PURE__ */ new Set());
|
|
73374
|
+
if (rewritten !== names2)
|
|
73375
|
+
rewrites.set(names2, rewritten);
|
|
73416
73376
|
}
|
|
73417
73377
|
if (!rewrites.size)
|
|
73418
73378
|
return;
|
|
@@ -76560,7 +76520,13 @@ var RunRecordSchema = external_exports.object({
|
|
|
76560
76520
|
/** The judge's P(advantage), 0–1, when its verdict routed the run; validation calibrates the cutoff from it. */
|
|
76561
76521
|
judgeAdvantage: UnitSchema.exactOptional(),
|
|
76562
76522
|
/** Set when a calibration trial served the rule against the judge's verdict. */
|
|
76563
|
-
judgeTrial: external_exports.boolean().exactOptional()
|
|
76523
|
+
judgeTrial: external_exports.boolean().exactOptional(),
|
|
76524
|
+
/** Set by the caller when a live routing-vs-control comparison chose this run's arm;
|
|
76525
|
+
* unset outside a comparison. The caller decides the arm itself and reports it here —
|
|
76526
|
+
* bizzy-v2 never sees or sets it. */
|
|
76527
|
+
arm: external_exports.enum(["treatment", "control"]).exactOptional(),
|
|
76528
|
+
/** The comparison window this run belongs to, when `arm` is set. */
|
|
76529
|
+
windowId: SafeIdSchema.exactOptional()
|
|
76564
76530
|
}),
|
|
76565
76531
|
startedAt: IsoDateSchema,
|
|
76566
76532
|
settledAt: IsoDateSchema,
|
|
@@ -77372,9 +77338,9 @@ function judgeSelectStrategy(constants5 = judgeSelectConstants) {
|
|
|
77372
77338
|
return kept ? done(kept, state, "judge-select: kept, no verdict") : { kind: "done", decision: base, state };
|
|
77373
77339
|
}
|
|
77374
77340
|
const advantage = result.answers.advantage;
|
|
77375
|
-
const
|
|
77341
|
+
const verdict2 = advantage > constants5.cutoff ? "capable" : "efficient";
|
|
77376
77342
|
const against = input2.judgeTrial === true && input2.mode === "auto" && input2.task.risk === "low" && base.source !== "trial";
|
|
77377
|
-
const tier = against ?
|
|
77343
|
+
const tier = against ? verdict2 === "capable" ? "efficient" : "capable" : verdict2;
|
|
77378
77344
|
const { judgeTrial: _, ...fresh } = state;
|
|
77379
77345
|
const next = {
|
|
77380
77346
|
...fresh,
|
|
@@ -81354,8 +81320,17 @@ var routeNotices = {
|
|
|
81354
81320
|
absent: "no OpenRouter key: routing with Bizzy's own rules",
|
|
81355
81321
|
failed: "Jev did not answer: routing with Bizzy's own rules"
|
|
81356
81322
|
};
|
|
81323
|
+
var noContextNotice = "no context set: routing with Bizzy's own rules";
|
|
81357
81324
|
async function routeSteps(body, options, onStep, signal) {
|
|
81358
|
-
|
|
81325
|
+
const done = await driveRoute(
|
|
81326
|
+
body,
|
|
81327
|
+
await routeInput(body.envelope, options),
|
|
81328
|
+
options,
|
|
81329
|
+
onStep,
|
|
81330
|
+
signal
|
|
81331
|
+
);
|
|
81332
|
+
const implicitCascade = body.envelope.profile !== "cascade" && body.material.policy === "none";
|
|
81333
|
+
return implicitCascade && !done.notice ? { ...done, notice: noContextNotice } : done;
|
|
81359
81334
|
}
|
|
81360
81335
|
function driveRoute(body, input2, options, onStep = () => {
|
|
81361
81336
|
}, signal) {
|
|
@@ -81563,16 +81538,16 @@ async function matchModels(available, server, provider) {
|
|
|
81563
81538
|
function parseHarnessComplete(raw) {
|
|
81564
81539
|
const body = record2(raw) ?? reject("body must be a JSON object");
|
|
81565
81540
|
if (!reasons.has(body.reason)) reject("invalid reason");
|
|
81566
|
-
const
|
|
81541
|
+
const usage = body.usage === void 0 ? void 0 : record2(body.usage) ?? reject("invalid usage");
|
|
81567
81542
|
return {
|
|
81568
81543
|
session: id(body.session, "session"),
|
|
81569
81544
|
turnId: id(body.turnId, "turnId"),
|
|
81570
81545
|
reason: body.reason,
|
|
81571
81546
|
...body.model === void 0 ? {} : { model: id(body.model, "model") },
|
|
81572
|
-
...
|
|
81547
|
+
...usage ? {
|
|
81573
81548
|
usage: {
|
|
81574
|
-
inputTokens: count(
|
|
81575
|
-
outputTokens: count(
|
|
81549
|
+
inputTokens: count(usage.inputTokens, "usage.inputTokens"),
|
|
81550
|
+
outputTokens: count(usage.outputTokens, "usage.outputTokens")
|
|
81576
81551
|
}
|
|
81577
81552
|
} : {}
|
|
81578
81553
|
};
|
|
@@ -82017,12 +81992,12 @@ function terminalWatcher(onEnd) {
|
|
|
82017
81992
|
continue;
|
|
82018
81993
|
ended = true;
|
|
82019
81994
|
const response = record4(event.response);
|
|
82020
|
-
const
|
|
81995
|
+
const usage = record4(response?.usage);
|
|
82021
81996
|
const output2 = Array.isArray(response?.output) ? response.output : [];
|
|
82022
81997
|
const askedForTools = output2.some((item) => /call$/.test(String(record4(item)?.type)));
|
|
82023
81998
|
onEnd(
|
|
82024
81999
|
event.type === "response.completed" ? "answer" : "error",
|
|
82025
|
-
|
|
82000
|
+
usage && typeof usage.input_tokens === "number" && typeof usage.output_tokens === "number" ? { inputTokens: usage.input_tokens, outputTokens: usage.output_tokens } : void 0,
|
|
82026
82001
|
askedForTools
|
|
82027
82002
|
);
|
|
82028
82003
|
}
|
|
@@ -82166,12 +82141,12 @@ function createCodexRelay(options, server) {
|
|
|
82166
82141
|
});
|
|
82167
82142
|
raw.writeHead(upstream.status, responseHeaders);
|
|
82168
82143
|
let settling;
|
|
82169
|
-
const watch = position && upstream.ok ? terminalWatcher((reason,
|
|
82144
|
+
const watch = position && upstream.ok ? terminalWatcher((reason, usage, askedForTools) => {
|
|
82170
82145
|
const key = `${position.session}:${position.turnId}`;
|
|
82171
82146
|
const sum = turns.get(key) ?? { inputTokens: 0, outputTokens: 0 };
|
|
82172
|
-
if (
|
|
82173
|
-
sum.inputTokens +=
|
|
82174
|
-
sum.outputTokens +=
|
|
82147
|
+
if (usage) {
|
|
82148
|
+
sum.inputTokens += usage.inputTokens;
|
|
82149
|
+
sum.outputTokens += usage.outputTokens;
|
|
82175
82150
|
}
|
|
82176
82151
|
turns.set(key, sum);
|
|
82177
82152
|
if (askedForTools && reason === "answer") return;
|
|
@@ -82876,6 +82851,7 @@ import {
|
|
|
82876
82851
|
} from "node:fs";
|
|
82877
82852
|
import { join as join6 } from "node:path";
|
|
82878
82853
|
var entryFile = "bizzy-routing.js";
|
|
82854
|
+
var npx = "npx @bizzywork/routing";
|
|
82879
82855
|
function dataDirOf(io) {
|
|
82880
82856
|
return io.env.BIZZY_API_DATA_DIR ?? join6(io.home, ".bizzy/routing");
|
|
82881
82857
|
}
|
|
@@ -83021,7 +82997,7 @@ function claude(target, args) {
|
|
|
83021
82997
|
return false;
|
|
83022
82998
|
}
|
|
83023
82999
|
}
|
|
83024
|
-
function
|
|
83000
|
+
function wireClaude(target, runtime) {
|
|
83025
83001
|
const marketplace = claudeDir(target);
|
|
83026
83002
|
const plugin = join8(marketplace, "bizzy");
|
|
83027
83003
|
rmSync3(marketplace, { recursive: true, force: true });
|
|
@@ -83044,18 +83020,19 @@ function installClaude(target, runtime) {
|
|
|
83044
83020
|
});
|
|
83045
83021
|
const added = claude(target, ["marketplace", "add", marketplace]) || claude(target, ["marketplace", "update", marketplaceName]);
|
|
83046
83022
|
const installed = added && (claude(target, ["install", pluginId]) || claude(target, ["update", pluginId]));
|
|
83047
|
-
return
|
|
83048
|
-
|
|
83049
|
-
|
|
83050
|
-
|
|
83051
|
-
|
|
83052
|
-
|
|
83023
|
+
return {
|
|
83024
|
+
done: `Wired Claude Code: ${marketplace}`,
|
|
83025
|
+
notes: [],
|
|
83026
|
+
...installed && {
|
|
83027
|
+
run: { command: "claude /reload-plugins", title: "Start Claude Code with" }
|
|
83028
|
+
},
|
|
83029
|
+
next: installed ? "Already in a Claude Code session? Type /reload-plugins there instead." : `In Claude Code:
|
|
83053
83030
|
/plugin marketplace add ${marketplace}
|
|
83054
83031
|
/plugin install ${pluginId}
|
|
83055
|
-
/reload-plugins
|
|
83056
|
-
|
|
83032
|
+
/reload-plugins`
|
|
83033
|
+
};
|
|
83057
83034
|
}
|
|
83058
|
-
function
|
|
83035
|
+
function wireOmp(target, runtime) {
|
|
83059
83036
|
const extension = ompDir(target);
|
|
83060
83037
|
rmSync3(extension, { recursive: true, force: true });
|
|
83061
83038
|
cpSync2(join8(runtime, "harnesses/omp"), extension, { recursive: true });
|
|
@@ -83063,13 +83040,13 @@ function installOmp(target, runtime) {
|
|
|
83063
83040
|
url: `http://127.0.0.1:${target.port}`,
|
|
83064
83041
|
server: serverCommand(target.io, runtime, target.dataDir, target.port)
|
|
83065
83042
|
});
|
|
83066
|
-
return
|
|
83067
|
-
|
|
83068
|
-
|
|
83069
|
-
|
|
83070
|
-
|
|
83043
|
+
return {
|
|
83044
|
+
done: `Wired omp: ${extension}`,
|
|
83045
|
+
notes: [],
|
|
83046
|
+
next: "In omp: /model bizzy/auto\nIt routes among the models you are logged in to; @default serves when routing is off."
|
|
83047
|
+
};
|
|
83071
83048
|
}
|
|
83072
|
-
function
|
|
83049
|
+
function wireCodex(target, runtime) {
|
|
83073
83050
|
const profile = codexProfile(target);
|
|
83074
83051
|
const text = `${codexHeader} Run: codex -p bizzy
|
|
83075
83052
|
model = "bizzy-auto"
|
|
@@ -83082,26 +83059,20 @@ wire_api = "responses"
|
|
|
83082
83059
|
requires_openai_auth = true
|
|
83083
83060
|
`;
|
|
83084
83061
|
mkdirSync4(resolve2(profile, ".."), { recursive: true });
|
|
83085
|
-
|
|
83062
|
+
const notes = [];
|
|
83086
83063
|
if (existsSync3(profile) && readFileSync5(profile, "utf8") !== text) {
|
|
83087
83064
|
const backup = `${profile}.${Date.now()}.bak`;
|
|
83088
83065
|
copyFileSync(profile, backup);
|
|
83089
|
-
|
|
83090
|
-
`;
|
|
83066
|
+
notes.push(`Backed up the old profile to ${backup}`);
|
|
83091
83067
|
}
|
|
83092
83068
|
writeFileSync3(profile, text);
|
|
83093
|
-
|
|
83094
|
-
return
|
|
83095
|
-
${service}
|
|
83096
|
-
Then:
|
|
83097
|
-
codex -p bizzy
|
|
83098
|
-
`;
|
|
83069
|
+
notes.push(installService(target.io, runtime, target.dataDir, target.port).trim());
|
|
83070
|
+
return { done: `Wired Codex: ${profile}`, notes, next: "codex -p bizzy" };
|
|
83099
83071
|
}
|
|
83100
|
-
function
|
|
83101
|
-
|
|
83102
|
-
if (harness === "
|
|
83103
|
-
|
|
83104
|
-
return installCodex(target, runtime);
|
|
83072
|
+
function wire(harness, target, runtime) {
|
|
83073
|
+
if (harness === "claude-code") return wireClaude(target, runtime);
|
|
83074
|
+
if (harness === "omp") return wireOmp(target, runtime);
|
|
83075
|
+
return wireCodex(target, runtime);
|
|
83105
83076
|
}
|
|
83106
83077
|
function uninstall(harness, target, purge) {
|
|
83107
83078
|
const lines2 = [];
|
|
@@ -83150,7 +83121,7 @@ async function diagnose(target) {
|
|
|
83150
83121
|
const { io, dataDir } = target;
|
|
83151
83122
|
const checks = [];
|
|
83152
83123
|
const add = (check2) => checks.push(check2);
|
|
83153
|
-
const reinstall =
|
|
83124
|
+
const reinstall = `run \`${npx} install\` again`;
|
|
83154
83125
|
const runtime = join9(dataDir, "runtime", entryFile);
|
|
83155
83126
|
add(
|
|
83156
83127
|
existsSync4(runtime) ? { name: "runtime", status: "ok", detail: runtime } : { name: "runtime", status: "fail", detail: "no runtime copy", fix: reinstall }
|
|
@@ -83198,14 +83169,14 @@ async function diagnose(target) {
|
|
|
83198
83169
|
name: "routing key",
|
|
83199
83170
|
status: "warn",
|
|
83200
83171
|
detail: "none: turns route with Bizzy's own rules",
|
|
83201
|
-
fix:
|
|
83172
|
+
fix: `run \`${npx} key\``
|
|
83202
83173
|
});
|
|
83203
83174
|
else if (!routingKeyShape.test(key))
|
|
83204
83175
|
add({
|
|
83205
83176
|
name: "routing key",
|
|
83206
83177
|
status: "fail",
|
|
83207
83178
|
detail: "malformed",
|
|
83208
|
-
fix:
|
|
83179
|
+
fix: `run \`${npx} key\` with the key you were given`
|
|
83209
83180
|
});
|
|
83210
83181
|
else {
|
|
83211
83182
|
const status2 = await answers(`${hosted.replace(/\/+$/, "")}/v1/settle`, {
|
|
@@ -83218,7 +83189,7 @@ async function diagnose(target) {
|
|
|
83218
83189
|
name: "routing key",
|
|
83219
83190
|
status: "fail",
|
|
83220
83191
|
detail: `refused by ${hosted}`,
|
|
83221
|
-
fix:
|
|
83192
|
+
fix: `run \`${npx} key\` with a current key`
|
|
83222
83193
|
} : {
|
|
83223
83194
|
name: "hosted API",
|
|
83224
83195
|
status: "fail",
|
|
@@ -83241,7 +83212,7 @@ async function diagnose(target) {
|
|
|
83241
83212
|
name: harness,
|
|
83242
83213
|
status: "fail",
|
|
83243
83214
|
detail: "wired to another runtime, Node or port",
|
|
83244
|
-
fix: `run
|
|
83215
|
+
fix: `run \`${npx} install ${harness}\` again`
|
|
83245
83216
|
}
|
|
83246
83217
|
);
|
|
83247
83218
|
}
|
|
@@ -83251,7 +83222,7 @@ async function diagnose(target) {
|
|
|
83251
83222
|
name: "codex service",
|
|
83252
83223
|
status: "fail",
|
|
83253
83224
|
detail: "no login service",
|
|
83254
|
-
fix:
|
|
83225
|
+
fix: `run \`${npx} install codex\` again`
|
|
83255
83226
|
});
|
|
83256
83227
|
const up = await answers(`http://127.0.0.1:${target.port}/v1/harness/step`) === 405;
|
|
83257
83228
|
add(
|
|
@@ -83259,7 +83230,7 @@ async function diagnose(target) {
|
|
|
83259
83230
|
name: "server",
|
|
83260
83231
|
status: installed.includes("codex") ? "fail" : "warn",
|
|
83261
83232
|
detail: `not running on 127.0.0.1:${target.port}${installed.includes("codex") ? "" : "; the mod and extension start it when needed"}`,
|
|
83262
|
-
...installed.includes("codex") ? { fix:
|
|
83233
|
+
...installed.includes("codex") ? { fix: `run \`${npx} serve\`, or \`${npx} install codex\` again for its service` } : {}
|
|
83263
83234
|
}
|
|
83264
83235
|
);
|
|
83265
83236
|
if (!installed.length)
|
|
@@ -83267,17 +83238,10 @@ async function diagnose(target) {
|
|
|
83267
83238
|
name: "harnesses",
|
|
83268
83239
|
status: "warn",
|
|
83269
83240
|
detail: "none installed",
|
|
83270
|
-
fix:
|
|
83241
|
+
fix: `run \`${npx} install\``
|
|
83271
83242
|
});
|
|
83272
83243
|
return checks;
|
|
83273
83244
|
}
|
|
83274
|
-
function formatChecks(checks) {
|
|
83275
|
-
const mark = { ok: "ok ", warn: "warn", fail: "FAIL" };
|
|
83276
|
-
return `${checks.map(
|
|
83277
|
-
(check2) => `${mark[check2.status]} ${check2.name}: ${check2.detail}${check2.fix ? ` (${check2.fix})` : ""}`
|
|
83278
|
-
).join("\n")}
|
|
83279
|
-
`;
|
|
83280
|
-
}
|
|
83281
83245
|
async function status(target) {
|
|
83282
83246
|
const checks = await diagnose(target);
|
|
83283
83247
|
const show = /* @__PURE__ */ new Set([
|
|
@@ -83291,14 +83255,44 @@ async function status(target) {
|
|
|
83291
83255
|
"server",
|
|
83292
83256
|
"harnesses"
|
|
83293
83257
|
]);
|
|
83294
|
-
|
|
83295
|
-
|
|
83296
|
-
|
|
83297
|
-
|
|
83258
|
+
return checks.filter((check2) => show.has(check2.name)).map(({ name, status: status2, detail }) => ({ name, status: status2, detail }));
|
|
83259
|
+
}
|
|
83260
|
+
|
|
83261
|
+
// bizzy-routing/launcher/src/menu.ts
|
|
83262
|
+
import { existsSync as existsSync5 } from "node:fs";
|
|
83263
|
+
import { delimiter, join as join10 } from "node:path";
|
|
83264
|
+
var names = {
|
|
83265
|
+
"claude-code": "Claude Code",
|
|
83266
|
+
omp: "oh-my-pi (omp)",
|
|
83267
|
+
codex: "Codex"
|
|
83268
|
+
};
|
|
83269
|
+
var commands = {
|
|
83270
|
+
"claude-code": "claude",
|
|
83271
|
+
omp: "omp",
|
|
83272
|
+
codex: "codex"
|
|
83273
|
+
};
|
|
83274
|
+
function onPath(io, command) {
|
|
83275
|
+
return (io.env.PATH ?? "").split(delimiter).some((dir) => dir && existsSync5(join10(dir, command)));
|
|
83276
|
+
}
|
|
83277
|
+
function noteFor(harness, target) {
|
|
83278
|
+
if (existsSync5(wiringFile(harness, target))) return "installed, picking it updates it";
|
|
83279
|
+
return onPath(target.io, commands[harness]) ? `${commands[harness]} found` : "not found";
|
|
83280
|
+
}
|
|
83281
|
+
async function pickHarness(target, { offerHelp }) {
|
|
83282
|
+
const choices = Object.keys(names).map(
|
|
83283
|
+
(harness) => ({
|
|
83284
|
+
value: harness,
|
|
83285
|
+
label: names[harness],
|
|
83286
|
+
hint: noteFor(harness, target)
|
|
83287
|
+
})
|
|
83288
|
+
);
|
|
83289
|
+
if (offerHelp) choices.push({ value: "help", label: "Show all commands" });
|
|
83290
|
+
const picked = await target.io.ui.select("Which harness should Bizzy route in?", choices);
|
|
83291
|
+
return picked === "help" ? void 0 : picked;
|
|
83298
83292
|
}
|
|
83299
83293
|
|
|
83300
83294
|
// bizzy-routing/launcher/src/serve.ts
|
|
83301
|
-
import { join as
|
|
83295
|
+
import { join as join11 } from "node:path";
|
|
83302
83296
|
async function serve(io) {
|
|
83303
83297
|
const dataDir = dataDirOf(io);
|
|
83304
83298
|
const env = {
|
|
@@ -83309,7 +83303,7 @@ async function serve(io) {
|
|
|
83309
83303
|
const log = (line) => io.stderr(`${line}
|
|
83310
83304
|
`);
|
|
83311
83305
|
try {
|
|
83312
|
-
return await startLocalServer(env, log, { docsDir:
|
|
83306
|
+
return await startLocalServer(env, log, { docsDir: join11(io.bundleDir, "static") });
|
|
83313
83307
|
} catch (error62) {
|
|
83314
83308
|
const port = env.PORT ?? "4100";
|
|
83315
83309
|
if (error62.code !== "EADDRINUSE" || !await bizzyAnswers(port))
|
|
@@ -83331,38 +83325,85 @@ async function bizzyAnswers(port) {
|
|
|
83331
83325
|
|
|
83332
83326
|
// bizzy-routing/launcher/src/main.ts
|
|
83333
83327
|
var harnesses2 = ["claude-code", "omp", "codex"];
|
|
83334
|
-
var
|
|
83335
|
-
|
|
83336
|
-
|
|
83337
|
-
|
|
83338
|
-
|
|
83339
|
-
|
|
83340
|
-
|
|
83341
|
-
|
|
83342
|
-
|
|
83343
|
-
|
|
83344
|
-
|
|
83345
|
-
|
|
83346
|
-
|
|
83347
|
-
doctor
|
|
83348
|
-
|
|
83328
|
+
var help = `Bizzy Auto picks the model for each request in Claude Code, oh-my-pi (omp) or Codex.
|
|
83329
|
+
|
|
83330
|
+
Usage: ${npx} [command] [options]
|
|
83331
|
+
|
|
83332
|
+
Run it with no command to pick a harness and set it up.
|
|
83333
|
+
|
|
83334
|
+
Commands:
|
|
83335
|
+
install [harness] Set up routing in a harness: claude-code, omp or codex. Copies the server to
|
|
83336
|
+
~/.bizzy/routing/runtime, wires the harness to it, and asks once for your routing
|
|
83337
|
+
key. With no harness, asks which one.
|
|
83338
|
+
uninstall <harness> Remove what install wrote for that harness.
|
|
83339
|
+
key Save or replace your routing key in ~/.bizzy/routing/.env.
|
|
83340
|
+
status Show what's installed and how it routes.
|
|
83341
|
+
doctor Check the runtime, key, hosted API, server and each harness, and say how to fix them.
|
|
83342
|
+
serve Run the routing server on 127.0.0.1 (PORT, default 4100).
|
|
83343
|
+
help Show this help.
|
|
83344
|
+
|
|
83345
|
+
Options:
|
|
83346
|
+
--dir <dir> install, uninstall: use this folder instead of the harness's own.
|
|
83347
|
+
--port <port> install, uninstall, doctor: the server's port (default 4100).
|
|
83348
|
+
--key-stdin install: read the routing key from stdin instead of asking.
|
|
83349
|
+
--no-share-prompts install: keep prompts on this machine; the hosted API then routes on its rules.
|
|
83350
|
+
--share-prompts install: send prompts to the hosted judge again (the default).
|
|
83351
|
+
--stdin key: read the key from stdin instead of asking.
|
|
83352
|
+
--purge uninstall: also remove ~/.bizzy/routing, with its data and key.
|
|
83353
|
+
-h, --help Show this help.
|
|
83354
|
+
-v, --version Show the version.
|
|
83355
|
+
|
|
83356
|
+
Examples:
|
|
83357
|
+
${npx} pick a harness and set it up
|
|
83358
|
+
${npx} install claude-code set up Claude Code directly
|
|
83359
|
+
${npx} doctor check the setup
|
|
83349
83360
|
`;
|
|
83350
83361
|
function saveKey(target, raw) {
|
|
83351
83362
|
const key = raw.trim();
|
|
83352
83363
|
if (!routingKeyShape.test(key))
|
|
83353
83364
|
throw new Error("that isn't a routing key: 32 or more letters, digits, '-' or '_'");
|
|
83354
83365
|
writeEnvValues(target.dataDir, { BIZZY_ROUTING_KEY: key });
|
|
83355
|
-
return `
|
|
83356
|
-
`;
|
|
83357
|
-
}
|
|
83358
|
-
async function askKey(io) {
|
|
83359
|
-
return io.interactive ? io.askSecret("Bizzy routing key: ") : io.readStdin();
|
|
83366
|
+
return `Saved the routing key to ${envPath(target.dataDir)}; a running server reads it when it next starts`;
|
|
83360
83367
|
}
|
|
83368
|
+
var keyHint = "Paste it, or press Enter to skip: turns then route with Bizzy's own rules on this machine.";
|
|
83361
83369
|
function harnessOf(name) {
|
|
83362
83370
|
if (harnesses2.includes(name)) return name;
|
|
83363
|
-
throw new Error(`expected one of ${harnesses2.join(", ")}
|
|
83364
|
-
|
|
83365
|
-
|
|
83371
|
+
throw new Error(`expected one of ${harnesses2.join(", ")}; run \`${npx} help\` for usage`);
|
|
83372
|
+
}
|
|
83373
|
+
async function installFlow(harness, target, flags) {
|
|
83374
|
+
const { io } = target;
|
|
83375
|
+
const { ui } = io;
|
|
83376
|
+
const runtime = await ui.step(
|
|
83377
|
+
"Copying the routing server",
|
|
83378
|
+
() => installRuntime(io, target.dataDir),
|
|
83379
|
+
(dir) => `Copied the routing server to ${dir}`
|
|
83380
|
+
);
|
|
83381
|
+
const wired = await ui.step(
|
|
83382
|
+
`Wiring ${names[harness]}`,
|
|
83383
|
+
() => wire(harness, target, runtime),
|
|
83384
|
+
(result) => result.done
|
|
83385
|
+
);
|
|
83386
|
+
for (const note of wired.notes) ui.message(note);
|
|
83387
|
+
const hasKey = io.env.BIZZY_ROUTING_KEY ?? readEnvFile(target.dataDir).BIZZY_ROUTING_KEY;
|
|
83388
|
+
const key = flags.keyStdin ? await io.readStdin() : io.interactive && !hasKey ? await ui.password("Bizzy routing key", keyHint) : "";
|
|
83389
|
+
if (key.trim())
|
|
83390
|
+
await ui.step(
|
|
83391
|
+
"Saving the routing key",
|
|
83392
|
+
() => saveKey(target, key),
|
|
83393
|
+
(done) => done
|
|
83394
|
+
);
|
|
83395
|
+
else if (io.interactive && !hasKey) ui.warn("No routing key: turns route with Bizzy's own rules");
|
|
83396
|
+
if (flags.sharePrompts === false) writeEnvValues(target.dataDir, { BIZZY_SHARE_PROMPTS: "0" });
|
|
83397
|
+
else if (flags.sharePrompts) writeEnvValues(target.dataDir, { BIZZY_SHARE_PROMPTS: void 0 });
|
|
83398
|
+
if (wired.run) ui.command(wired.run.command, wired.run.title);
|
|
83399
|
+
ui.note(wired.next, "Next");
|
|
83400
|
+
}
|
|
83401
|
+
function verdict(checks) {
|
|
83402
|
+
const count2 = (status2) => checks.filter((check2) => check2.status === status2).length;
|
|
83403
|
+
const plural2 = (n, word) => `${n} ${word}${n === 1 ? "" : "s"}`;
|
|
83404
|
+
if (count2("fail")) return `${plural2(count2("fail"), "problem")} to fix`;
|
|
83405
|
+
if (count2("warn")) return `Working, with ${plural2(count2("warn"), "warning")}`;
|
|
83406
|
+
return "All good";
|
|
83366
83407
|
}
|
|
83367
83408
|
async function run2(io) {
|
|
83368
83409
|
const { values, positionals } = parseArgs({
|
|
@@ -83386,9 +83427,13 @@ async function run2(io) {
|
|
|
83386
83427
|
`);
|
|
83387
83428
|
return { exit: 0 };
|
|
83388
83429
|
}
|
|
83389
|
-
if (values.help ||
|
|
83390
|
-
io.stdout(
|
|
83391
|
-
return { exit:
|
|
83430
|
+
if (values.help || command === "help") {
|
|
83431
|
+
io.stdout(help);
|
|
83432
|
+
return { exit: 0 };
|
|
83433
|
+
}
|
|
83434
|
+
if (!command && !io.interactive) {
|
|
83435
|
+
io.stdout(help);
|
|
83436
|
+
return { exit: 1 };
|
|
83392
83437
|
}
|
|
83393
83438
|
if (command === "serve") {
|
|
83394
83439
|
const app = await serve(io);
|
|
@@ -83402,29 +83447,66 @@ async function run2(io) {
|
|
|
83402
83447
|
port,
|
|
83403
83448
|
...values.dir ? { dir: values.dir } : {}
|
|
83404
83449
|
};
|
|
83405
|
-
|
|
83406
|
-
|
|
83407
|
-
|
|
83408
|
-
|
|
83409
|
-
|
|
83410
|
-
|
|
83411
|
-
|
|
83412
|
-
|
|
83413
|
-
|
|
83414
|
-
|
|
83415
|
-
|
|
83416
|
-
|
|
83417
|
-
|
|
83418
|
-
|
|
83419
|
-
|
|
83420
|
-
|
|
83421
|
-
|
|
83422
|
-
|
|
83423
|
-
|
|
83450
|
+
const flags = {
|
|
83451
|
+
keyStdin: values["key-stdin"] === true,
|
|
83452
|
+
sharePrompts: values["no-share-prompts"] ? false : values["share-prompts"] ? true : void 0
|
|
83453
|
+
};
|
|
83454
|
+
if (command && !["install", "uninstall", "key", "status", "doctor"].includes(command))
|
|
83455
|
+
throw new Error(`unknown command: ${command}; run \`${npx} help\` for usage`);
|
|
83456
|
+
const { ui } = io;
|
|
83457
|
+
ui.intro(`Bizzy routing ${io.version}`);
|
|
83458
|
+
if (!command) {
|
|
83459
|
+
ui.message("Picks the model for each request in Claude Code, oh-my-pi (omp) or Codex.");
|
|
83460
|
+
const picked = await pickHarness(target, { offerHelp: true });
|
|
83461
|
+
if (!picked) {
|
|
83462
|
+
ui.outro("Every command:");
|
|
83463
|
+
io.stdout(`
|
|
83464
|
+
${help}`);
|
|
83465
|
+
return { exit: 0 };
|
|
83466
|
+
}
|
|
83467
|
+
await installFlow(picked, target, flags);
|
|
83468
|
+
ui.outro(`Done. Check it any time with: ${npx} doctor`);
|
|
83469
|
+
} else if (command === "install") {
|
|
83470
|
+
const harness = name || !io.interactive ? harnessOf(name) : await pickHarness(target, { offerHelp: false });
|
|
83471
|
+
await installFlow(harness, target, flags);
|
|
83472
|
+
ui.outro("Done");
|
|
83473
|
+
} else if (command === "uninstall") {
|
|
83474
|
+
const harness = harnessOf(name);
|
|
83475
|
+
let purge = values.purge === true;
|
|
83476
|
+
if (purge && io.interactive)
|
|
83477
|
+
purge = await ui.confirm(`Also delete ${target.dataDir}, with your routing key and data?`);
|
|
83478
|
+
await ui.step(
|
|
83479
|
+
`Removing ${names[harness]}`,
|
|
83480
|
+
() => uninstall(harness, target, purge),
|
|
83481
|
+
(done) => done.trim()
|
|
83482
|
+
);
|
|
83483
|
+
ui.outro("Done");
|
|
83484
|
+
} else if (command === "key") {
|
|
83485
|
+
const key = values.stdin ? await io.readStdin() : io.interactive ? await ui.password("Bizzy routing key", "Paste the key you were given.") : await io.readStdin();
|
|
83486
|
+
await ui.step(
|
|
83487
|
+
"Saving the routing key",
|
|
83488
|
+
() => saveKey(target, key),
|
|
83489
|
+
(done) => done
|
|
83490
|
+
);
|
|
83491
|
+
ui.outro("Done");
|
|
83492
|
+
} else if (command === "status") {
|
|
83493
|
+
const checks = await ui.step(
|
|
83494
|
+
"Reading the setup",
|
|
83495
|
+
() => status(target),
|
|
83496
|
+
() => "Setup:"
|
|
83497
|
+
);
|
|
83498
|
+
ui.message(ui.checks(checks));
|
|
83499
|
+
ui.outro(verdict(checks));
|
|
83500
|
+
} else if (command === "doctor") {
|
|
83501
|
+
const checks = await ui.step(
|
|
83502
|
+
"Checking the setup",
|
|
83503
|
+
() => diagnose(target),
|
|
83504
|
+
(done) => `Ran ${done.length} checks`
|
|
83505
|
+
);
|
|
83506
|
+
ui.message(ui.checks(checks));
|
|
83507
|
+
ui.outro(verdict(checks));
|
|
83424
83508
|
return { exit: checks.some((check2) => check2.status === "fail") ? 1 : 0 };
|
|
83425
|
-
}
|
|
83426
|
-
|
|
83427
|
-
${usage}`);
|
|
83509
|
+
}
|
|
83428
83510
|
return { exit: 0 };
|
|
83429
83511
|
}
|
|
83430
83512
|
export {
|