@wirecat/cli-template 0.15.0 → 0.17.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/.github/workflows/ci.yml +35 -0
- package/.github/workflows/release-pr.yml +37 -0
- package/AGENTS.md +56 -2
- package/CHANGELOG.md +50 -0
- package/README.md +12 -4
- package/bin/release +10 -3
- package/biome.json +8 -2
- package/contracts/mcp-tools.json +2 -2
- package/contracts/plan.json +2 -1
- package/dist/bin/clidev.js +2 -2
- package/dist/bundle/{chunk-LU4A2T7Y.js → all-profiles-CCT2XPJL.js} +10 -7
- package/dist/bundle/{anthropic-ICTW7CNQ.js → anthropic-QLLP7EE4.js} +4 -4
- package/dist/bundle/{app-server-OW5LT5XV.js → app-server-ELI5TGL7.js} +36 -37
- package/dist/bundle/{bun-ILPS6AYA.js → bun-C7JS2V7G.js} +2 -2
- package/dist/bundle/{bun-sqlite-JE6FJFQT.js → bun-sqlite-OM72TCYT.js} +3 -3
- package/dist/bundle/{chunk-7F5VMLVK.js → chunk-2Y5NBD7U.js} +4 -4
- package/dist/bundle/chunk-33JGD2CR.js +141 -0
- package/dist/bundle/{chunk-F34HGYWF.js → chunk-3VVIEZRY.js} +2 -2
- package/dist/bundle/{chunk-CGFQT3LQ.js → chunk-6PHTRAZA.js} +1 -1
- package/dist/bundle/{chunk-VS5LGSTM.js → chunk-6VCFDEHT.js} +1 -1
- package/dist/bundle/{chunk-NENYWEXF.js → chunk-7OQF5ZMN.js} +1 -1
- package/dist/bundle/{chunk-62JRF2JA.js → chunk-AKUMR7PE.js} +2 -2
- package/dist/bundle/{chunk-7UPBPE3Z.js → chunk-ASO23RNM.js} +152 -79
- package/dist/bundle/{chunk-VOTEB3AN.js → chunk-AUVPTFUS.js} +1 -1
- package/dist/bundle/{chunk-KLFYY7KC.js → chunk-BOCIYBBO.js} +53 -44
- package/dist/bundle/{chunk-TJJ2XSJP.js → chunk-BXZRTMXA.js} +5 -5
- package/dist/bundle/{chunk-66VMJGV6.js → chunk-DVLM23HB.js} +2 -2
- package/dist/bundle/{chunk-YIVY2WI3.js → chunk-E4KQOKQ5.js} +1 -1
- package/dist/bundle/{chunk-GHF72SHT.js → chunk-EQDVQN4E.js} +306 -258
- package/dist/bundle/{chunk-NH6LZ3H3.js → chunk-FF3AGTHY.js} +6 -6
- package/dist/bundle/{chunk-NG7MOJBT.js → chunk-GG5PXNMH.js} +61 -21
- package/dist/bundle/{chunk-LFLSV353.js → chunk-GUCMIUNB.js} +2 -2
- package/dist/bundle/{chunk-R5RYPD23.js → chunk-HVAEHUSZ.js} +2 -2
- package/dist/bundle/{chunk-PIJUGF5F.js → chunk-ITPFCKCL.js} +13 -13
- package/dist/bundle/{chunk-DQIBGCF3.js → chunk-J2RUBXCI.js} +6 -6
- package/dist/bundle/{chunk-7Z4HR6GO.js → chunk-KRXN3FV3.js} +1 -1
- package/dist/bundle/{chunk-45244QQ6.js → chunk-LFLN6PVS.js} +4 -4
- package/dist/bundle/{chunk-MWUHBEDN.js → chunk-LN53L2V5.js} +11 -11
- package/dist/bundle/{chunk-IOJ2DTCY.js → chunk-MLSN3UP4.js} +28 -26
- package/dist/bundle/{chunk-3MDNAYQA.js → chunk-O6PBO4BU.js} +1 -1
- package/dist/bundle/{chunk-YOJLIVGO.js → chunk-QJS4WWYK.js} +63 -63
- package/dist/bundle/{chunk-NVNUUHT5.js → chunk-QLBS6OC2.js} +2362 -1225
- package/dist/bundle/{chunk-2DAXUNTS.js → chunk-QVPTZDRA.js} +2 -2
- package/dist/bundle/{chunk-4MU2UM4C.js → chunk-R5CPFSPI.js} +7 -7
- package/dist/bundle/{chunk-AS2PJNQ2.js → chunk-R5IY4O25.js} +4 -4
- package/dist/bundle/{chunk-DZLHY4IA.js → chunk-RGKXMVOZ.js} +3 -3
- package/dist/bundle/{chunk-G45R7M42.js → chunk-RT46AWIH.js} +1 -1
- package/dist/bundle/{chunk-NRZV7K4M.js → chunk-RUHNHEAF.js} +3 -3
- package/dist/bundle/{chunk-VXOR76ZL.js → chunk-S465TCR3.js} +8 -8
- package/dist/bundle/{chunk-NVGOHYTE.js → chunk-SQKP6V4S.js} +27 -13
- package/dist/bundle/{chunk-FC53WQHG.js → chunk-SQOXYNKF.js} +1 -1
- package/dist/bundle/{chunk-R2JKPHH5.js → chunk-URPKIONS.js} +8 -8
- package/dist/bundle/{chunk-VVGPAHUN.js → chunk-UW4PJZVJ.js} +298 -170
- package/dist/bundle/{chunk-EX2FV7YJ.js → chunk-WKUJCPSP.js} +89 -45
- package/dist/bundle/{chunk-LATYBJ4T.js → chunk-WQBBSVZM.js} +2 -2
- package/dist/bundle/{chunk-G7W53MQP.js → chunk-WRLOK7XC.js} +3 -3
- package/dist/bundle/{chunk-SOYOOU2D.js → chunk-X44ZT64I.js} +3 -3
- package/dist/bundle/{chunk-U6QD3J3F.js → chunk-XKL5FRH3.js} +3 -3
- package/dist/bundle/{chunk-6AW4DDK4.js → chunk-XS56LIQ7.js} +4 -4
- package/dist/bundle/{chunk-3WDYHOAF.js → chunk-YIH3PYWJ.js} +1 -1
- package/dist/bundle/{chunk-5GTMQTQH.js → chunk-ZRNBKTPP.js} +27 -29
- package/dist/bundle/clidev.js +3 -3
- package/dist/bundle/{command-contract-3MPKXBVL.js → command-contract-RV5ZOEAT.js} +11 -11
- package/dist/bundle/{decode-NXB5UKMO.js → decode-V7HNHZBC.js} +3 -3
- package/dist/bundle/{echarts-DRDGGHJT.js → echarts-Y42YP2OL.js} +2 -2
- package/dist/bundle/{embed-IKZ24BMC.js → embed-JSQZL7JF.js} +4 -4
- package/dist/bundle/{embedder-GMQ24DOQ.js → embedder-7BHRCXWL.js} +7 -7
- package/dist/bundle/{first-run-PURIGDLD.js → first-run-BJ36KGST.js} +8 -8
- package/dist/bundle/first-screen-5YHQVNY4.js +26 -0
- package/dist/bundle/{instructions-EOQOXY6V.js → instructions-UWERND54.js} +1 -1
- package/dist/bundle/{mcp-7HBLFGCW.js → mcp-P4FSBSRS.js} +2 -2
- package/dist/bundle/{node-52WF2326.js → node-PZDNPKN7.js} +2 -2
- package/dist/bundle/{node-sqlite-73Z4SFOA.js → node-sqlite-4F5NLRNT.js} +4 -4
- package/dist/bundle/{oauth-EVTPAMZP.js → oauth-VDXNA3DK.js} +5 -5
- package/dist/bundle/{open-46WZAPJ3.js → open-EUJRQQNS.js} +3 -3
- package/dist/bundle/{openai-GWRDAHDU.js → openai-EIBV2K72.js} +14 -35
- package/dist/bundle/{process-YIQPKLZI.js → process-XD5ZIFIL.js} +1 -1
- package/dist/bundle/{program-37NVH5YJ.js → program-TJTVMIOX.js} +3067 -736
- package/dist/bundle/{prompt-IVEYRLS5.js → prompt-LYUZNHDK.js} +3 -3
- package/dist/bundle/{recognize-WVEKHODM.js → recognize-LQMHLOD5.js} +2 -2
- package/dist/bundle/{remote-4K5VPMC7.js → remote-34HUWSZI.js} +5 -5
- package/dist/bundle/{rerank-V24UJZYJ.js → rerank-ONBASQ5Z.js} +5 -5
- package/dist/bundle/{chunk-EMHCXXNJ.js → serve-UJ7FDYAM.js} +8 -6
- package/dist/bundle/{chunk-KJ3UADR3.js → server-GNT76BXM.js} +29 -9
- package/dist/bundle/server-J4YIXKMI.js +52 -0
- package/dist/bundle/{state-ZPYGECVP.js → state-IW5OO6IZ.js} +4 -4
- package/dist/bundle/{store-6JQCLPQF.js → store-55UB27H2.js} +12 -10
- package/dist/bundle/store-maintenance-command-BLDKUZ3L.js +42 -0
- package/dist/commands/comments.d.ts +3 -0
- package/dist/commands/comments.d.ts.map +1 -0
- package/dist/commands/comments.js +114 -0
- package/dist/commands/comments.js.map +1 -0
- package/dist/commands/session.d.ts +3 -0
- package/dist/commands/session.d.ts.map +1 -0
- package/dist/commands/session.js +96 -0
- package/dist/commands/session.js.map +1 -0
- package/dist/context.d.ts +83 -0
- package/dist/context.d.ts.map +1 -0
- package/dist/context.js +58 -0
- package/dist/context.js.map +1 -0
- package/dist/program.d.ts.map +1 -1
- package/dist/program.js +25 -4
- package/dist/program.js.map +1 -1
- package/dist/sample/comments.d.ts +61 -0
- package/dist/sample/comments.d.ts.map +1 -0
- package/dist/sample/comments.js +39 -0
- package/dist/sample/comments.js.map +1 -0
- package/dist/sample/transport.d.ts +42 -0
- package/dist/sample/transport.d.ts.map +1 -0
- package/dist/sample/transport.js +152 -0
- package/dist/sample/transport.js.map +1 -0
- package/dist/token.d.ts +16 -0
- package/dist/token.d.ts.map +1 -0
- package/dist/token.js +32 -0
- package/dist/token.js.map +1 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/docs/commands.md +234 -12
- package/docs/configuration.md +1 -1
- package/docs/dev/reference-clis.md +3 -2
- package/docs/dev/skills/release/SKILL.md +9 -3
- package/docs/dev/skills/release/fresh-audit.md +1 -1
- package/docs/dev/test-matrix.md +36 -5
- package/docs/index.md +4 -3
- package/docs/security.md +4 -2
- package/kit/dist/new.js +7 -3
- package/lint/overrides.json +9 -1
- package/package.json +6 -7
- package/scripts/test-matrix-untested.ts +19 -0
- package/skills/clidev-cli/SKILL.md +1 -1
- package/src/commands/comments.ts +167 -0
- package/src/commands/session.ts +144 -0
- package/src/comments.test.ts +258 -0
- package/src/context.ts +78 -0
- package/src/mcp.test.ts +71 -76
- package/src/program.test.ts +9 -16
- package/src/program.ts +29 -4
- package/src/sample/comments.ts +51 -0
- package/src/sample/transport.test.ts +117 -0
- package/src/sample/transport.ts +184 -0
- package/src/testing/fake-comments.ts +167 -0
- package/src/testing/harness.ts +51 -0
- package/src/token.ts +42 -0
- package/src/version.ts +1 -1
- package/dist/bundle/all-profiles-NVB2HT2S.js +0 -24
- package/dist/bundle/chunk-GUFPQZUA.js +0 -48
- package/dist/bundle/chunk-NL2DQPT7.js +0 -2
- package/dist/bundle/first-screen-B2CF2CET.js +0 -26
- package/dist/bundle/mcp-ASNYBQ5B.js +0 -152
- package/dist/bundle/mcp-EY2NUYDQ.js +0 -82
- package/dist/bundle/serve-PJWSOV7F.js +0 -19
- package/dist/bundle/server-3TPCEZ6P.js +0 -40
- package/dist/bundle/server-GQX5MZTT.js +0 -53
- package/dist/bundle/store-maintenance-command-ND4ADMGC.js +0 -42
- package/dist/commands/doctor.d.ts +0 -77
- package/dist/commands/doctor.d.ts.map +0 -1
- package/dist/commands/doctor.js +0 -74
- package/dist/commands/doctor.js.map +0 -1
- package/dist/commands/mcp.d.ts +0 -3
- package/dist/commands/mcp.d.ts.map +0 -1
- package/dist/commands/mcp.js +0 -97
- package/dist/commands/mcp.js.map +0 -1
- package/dist/mcp.d.ts +0 -29
- package/dist/mcp.d.ts.map +0 -1
- package/dist/mcp.js +0 -98
- package/dist/mcp.js.map +0 -1
- package/src/commands/doctor.ts +0 -86
- package/src/commands/mcp.ts +0 -130
- package/src/mcp-http.test.ts +0 -172
- package/src/mcp.ts +0 -140
|
@@ -13,10 +13,10 @@ import {
|
|
|
13
13
|
refuseLacking,
|
|
14
14
|
servicesFor,
|
|
15
15
|
throughWrapper
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-EQDVQN4E.js";
|
|
17
17
|
import {
|
|
18
18
|
servingProfiles
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-RGKXMVOZ.js";
|
|
20
20
|
import {
|
|
21
21
|
AUTHORITY_KEY,
|
|
22
22
|
CEILING_KEY,
|
|
@@ -45,29 +45,29 @@ import {
|
|
|
45
45
|
rememberAccount,
|
|
46
46
|
rootOf2 as rootOf,
|
|
47
47
|
skipFlagFor
|
|
48
|
-
} from "./chunk-
|
|
48
|
+
} from "./chunk-UW4PJZVJ.js";
|
|
49
49
|
import {
|
|
50
50
|
isCliFailure,
|
|
51
51
|
providerErrorKey
|
|
52
|
-
} from "./chunk-
|
|
52
|
+
} from "./chunk-S465TCR3.js";
|
|
53
53
|
import {
|
|
54
54
|
openStore
|
|
55
|
-
} from "./chunk-
|
|
55
|
+
} from "./chunk-QLBS6OC2.js";
|
|
56
56
|
import {
|
|
57
57
|
CliError,
|
|
58
58
|
logRecordOf,
|
|
59
59
|
realSleep,
|
|
60
60
|
resolvePaths,
|
|
61
61
|
writeSecurely
|
|
62
|
-
} from "./chunk-
|
|
62
|
+
} from "./chunk-MLSN3UP4.js";
|
|
63
63
|
import {
|
|
64
64
|
__name
|
|
65
65
|
} from "./chunk-ZVVMGPBJ.js";
|
|
66
66
|
|
|
67
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
67
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.595.0_@wirecat+cli-base@0.80.3_commander@15.0.0_esbuild@0.28.2_type_2c96d170c489856a39cafd5889a9e4ba/node_modules/@wirecat/cli-core/dist/sends/guard.js
|
|
68
68
|
import { randomUUID } from "node:crypto";
|
|
69
69
|
|
|
70
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
70
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.595.0_@wirecat+cli-base@0.80.3_commander@15.0.0_esbuild@0.28.2_type_2c96d170c489856a39cafd5889a9e4ba/node_modules/@wirecat/cli-core/dist/sends/flood.js
|
|
71
71
|
import { mkdirSync, readFileSync, renameSync, writeFileSync } from "node:fs";
|
|
72
72
|
import { dirname, join } from "node:path";
|
|
73
73
|
var MOST_DEADLINES = 50;
|
|
@@ -151,11 +151,11 @@ var FloodMemory = class {
|
|
|
151
151
|
}
|
|
152
152
|
};
|
|
153
153
|
|
|
154
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
154
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.595.0_@wirecat+cli-base@0.80.3_commander@15.0.0_esbuild@0.28.2_type_2c96d170c489856a39cafd5889a9e4ba/node_modules/@wirecat/cli-core/dist/sends/journal.js
|
|
155
155
|
import { appendFileSync, mkdirSync as mkdirSync3, readFileSync as readFileSync2 } from "node:fs";
|
|
156
156
|
import { dirname as dirname3, join as join2 } from "node:path";
|
|
157
157
|
|
|
158
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
158
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.595.0_@wirecat+cli-base@0.80.3_commander@15.0.0_esbuild@0.28.2_type_2c96d170c489856a39cafd5889a9e4ba/node_modules/@wirecat/cli-core/dist/sends/file-lock.js
|
|
159
159
|
import { closeSync, mkdirSync as mkdirSync2, openSync, statSync, unlinkSync } from "node:fs";
|
|
160
160
|
import { dirname as dirname2 } from "node:path";
|
|
161
161
|
var LOCK_WAIT_MS = 5e3;
|
|
@@ -222,7 +222,7 @@ var lockTime = /* @__PURE__ */ __name((lock) => {
|
|
|
222
222
|
}
|
|
223
223
|
}, "lockTime");
|
|
224
224
|
|
|
225
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
225
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.595.0_@wirecat+cli-base@0.80.3_commander@15.0.0_esbuild@0.28.2_type_2c96d170c489856a39cafd5889a9e4ba/node_modules/@wirecat/cli-core/dist/sends/journal.js
|
|
226
226
|
var sendsPathFor = /* @__PURE__ */ __name((app, profile, env = process.env) => join2(resolvePaths({ appName: app.appName, prefix: app.envPrefix, env }).state, "sends", `${profile}.jsonl`), "sendsPathFor");
|
|
227
227
|
var SendJournal = class {
|
|
228
228
|
static {
|
|
@@ -299,7 +299,7 @@ var withSendId = /* @__PURE__ */ __name((entry) => {
|
|
|
299
299
|
return cid === void 0 || rest.sendId !== void 0 ? rest : { ...rest, sendId: String(cid) };
|
|
300
300
|
}, "withSendId");
|
|
301
301
|
|
|
302
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
302
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.595.0_@wirecat+cli-base@0.80.3_commander@15.0.0_esbuild@0.28.2_type_2c96d170c489856a39cafd5889a9e4ba/node_modules/@wirecat/cli-core/dist/sends/recipients.js
|
|
303
303
|
import { existsSync, readFileSync as readFileSync3, rmSync } from "node:fs";
|
|
304
304
|
import { join as join3 } from "node:path";
|
|
305
305
|
var recipientsPathFor = /* @__PURE__ */ __name((app, profile, env = process.env) => join3(resolvePaths({ appName: app.appName, prefix: app.envPrefix, env }).state, "profiles", `${profile}.recipients.json`), "recipientsPathFor");
|
|
@@ -411,7 +411,7 @@ var RecipientList = class {
|
|
|
411
411
|
}
|
|
412
412
|
};
|
|
413
413
|
|
|
414
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
414
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.595.0_@wirecat+cli-base@0.80.3_commander@15.0.0_esbuild@0.28.2_type_2c96d170c489856a39cafd5889a9e4ba/node_modules/@wirecat/cli-core/dist/sends/guard.js
|
|
415
415
|
var HOUR_MS = 60 * 60 * 1e3;
|
|
416
416
|
var READS_UNDER_HOLD = /* @__PURE__ */ new Set([
|
|
417
417
|
"attachments.extract",
|
|
@@ -604,7 +604,7 @@ var guardFor = /* @__PURE__ */ __name((app, settings, warn, env = process.env, a
|
|
|
604
604
|
}), "guardFor");
|
|
605
605
|
var journalFailure = /* @__PURE__ */ __name((error) => error?.code ?? (error instanceof Error ? error.name : "error"), "journalFailure");
|
|
606
606
|
|
|
607
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
607
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.595.0_@wirecat+cli-base@0.80.3_commander@15.0.0_esbuild@0.28.2_type_2c96d170c489856a39cafd5889a9e4ba/node_modules/@wirecat/cli-core/dist/cli/messenger/ask.js
|
|
608
608
|
import { openSync as openSync2 } from "node:fs";
|
|
609
609
|
import { createInterface } from "node:readline";
|
|
610
610
|
import { ReadStream } from "node:tty";
|
|
@@ -659,7 +659,7 @@ var terminalAsker = /* @__PURE__ */ __name((command) => async (key, request) =>
|
|
|
659
659
|
throw new CliError("cancelled", `${key}: not done \u2014 the answer was no`);
|
|
660
660
|
}, "terminalAsker");
|
|
661
661
|
|
|
662
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
662
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.595.0_@wirecat+cli-base@0.80.3_commander@15.0.0_esbuild@0.28.2_type_2c96d170c489856a39cafd5889a9e4ba/node_modules/@wirecat/cli-core/dist/sends/pace.js
|
|
663
663
|
import { readFileSync as readFileSync4, renameSync as renameSync2, writeFileSync as writeFileSync2 } from "node:fs";
|
|
664
664
|
import { join as join4 } from "node:path";
|
|
665
665
|
var DEFAULT_PACE = { perMinute: 60, burst: 20 };
|
|
@@ -717,8 +717,39 @@ var Pacer = class {
|
|
|
717
717
|
renameSync2(temporary, this.path);
|
|
718
718
|
}
|
|
719
719
|
};
|
|
720
|
+
var ANNOUNCE_WAIT_MS = 5e3;
|
|
721
|
+
var LONGEST_PACE_WAIT_MS = 5 * 6e4;
|
|
722
|
+
var waitForTurn = /* @__PURE__ */ __name(async (pacer, options) => {
|
|
723
|
+
const { name, operation, warn } = options;
|
|
724
|
+
const now = options.now ?? Date.now;
|
|
725
|
+
let at = now();
|
|
726
|
+
try {
|
|
727
|
+
at = await pacer.reserve();
|
|
728
|
+
} catch (error) {
|
|
729
|
+
warn?.(`could not remember ${name}'s wait (${error instanceof Error ? error.message : String(error)})`, {
|
|
730
|
+
event: "warning",
|
|
731
|
+
code: "wait_not_remembered",
|
|
732
|
+
operation
|
|
733
|
+
});
|
|
734
|
+
}
|
|
735
|
+
const waitMs = at - now();
|
|
736
|
+
if (waitMs <= 0)
|
|
737
|
+
return;
|
|
738
|
+
if (waitMs > LONGEST_PACE_WAIT_MS)
|
|
739
|
+
throw new CliError("rate_limited", `${name} asked this profile to wait, ${Math.ceil(waitMs / 1e3)} s are left \u2014 nothing was sent to ${name}`, { retry_after_ms: waitMs, retry_at: new Date(at).toISOString(), remembered: true });
|
|
740
|
+
if (waitMs >= ANNOUNCE_WAIT_MS) {
|
|
741
|
+
const seconds = Math.ceil(waitMs / 1e3);
|
|
742
|
+
warn?.(`waiting ${seconds} s to keep this profile's pace with ${name}`, {
|
|
743
|
+
event: "warning",
|
|
744
|
+
code: "pace_wait",
|
|
745
|
+
operation,
|
|
746
|
+
counts: { seconds }
|
|
747
|
+
});
|
|
748
|
+
}
|
|
749
|
+
await (options.sleep ?? ((ms) => new Promise((resolve) => setTimeout(resolve, ms))))(waitMs);
|
|
750
|
+
}, "waitForTurn");
|
|
720
751
|
|
|
721
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
752
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.595.0_@wirecat+cli-base@0.80.3_commander@15.0.0_esbuild@0.28.2_type_2c96d170c489856a39cafd5889a9e4ba/node_modules/@wirecat/cli-core/dist/cli/permission-keys.js
|
|
722
753
|
var HOUSEKEEPING = /* @__PURE__ */ new Set([
|
|
723
754
|
"help",
|
|
724
755
|
"guide",
|
|
@@ -798,12 +829,10 @@ var refuseUnknownPermissionKeys = /* @__PURE__ */ __name((command, settings, too
|
|
|
798
829
|
throw new CliError("validation_error", `--permission ${key} names no command`, { permission: key });
|
|
799
830
|
}, "refuseUnknownPermissionKeys");
|
|
800
831
|
|
|
801
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
832
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.595.0_@wirecat+cli-base@0.80.3_commander@15.0.0_esbuild@0.28.2_type_2c96d170c489856a39cafd5889a9e4ba/node_modules/@wirecat/cli-core/dist/cli/messenger/flooded.js
|
|
802
833
|
var LONG_LIVED = /* @__PURE__ */ new Set(["self", "newSendId", "close", "formatMarkdown", "formatHtml", "storedChats"]);
|
|
803
834
|
var LISTENING = /* @__PURE__ */ new Set(["watch", "feed", "listen", "listenHistory"]);
|
|
804
835
|
var BLOCKING = /* @__PURE__ */ new Set(["frozen", "limited", "banned"]);
|
|
805
|
-
var ANNOUNCE_WAIT_MS = 5e3;
|
|
806
|
-
var LONGEST_PACE_WAIT_MS = 5 * 6e4;
|
|
807
836
|
var chatOf = /* @__PURE__ */ __name((args) => typeof args[0] === "string" && /^-?\d+$/.test(args[0]) ? args[0] : void 0, "chatOf");
|
|
808
837
|
var flooded = /* @__PURE__ */ __name((messenger, memory, { name, warn, pacer }) => {
|
|
809
838
|
const kept = /* @__PURE__ */ __name(async (operation, what2) => {
|
|
@@ -859,28 +888,8 @@ var flooded = /* @__PURE__ */ __name((messenger, memory, { name, warn, pacer })
|
|
|
859
888
|
await kept(operation, () => pacer.holdFor(waitMs));
|
|
860
889
|
}, "noted");
|
|
861
890
|
const turn = /* @__PURE__ */ __name(async (operation) => {
|
|
862
|
-
if (
|
|
863
|
-
|
|
864
|
-
let at = Date.now();
|
|
865
|
-
await kept(operation, async () => {
|
|
866
|
-
at = await pacer.reserve();
|
|
867
|
-
});
|
|
868
|
-
const waitMs = at - Date.now();
|
|
869
|
-
if (waitMs <= 0)
|
|
870
|
-
return;
|
|
871
|
-
if (waitMs > LONGEST_PACE_WAIT_MS) {
|
|
872
|
-
throw new CliError("rate_limited", `${name} asked this profile to wait, ${Math.ceil(waitMs / 1e3)} s are left \u2014 nothing was sent to ${name}`, { retry_after_ms: waitMs, retry_at: new Date(at).toISOString(), remembered: true });
|
|
873
|
-
}
|
|
874
|
-
if (waitMs >= ANNOUNCE_WAIT_MS) {
|
|
875
|
-
const seconds = Math.ceil(waitMs / 1e3);
|
|
876
|
-
warn(`waiting ${seconds} s to keep this profile's pace with ${name}`, {
|
|
877
|
-
event: "warning",
|
|
878
|
-
code: "pace_wait",
|
|
879
|
-
operation,
|
|
880
|
-
counts: { seconds }
|
|
881
|
-
});
|
|
882
|
-
}
|
|
883
|
-
await new Promise((resolve) => setTimeout(resolve, waitMs));
|
|
891
|
+
if (pacer)
|
|
892
|
+
await waitForTurn(pacer, { name, operation, warn });
|
|
884
893
|
}, "turn");
|
|
885
894
|
return throughWrapper(messenger, {}, (operation, call) => {
|
|
886
895
|
if (LONG_LIVED.has(operation))
|
|
@@ -917,7 +926,7 @@ var flooded = /* @__PURE__ */ __name((messenger, memory, { name, warn, pacer })
|
|
|
917
926
|
});
|
|
918
927
|
}, "flooded");
|
|
919
928
|
|
|
920
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
929
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.595.0_@wirecat+cli-base@0.80.3_commander@15.0.0_esbuild@0.28.2_type_2c96d170c489856a39cafd5889a9e4ba/node_modules/@wirecat/cli-core/dist/cli/messenger/observed.js
|
|
921
930
|
var observed = /* @__PURE__ */ __name((messenger, events) => {
|
|
922
931
|
const timed = /* @__PURE__ */ __name(async (operation, named, work, after) => {
|
|
923
932
|
const write = currentOperation();
|
|
@@ -1016,7 +1025,7 @@ var byPart = /* @__PURE__ */ __name((batch, counts) => {
|
|
|
1016
1025
|
counts[part] = (counts[part] ?? 0) + items.length;
|
|
1017
1026
|
}, "byPart");
|
|
1018
1027
|
|
|
1019
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1028
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.595.0_@wirecat+cli-base@0.80.3_commander@15.0.0_esbuild@0.28.2_type_2c96d170c489856a39cafd5889a9e4ba/node_modules/@wirecat/cli-core/dist/cli/messenger/stored.js
|
|
1020
1029
|
var REKEY_PACING = { lockMs: 50, pauseMs: 25 };
|
|
1021
1030
|
var stored = /* @__PURE__ */ __name((messenger, { account, store, warn, events, pending, announcing, deletedWithoutChat, profile, rekeyed, rekeyPacing = REKEY_PACING, closing, namesFromStore, recipientIds, countsUnread = false, historyLimits, command = "cli" }) => {
|
|
1022
1031
|
let warned = false;
|
|
@@ -1592,7 +1601,7 @@ var keep = /* @__PURE__ */ __name(async (store, account, event, seenAt, among, c
|
|
|
1592
1601
|
}
|
|
1593
1602
|
}, "keep");
|
|
1594
1603
|
|
|
1595
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1604
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.595.0_@wirecat+cli-base@0.80.3_commander@15.0.0_esbuild@0.28.2_type_2c96d170c489856a39cafd5889a9e4ba/node_modules/@wirecat/cli-core/dist/cli/messenger/context.js
|
|
1596
1605
|
var lazyStore = /* @__PURE__ */ __name((env, command, version) => {
|
|
1597
1606
|
let opened;
|
|
1598
1607
|
return {
|
|
@@ -2,21 +2,21 @@ import { createRequire as __bundleRequire } from "node:module";
|
|
|
2
2
|
const require = __bundleRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
storePath
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-AKUMR7PE.js";
|
|
6
6
|
import {
|
|
7
7
|
CliError,
|
|
8
8
|
resolvePaths,
|
|
9
9
|
singleLine
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-MLSN3UP4.js";
|
|
11
11
|
import {
|
|
12
12
|
__name
|
|
13
13
|
} from "./chunk-ZVVMGPBJ.js";
|
|
14
14
|
|
|
15
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
15
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.595.0_@wirecat+cli-base@0.80.3_commander@15.0.0_esbuild@0.28.2_type_2c96d170c489856a39cafd5889a9e4ba/node_modules/@wirecat/cli-core/dist/store/shared-config.js
|
|
16
16
|
import { mkdirSync, readFileSync, renameSync, statSync, writeFileSync } from "node:fs";
|
|
17
17
|
import { dirname, join, resolve } from "node:path";
|
|
18
18
|
|
|
19
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.595.0_@wirecat+cli-base@0.80.3_commander@15.0.0_esbuild@0.28.2_type_2c96d170c489856a39cafd5889a9e4ba/node_modules/@wirecat/cli-core/dist/domain/task-categories.js
|
|
20
20
|
var DEFAULT_TASK_CATEGORIES = [
|
|
21
21
|
{
|
|
22
22
|
name: "taxes",
|
|
@@ -771,7 +771,7 @@ var storedTaskCategories = /* @__PURE__ */ __name((json) => {
|
|
|
771
771
|
}
|
|
772
772
|
}, "storedTaskCategories");
|
|
773
773
|
|
|
774
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
774
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.595.0_@wirecat+cli-base@0.80.3_commander@15.0.0_esbuild@0.28.2_type_2c96d170c489856a39cafd5889a9e4ba/node_modules/@wirecat/cli-core/dist/store/shared-config.js
|
|
775
775
|
var SECTION = "task_categories";
|
|
776
776
|
var sharedConfigPath = /* @__PURE__ */ __name((store, env = process.env) => {
|
|
777
777
|
const paths = resolvePaths({ appName: "WireCat", prefix: "WIRECAT", env });
|
|
@@ -8,12 +8,12 @@ import {
|
|
|
8
8
|
ACCESS_SECONDS,
|
|
9
9
|
REFRESH_SECONDS,
|
|
10
10
|
readStored
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-XS56LIQ7.js";
|
|
12
12
|
import {
|
|
13
13
|
__name
|
|
14
14
|
} from "./chunk-ZVVMGPBJ.js";
|
|
15
15
|
|
|
16
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
16
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.595.0_@wirecat+cli-base@0.80.3_commander@15.0.0_esbuild@0.28.2_type_2c96d170c489856a39cafd5889a9e4ba/node_modules/@wirecat/cli-core/dist/mcp/http/oauth.js
|
|
17
17
|
import { createHash, randomBytes, randomInt, timingSafeEqual } from "node:crypto";
|
|
18
18
|
import { chmodSync, mkdirSync, renameSync, rmSync, writeFileSync } from "node:fs";
|
|
19
19
|
import { dirname } from "node:path";
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
__name
|
|
5
5
|
} from "./chunk-ZVVMGPBJ.js";
|
|
6
6
|
|
|
7
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.595.0_@wirecat+cli-base@0.80.3_commander@15.0.0_esbuild@0.28.2_type_2c96d170c489856a39cafd5889a9e4ba/node_modules/@wirecat/cli-core/dist/mcp/bot/instructions.js
|
|
8
8
|
var botInstructions = /* @__PURE__ */ __name(({ command, name, profile, writes, skill }) => [
|
|
9
9
|
`The owner's ${name} bot "${profile}", through the official Bot API \u2014 not the owner's personal account. What it writes, people see as the bot.`,
|
|
10
10
|
"Use these tools to read the chats this bot is in, find a message or a person, and \u2014 when the profile allows \u2014 write as the bot.",
|