@wirecat/mail-cli 0.23.1 → 0.25.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/CHANGELOG.md +23 -0
- package/dist/bin/mail.js +2 -2
- package/dist/bundle/{all-profiles-FJHJCGRU.js → all-profiles-QEV2PSOR.js} +11 -11
- package/dist/bundle/{anthropic-AFL7NKVZ.js → anthropic-5NKQXIHM.js} +28 -12
- package/dist/bundle/{app-server-WKCBJMHI.js → app-server-G2CJNT4R.js} +62 -50
- package/dist/bundle/{bun-HQATAQJQ.js → bun-6HBYWQIX.js} +2 -2
- package/dist/bundle/{bun-sqlite-4ECAV7OU.js → bun-sqlite-DXIQ7BVR.js} +9 -5
- package/dist/bundle/{chunk-MUDHCYN4.js → chunk-37F6QYTO.js} +6 -6
- package/dist/bundle/{chunk-NMGF3UOZ.js → chunk-3XVR2ROR.js} +50 -46
- package/dist/bundle/{chunk-QUKD5SO2.js → chunk-434YOD6A.js} +4 -4
- package/dist/bundle/{chunk-7SWWVDEZ.js → chunk-4W4EVVL4.js} +61 -21
- package/dist/bundle/{chunk-CCYHBNRL.js → chunk-5QYK3LWS.js} +326 -56
- package/dist/bundle/{chunk-7YRKUEYE.js → chunk-5ZYFV6FD.js} +694 -228
- package/dist/bundle/chunk-7GLJSJ7M.js +16 -0
- package/dist/bundle/{chunk-NOA6E6MM.js → chunk-A6BPOX5O.js} +38841 -24161
- package/dist/bundle/{chunk-34743C4C.js → chunk-ADKMBXY4.js} +1 -1
- package/dist/bundle/{chunk-2HXHAFRP.js → chunk-B7SWTH5O.js} +2 -2
- package/dist/bundle/{chunk-NKBAZ4VC.js → chunk-BC7PFQL7.js} +2 -2
- package/dist/bundle/{chunk-ROKTS7WM.js → chunk-CBYBZCQP.js} +1 -1
- package/dist/bundle/chunk-CIWWNBVW.js +188 -0
- package/dist/bundle/{chunk-SBGXKM4U.js → chunk-DIA56CS7.js} +8 -7
- package/dist/bundle/{chunk-VYHIX3OP.js → chunk-EXVY76VO.js} +61 -607
- package/dist/bundle/{chunk-BVJQBAGL.js → chunk-FZZD4AFY.js} +14 -14
- package/dist/bundle/{chunk-VFKX5UMJ.js → chunk-G5LHHAW2.js} +6 -6
- package/dist/bundle/{chunk-QV3M2MHG.js → chunk-GJRYZXBN.js} +13 -136
- package/dist/bundle/{chunk-GJNFNC76.js → chunk-GY4XCLCO.js} +10 -15
- package/dist/bundle/{chunk-V7CFZ773.js → chunk-HEIDAHRC.js} +2 -2
- package/dist/bundle/{chunk-AGNAT7CM.js → chunk-HEYVMAAQ.js} +2 -2
- package/dist/bundle/{chunk-HOKGIYUO.js → chunk-HJSJBNCJ.js} +119 -9
- package/dist/bundle/{chunk-KKGX7JMX.js → chunk-HLXVUMZJ.js} +2 -2
- package/dist/bundle/{chunk-OU5CWCG2.js → chunk-IACWKZWS.js} +1 -1
- package/dist/bundle/{chunk-QR7JZM3D.js → chunk-IXO4SCKE.js} +1 -1
- package/dist/bundle/{chunk-GOMJNH56.js → chunk-IZOYW4Z4.js} +32 -8
- package/dist/bundle/{chunk-WN4HP7IZ.js → chunk-J4OYK4WL.js} +14 -14
- package/dist/bundle/{chunk-76RTQYJQ.js → chunk-JG4MNYG2.js} +1 -1
- package/dist/bundle/{chunk-VAMCRP47.js → chunk-K2OGF7KC.js} +2 -2
- package/dist/bundle/chunk-K6HR6HCO.js +32 -0
- package/dist/bundle/{chunk-B6QMMRIM.js → chunk-KFB2X6KE.js} +1530 -1525
- package/dist/bundle/{chunk-3UFD76IR.js → chunk-KK4HD3SI.js} +6 -6
- package/dist/bundle/{chunk-3QVGB2CI.js → chunk-L4QVOEOB.js} +4 -4
- package/dist/bundle/chunk-LGZPKKBN.js +53 -0
- package/dist/bundle/chunk-LVGX7VTD.js +138 -0
- package/dist/bundle/chunk-MBFPFWCO.js +1243 -0
- package/dist/bundle/{chunk-3DQYO7FB.js → chunk-MCPOZNWG.js} +1 -1
- package/dist/bundle/{chunk-SR3ADLGX.js → chunk-MWGH3M46.js} +3 -3
- package/dist/bundle/{chunk-OJCUSHZG.js → chunk-ND5H5ADM.js} +4 -4
- package/dist/bundle/chunk-NMZQTYKJ.js +18 -0
- package/dist/bundle/{chunk-4YJJQNNJ.js → chunk-OLKCJBZY.js} +5 -5
- package/dist/bundle/{chunk-E7ZVKQHG.js → chunk-OLLIWNFG.js} +3 -3
- package/dist/bundle/{chunk-R5MYOLQP.js → chunk-P6GXNT7Z.js} +13 -13
- package/dist/bundle/{chunk-M7RGG3UU.js → chunk-PGC5TRH6.js} +3 -3
- package/dist/bundle/{chunk-3OZKDC6Y.js → chunk-PHHH2NQP.js} +15 -9
- package/dist/bundle/{chunk-S5OTP7XS.js → chunk-PP3YOAWG.js} +3 -3
- package/dist/bundle/{chunk-4IFX4HV2.js → chunk-PQMJ5BXH.js} +4 -4
- package/dist/bundle/{chunk-ZXIPJF3Y.js → chunk-QB3DP2TN.js} +2 -2
- package/dist/bundle/{chunk-4IWJARFA.js → chunk-QQUY4MZY.js} +1 -1
- package/dist/bundle/{chunk-UHC5I3JV.js → chunk-RX5CJ55S.js} +1 -1
- package/dist/bundle/{chunk-CYQVWITQ.js → chunk-S2QRAKQI.js} +99 -42
- package/dist/bundle/{chunk-V3TDQUXD.js → chunk-SMTBV62X.js} +44 -60
- package/dist/bundle/{chunk-SNTLN2QT.js → chunk-T27IMG6X.js} +3 -1
- package/dist/bundle/{chunk-LLYVBO3R.js → chunk-TY644DKQ.js} +19 -19
- package/dist/bundle/{chunk-R554W7ZO.js → chunk-U6IQ6YQ2.js} +2 -2
- package/dist/bundle/{chunk-MBKNL5TX.js → chunk-VFU7PVPQ.js} +373 -133
- package/dist/bundle/{chunk-UMXVQIGD.js → chunk-VL6H2BND.js} +377 -12
- package/dist/bundle/{chunk-DALBYUPC.js → chunk-VUBZFMGP.js} +2 -2
- package/dist/bundle/{chunk-VYIIX6VN.js → chunk-WOAYHCM2.js} +1 -1
- package/dist/bundle/{chunk-LQDMUMA2.js → chunk-WX6OYVCH.js} +5370 -3700
- package/dist/bundle/chunk-XMDEM6BZ.js +2094 -0
- package/dist/bundle/{chunk-CUOCDJFI.js → chunk-XQYKIZMG.js} +13 -9
- package/dist/bundle/{chunk-PMIKRELC.js → chunk-YNS2YVUR.js} +69 -6
- package/dist/bundle/{chunk-CBWA2T3N.js → chunk-Z5T6OW3V.js} +14 -5
- package/dist/bundle/command-contract-XSW2Q33S.js +36 -0
- package/dist/bundle/command-server-entry-XMSSY5ID.js +165 -0
- package/dist/bundle/{decode-QXKTMOTH.js → decode-RYGB4PGT.js} +5 -5
- package/dist/bundle/{dispatch-G4CYFWQ2.js → dispatch-PLQOIZG5.js} +10 -10
- package/dist/bundle/{dist-5FX36DAW.js → dist-GY2AQETI.js} +79 -46
- package/dist/bundle/{echarts-HHUM43TU.js → echarts-7CM2MCMW.js} +2 -2
- package/dist/bundle/{embed-SRZSDZVI.js → embed-FTBDPOPT.js} +6 -6
- package/dist/bundle/{embedder-WZIZCWLX.js → embedder-B43WGNBD.js} +9 -9
- package/dist/bundle/{failure-FFPK2WYB.js → failure-XP5QYV2T.js} +2 -2
- package/dist/bundle/{first-run-6DVWZ3JQ.js → first-run-XIIUARNM.js} +12 -11
- package/dist/bundle/first-screen-Z7HC6PQU.js +34 -0
- package/dist/bundle/{instructions-UWONE6UT.js → instructions-R7OHVAWH.js} +1 -1
- package/dist/bundle/mail.js +37 -13
- package/dist/bundle/{mcp-CFVG2OUS.js → mcp-7KQUJNFN.js} +2 -2
- package/dist/bundle/{node-HLAOYJDB.js → node-3N2JGZ7V.js} +2 -2
- package/dist/bundle/{node-sqlite-RO66I7W6.js → node-sqlite-WFJXW3CZ.js} +10 -6
- package/dist/bundle/{oauth-VNLB2TET.js → oauth-SVJLQTWV.js} +7 -7
- package/dist/bundle/{open-QQSG343L.js → open-ZDONVKSX.js} +5 -5
- package/dist/bundle/{openai-JTFC7OGF.js → openai-XVEW6XOU.js} +21 -38
- package/dist/bundle/{process-3CZAXR6P.js → process-YAHHUFR5.js} +1 -1
- package/dist/bundle/{program-XTOS4RAM.js → program-HU2UVMJE.js} +7071 -5421
- package/dist/bundle/{prompt-HGQ6GPYL.js → prompt-JAJ2CUJI.js} +5 -5
- package/dist/bundle/{recognize-2SHMNEIZ.js → recognize-UFBWUNFR.js} +4 -4
- package/dist/bundle/{remote-GBQC3433.js → remote-2GFOVLCR.js} +9 -7
- package/dist/bundle/{rerank-FQHQXFNR.js → rerank-BGPSMXTL.js} +7 -7
- package/dist/bundle/{serve-THU67QUZ.js → serve-CB3XJTH3.js} +9 -9
- package/dist/bundle/server-34GEF22R.js +68 -0
- package/dist/bundle/{server-LOT3CLYX.js → server-M7FQY7TX.js} +42 -40
- package/dist/bundle/{sqlite-runtime-NOOUMBC4.js → sqlite-runtime-AEV6PGDR.js} +6 -6
- package/dist/bundle/{state-KSKZCV2U.js → state-YLBEQLBI.js} +6 -6
- package/dist/bundle/{store-BAKSHTKF.js → store-CDUL3HKK.js} +19 -16
- package/dist/bundle/{store-OHNZOQ7U.js → store-EKWKY6GG.js} +49 -20
- package/dist/bundle/store-maintenance-command-XH2JUM5F.js +58 -0
- package/dist/config.d.ts +4 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +3 -3
- package/dist/bundle/chunk-5UKBUI4I.js +0 -35
- package/dist/bundle/chunk-EXPR6QAX.js +0 -394
- package/dist/bundle/chunk-FWFNUJQD.js +0 -12172
- package/dist/bundle/command-contract-IIHBNF7J.js +0 -35
- package/dist/bundle/first-screen-SRZ7NYHZ.js +0 -33
- package/dist/bundle/server-VKMUX7ZT.js +0 -65
- package/dist/bundle/store-maintenance-command-ROQHJVEA.js +0 -54
- /package/dist/bundle/{chunk-QZLK2ISN.js → chunk-YVNHQFLC.js} +0 -0
|
@@ -2,29 +2,34 @@ import { createRequire as __bundleRequire } from "node:module";
|
|
|
2
2
|
const require = __bundleRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
validateFormattedText
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-GJRYZXBN.js";
|
|
6
6
|
import {
|
|
7
7
|
inputPolicy
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-QB3DP2TN.js";
|
|
9
|
+
import {
|
|
10
|
+
RECORDS_SCHEMA_VERSION,
|
|
11
|
+
RECORD_TYPES,
|
|
12
|
+
pointerOf
|
|
13
|
+
} from "./chunk-XMDEM6BZ.js";
|
|
9
14
|
import {
|
|
10
15
|
parseReference
|
|
11
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-5ZYFV6FD.js";
|
|
12
17
|
import {
|
|
13
18
|
indent
|
|
14
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-TY644DKQ.js";
|
|
15
20
|
import {
|
|
16
21
|
CliError
|
|
17
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-VUBZFMGP.js";
|
|
18
23
|
import {
|
|
19
24
|
__name
|
|
20
25
|
} from "./chunk-ZVVMGPBJ.js";
|
|
21
26
|
|
|
22
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.647.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_a46df5420a4458268e3f15f3e8c41b99/node_modules/@wirecat/cli-core/dist/domain/checks.js
|
|
23
28
|
var spelled = /* @__PURE__ */ __name((check, args) => `${check.replaceAll(".", " ")}${args === void 0 ? "" : ` ${args}`}`, "spelled");
|
|
24
29
|
var bareCheck = /* @__PURE__ */ __name((check, args) => `\`${spelled(check, args)}\``, "bareCheck");
|
|
25
30
|
var checkWords = /* @__PURE__ */ __name((command, profile) => (check, args) => `\`${command} ${profile === void 0 ? "" : `${profile} `}${spelled(check, args)}\``, "checkWords");
|
|
26
31
|
|
|
27
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.647.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_a46df5420a4458268e3f15f3e8c41b99/node_modules/@wirecat/cli-core/dist/domain/links.js
|
|
28
33
|
var LINK_VERSION = "v1";
|
|
29
34
|
var DEFAULT_LINK_CONFIG = { base: "https://wirecat.dev/o", enabled: true };
|
|
30
35
|
var APP_PREFIX = "wirecat://open";
|
|
@@ -141,7 +146,7 @@ var linkFor = /* @__PURE__ */ __name((ref, { form, config = DEFAULT_LINK_CONFIG,
|
|
|
141
146
|
return form === "app" ? `${APP_PREFIX}${path}` : `${config.base}#${path}`;
|
|
142
147
|
}, "linkFor");
|
|
143
148
|
|
|
144
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
149
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.647.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_a46df5420a4458268e3f15f3e8c41b99/node_modules/@wirecat/cli-core/dist/domain/markdown.js
|
|
145
150
|
var MARKERS = [
|
|
146
151
|
["**", "bold"],
|
|
147
152
|
["~~", "strike"],
|
|
@@ -187,7 +192,7 @@ var closing = /* @__PURE__ */ __name((input, open, marker) => {
|
|
|
187
192
|
return end;
|
|
188
193
|
}, "closing");
|
|
189
194
|
|
|
190
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
195
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.647.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_a46df5420a4458268e3f15f3e8c41b99/node_modules/@wirecat/cli-core/dist/domain/markdown-spans.js
|
|
191
196
|
var STYLES = [
|
|
192
197
|
["**", "bold"],
|
|
193
198
|
["__", "underline"],
|
|
@@ -347,7 +352,7 @@ var parseMarkdownSpans = /* @__PURE__ */ __name((input) => {
|
|
|
347
352
|
return validateFormattedText(result);
|
|
348
353
|
}, "parseMarkdownSpans");
|
|
349
354
|
|
|
350
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
355
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.647.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_a46df5420a4458268e3f15f3e8c41b99/node_modules/@wirecat/cli-core/dist/domain/polls.js
|
|
351
356
|
var countedPoll = /* @__PURE__ */ __name((poll, votes, self) => {
|
|
352
357
|
const cast = votes.filter((vote) => vote.answers.length > 0);
|
|
353
358
|
const mine = self === null ? void 0 : votes.find((vote) => vote.person.id === self);
|
|
@@ -362,6 +367,361 @@ var countedPoll = /* @__PURE__ */ __name((poll, votes, self) => {
|
|
|
362
367
|
};
|
|
363
368
|
}, "countedPoll");
|
|
364
369
|
|
|
370
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.647.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_a46df5420a4458268e3f15f3e8c41b99/node_modules/@wirecat/cli-core/dist/domain/records-table.js
|
|
371
|
+
var TABLE_RECORD_TYPES = Object.keys(RECORD_TYPES).filter((type) => !RECORD_TYPES[type].importOnly);
|
|
372
|
+
var TableError = class extends Error {
|
|
373
|
+
static {
|
|
374
|
+
__name(this, "TableError");
|
|
375
|
+
}
|
|
376
|
+
errors;
|
|
377
|
+
constructor(errors) {
|
|
378
|
+
super(errors.map((e) => e.message).join("; "));
|
|
379
|
+
this.errors = errors;
|
|
380
|
+
}
|
|
381
|
+
};
|
|
382
|
+
var LIST_SEPARATOR = "|";
|
|
383
|
+
var BOM = "\uFEFF";
|
|
384
|
+
var specOf = /* @__PURE__ */ __name((type) => RECORD_TYPES[type], "specOf");
|
|
385
|
+
var typesOf = /* @__PURE__ */ __name((schema) => schema.type === void 0 ? [] : typeof schema.type === "string" ? [schema.type] : [...schema.type], "typesOf");
|
|
386
|
+
var shapeOf = /* @__PURE__ */ __name((schema) => {
|
|
387
|
+
const types = typesOf(schema);
|
|
388
|
+
if (types.includes("integer"))
|
|
389
|
+
return "integer";
|
|
390
|
+
if (types.includes("boolean"))
|
|
391
|
+
return "boolean";
|
|
392
|
+
if (types.includes("array"))
|
|
393
|
+
return "list";
|
|
394
|
+
if (schema.pattern?.includes("T[0-9]{2}"))
|
|
395
|
+
return "instant";
|
|
396
|
+
if (schema.pattern?.startsWith("^[0-9]{4}-"))
|
|
397
|
+
return "day";
|
|
398
|
+
if (schema.pattern?.includes("[A-Za-z]{3}"))
|
|
399
|
+
return "currency";
|
|
400
|
+
if (schema.pattern?.includes("(\\.[0-9]"))
|
|
401
|
+
return "decimal";
|
|
402
|
+
return "text";
|
|
403
|
+
}, "shapeOf");
|
|
404
|
+
var valuesOf = /* @__PURE__ */ __name((schema) => schema.enum?.filter((v) => v !== null), "valuesOf");
|
|
405
|
+
var flat = /* @__PURE__ */ __name((schema) => {
|
|
406
|
+
const types = typesOf(schema);
|
|
407
|
+
return !types.includes("object") && !(types.includes("array") && schema.items?.type === "object");
|
|
408
|
+
}, "flat");
|
|
409
|
+
var fieldColumn = /* @__PURE__ */ __name((name, schema, required, kind) => {
|
|
410
|
+
const values = valuesOf(schema);
|
|
411
|
+
const shape = shapeOf(schema);
|
|
412
|
+
return {
|
|
413
|
+
name,
|
|
414
|
+
kind,
|
|
415
|
+
required,
|
|
416
|
+
shape,
|
|
417
|
+
description: schema.description ?? "",
|
|
418
|
+
...values ? { values } : {},
|
|
419
|
+
...shape === "list" ? { many: true } : {}
|
|
420
|
+
};
|
|
421
|
+
}, "fieldColumn");
|
|
422
|
+
var roleColumn = /* @__PURE__ */ __name((name, role) => ({
|
|
423
|
+
name,
|
|
424
|
+
kind: "role",
|
|
425
|
+
required: role.required === true,
|
|
426
|
+
shape: "text",
|
|
427
|
+
description: role.targets.length === 1 ? `The ${role.targets[0]}'s external id` : `<type>:<external id>, the type one of ${role.targets.join(", ")}`,
|
|
428
|
+
targets: role.targets,
|
|
429
|
+
...role.many ? { many: true } : {}
|
|
430
|
+
}), "roleColumn");
|
|
431
|
+
var recordColumns = /* @__PURE__ */ __name((type) => {
|
|
432
|
+
const spec = specOf(type);
|
|
433
|
+
if (!spec || spec.importOnly)
|
|
434
|
+
return [];
|
|
435
|
+
const fields = spec.fields.properties ?? {};
|
|
436
|
+
const required = spec.fields.required ?? [];
|
|
437
|
+
const lists = Object.entries(fields).filter(([, schema]) => !flat(schema));
|
|
438
|
+
return [
|
|
439
|
+
{ name: "external_id", kind: "id", required: true, shape: "text", description: "Its id in your system" },
|
|
440
|
+
...Object.entries(fields).filter(([, schema]) => flat(schema)).map(([name, schema]) => fieldColumn(name, schema, required.includes(name), "field")),
|
|
441
|
+
...Object.entries(spec.roles).filter(([, role]) => !role.linked).map(([name, role]) => roleColumn(name, role)),
|
|
442
|
+
...lists.flatMap(([list, schema]) => {
|
|
443
|
+
const item = schema.items ?? {};
|
|
444
|
+
const own = item.required ?? [];
|
|
445
|
+
return Object.entries(item.properties ?? {}).map(([key, s]) => fieldColumn(`${list}.${key}`, s, required.includes(list) && own.includes(key), "item"));
|
|
446
|
+
})
|
|
447
|
+
];
|
|
448
|
+
}, "recordColumns");
|
|
449
|
+
var csvCell = /* @__PURE__ */ __name((value, separator) => /["\r\n]/.test(value) || value.includes(separator) ? `"${value.replaceAll('"', '""')}"` : value, "csvCell");
|
|
450
|
+
var example = /* @__PURE__ */ __name((column) => {
|
|
451
|
+
if (column.values?.[0])
|
|
452
|
+
return column.values[0];
|
|
453
|
+
switch (column.shape) {
|
|
454
|
+
case "decimal":
|
|
455
|
+
return "100.00";
|
|
456
|
+
case "day":
|
|
457
|
+
return "2026-01-31";
|
|
458
|
+
case "instant":
|
|
459
|
+
return "2026-01-31T09:00:00Z";
|
|
460
|
+
case "currency":
|
|
461
|
+
return "EUR";
|
|
462
|
+
case "integer":
|
|
463
|
+
return 1;
|
|
464
|
+
case "boolean":
|
|
465
|
+
return true;
|
|
466
|
+
case "list":
|
|
467
|
+
return ["\u2026"];
|
|
468
|
+
default:
|
|
469
|
+
return column.description || "\u2026";
|
|
470
|
+
}
|
|
471
|
+
}, "example");
|
|
472
|
+
var exampleRef = /* @__PURE__ */ __name((column) => ({
|
|
473
|
+
role: column.name,
|
|
474
|
+
type: column.targets?.[0] ?? "",
|
|
475
|
+
external_id: `${column.targets?.[0] ?? "record"}-1`
|
|
476
|
+
}), "exampleRef");
|
|
477
|
+
var recordTemplate = /* @__PURE__ */ __name((type, format, { source, separator = "," } = {}) => {
|
|
478
|
+
const columns = recordColumns(type);
|
|
479
|
+
if (columns.length === 0)
|
|
480
|
+
throw new TableError([unknownType(type)]);
|
|
481
|
+
if (format === "csv")
|
|
482
|
+
return `${BOM}${columns.map((c) => csvCell(c.name, separator)).join(separator)}\r
|
|
483
|
+
`;
|
|
484
|
+
const fields = {};
|
|
485
|
+
for (const c of columns.filter((c2) => c2.kind === "field"))
|
|
486
|
+
fields[c.name] = example(c);
|
|
487
|
+
for (const c of columns.filter((c2) => c2.kind === "item")) {
|
|
488
|
+
const [list = "", key = ""] = c.name.split(".");
|
|
489
|
+
fields[list] ??= [{}];
|
|
490
|
+
const [first] = fields[list];
|
|
491
|
+
if (first)
|
|
492
|
+
first[key] = example(c);
|
|
493
|
+
}
|
|
494
|
+
const envelope = {
|
|
495
|
+
schema_version: RECORDS_SCHEMA_VERSION,
|
|
496
|
+
source: {
|
|
497
|
+
provider: source?.provider ?? "sheet",
|
|
498
|
+
account: source?.account ?? "main",
|
|
499
|
+
batch_id: source?.batch_id ?? "first-import"
|
|
500
|
+
},
|
|
501
|
+
records: [
|
|
502
|
+
{
|
|
503
|
+
key: `${type}-1`,
|
|
504
|
+
type,
|
|
505
|
+
external_id: `${type}-1`,
|
|
506
|
+
operation: "upsert",
|
|
507
|
+
fields,
|
|
508
|
+
relations: columns.filter((c) => c.kind === "role").map(exampleRef)
|
|
509
|
+
}
|
|
510
|
+
]
|
|
511
|
+
};
|
|
512
|
+
return `${JSON.stringify(envelope, null, 2)}
|
|
513
|
+
`;
|
|
514
|
+
}, "recordTemplate");
|
|
515
|
+
var csvRows = /* @__PURE__ */ __name((text, separator) => {
|
|
516
|
+
const rows = [];
|
|
517
|
+
let cells = [];
|
|
518
|
+
let cell = "";
|
|
519
|
+
let quoted = false;
|
|
520
|
+
let line = 1;
|
|
521
|
+
let start = 1;
|
|
522
|
+
const end = /* @__PURE__ */ __name(() => {
|
|
523
|
+
cells.push(cell);
|
|
524
|
+
cell = "";
|
|
525
|
+
}, "end");
|
|
526
|
+
for (let i = 0; i < text.length; i++) {
|
|
527
|
+
const c = text[i];
|
|
528
|
+
if (quoted) {
|
|
529
|
+
if (c === '"' && text[i + 1] === '"') {
|
|
530
|
+
cell += '"';
|
|
531
|
+
i++;
|
|
532
|
+
} else if (c === '"')
|
|
533
|
+
quoted = false;
|
|
534
|
+
else {
|
|
535
|
+
if (c === "\n")
|
|
536
|
+
line++;
|
|
537
|
+
cell += c;
|
|
538
|
+
}
|
|
539
|
+
} else if (c === '"' && cell === "")
|
|
540
|
+
quoted = true;
|
|
541
|
+
else if (c === separator)
|
|
542
|
+
end();
|
|
543
|
+
else if (c === "\n" || c === "\r") {
|
|
544
|
+
if (c === "\r" && text[i + 1] === "\n")
|
|
545
|
+
i++;
|
|
546
|
+
end();
|
|
547
|
+
rows.push({ cells, line: start });
|
|
548
|
+
cells = [];
|
|
549
|
+
line++;
|
|
550
|
+
start = line;
|
|
551
|
+
} else
|
|
552
|
+
cell += c;
|
|
553
|
+
}
|
|
554
|
+
if (cell !== "" || cells.length > 0) {
|
|
555
|
+
end();
|
|
556
|
+
rows.push({ cells, line: start });
|
|
557
|
+
}
|
|
558
|
+
return rows.filter((r) => r.cells.some((c) => c.trim() !== ""));
|
|
559
|
+
}, "csvRows");
|
|
560
|
+
var csvSeparator = /* @__PURE__ */ __name((header) => {
|
|
561
|
+
const count = /* @__PURE__ */ __name((s) => header.split(s).length - 1, "count");
|
|
562
|
+
return [";", " ", ","].reduce((best, s) => count(s) > count(best) ? s : best, ",");
|
|
563
|
+
}, "csvSeparator");
|
|
564
|
+
var DAY_DOTTED = /^(\d{1,2})[./](\d{1,2})[./](\d{4})$/;
|
|
565
|
+
var normalized = /* @__PURE__ */ __name((column, raw) => {
|
|
566
|
+
const value = raw.trim();
|
|
567
|
+
switch (column.shape) {
|
|
568
|
+
case "decimal": {
|
|
569
|
+
const plain = value.replace(/[\s ]/g, "");
|
|
570
|
+
return /^\d+,\d+$/.test(plain) ? plain.replace(",", ".") : plain;
|
|
571
|
+
}
|
|
572
|
+
case "day": {
|
|
573
|
+
const dotted = DAY_DOTTED.exec(value);
|
|
574
|
+
return dotted ? `${dotted[3]}-${dotted[2]?.padStart(2, "0")}-${dotted[1]?.padStart(2, "0")}` : value;
|
|
575
|
+
}
|
|
576
|
+
case "currency":
|
|
577
|
+
return value.toUpperCase();
|
|
578
|
+
case "integer":
|
|
579
|
+
return /^-?\d+$/.test(value) ? Number(value) : value;
|
|
580
|
+
case "boolean":
|
|
581
|
+
return /^(true|yes|1|да|sí|si)$/i.test(value) ? true : /^(false|no|0|нет)$/i.test(value) ? false : value;
|
|
582
|
+
case "list":
|
|
583
|
+
return value.split(LIST_SEPARATOR).map((v) => v.trim()).filter(Boolean);
|
|
584
|
+
default:
|
|
585
|
+
return column.many ? value.split(LIST_SEPARATOR).map((v) => v.trim()).filter(Boolean) : value;
|
|
586
|
+
}
|
|
587
|
+
}, "normalized");
|
|
588
|
+
var unknownType = /* @__PURE__ */ __name((type) => ({
|
|
589
|
+
pointer: "",
|
|
590
|
+
code: "record.type",
|
|
591
|
+
message: `no table for ${type}: use one of ${TABLE_RECORD_TYPES.join(", ")}`
|
|
592
|
+
}), "unknownType");
|
|
593
|
+
var relationsOf = /* @__PURE__ */ __name((column, raw) => {
|
|
594
|
+
const targets = column.targets ?? [];
|
|
595
|
+
const values = column.many ? raw.split(LIST_SEPARATOR) : [raw];
|
|
596
|
+
const out = [];
|
|
597
|
+
for (const value of values.map((v) => v.trim()).filter(Boolean)) {
|
|
598
|
+
const at = value.indexOf(":");
|
|
599
|
+
const named = at > 0 ? value.slice(0, at) : "";
|
|
600
|
+
if (targets.length === 1 && !targets.includes(named)) {
|
|
601
|
+
out.push({ role: column.name, type: targets[0], external_id: value });
|
|
602
|
+
continue;
|
|
603
|
+
}
|
|
604
|
+
if (!targets.includes(named) || at === value.length - 1)
|
|
605
|
+
return {
|
|
606
|
+
pointer: "",
|
|
607
|
+
code: "record.invalid",
|
|
608
|
+
message: `${column.name} takes <type>:<external id>, the type one of ${targets.join(", ")}: not ${value}`
|
|
609
|
+
};
|
|
610
|
+
out.push({ role: column.name, type: named, external_id: value.slice(at + 1) });
|
|
611
|
+
}
|
|
612
|
+
return out;
|
|
613
|
+
}, "relationsOf");
|
|
614
|
+
var envelopeOfCsv = /* @__PURE__ */ __name((text, { type, source, options }) => {
|
|
615
|
+
const columns = recordColumns(type);
|
|
616
|
+
if (columns.length === 0)
|
|
617
|
+
throw new TableError([unknownType(type)]);
|
|
618
|
+
const body = text.startsWith(BOM) ? text.slice(1) : text;
|
|
619
|
+
const separator = csvSeparator(body.slice(0, body.search(/\r?\n|$/)));
|
|
620
|
+
const [head, ...rows] = csvRows(body, separator);
|
|
621
|
+
if (!head)
|
|
622
|
+
throw new TableError([{ pointer: "", code: "envelope.invalid", message: "the file has no header row" }]);
|
|
623
|
+
const byName = new Map(columns.map((c) => [c.name, c]));
|
|
624
|
+
const header = head.cells.map((name) => name.trim());
|
|
625
|
+
const unknown = header.filter((name) => name !== "" && !byName.has(name));
|
|
626
|
+
if (unknown.length > 0)
|
|
627
|
+
throw new TableError([
|
|
628
|
+
{
|
|
629
|
+
pointer: "",
|
|
630
|
+
code: "envelope.invalid",
|
|
631
|
+
message: `columns ${type} has no field for: ${unknown.join(", ")}. Download the ${type} template for the list`,
|
|
632
|
+
place: { line: 1, column: unknown[0] }
|
|
633
|
+
}
|
|
634
|
+
]);
|
|
635
|
+
if (!header.includes("external_id"))
|
|
636
|
+
throw new TableError([
|
|
637
|
+
{ pointer: "", code: "envelope.invalid", message: "the header has no external_id column", place: { line: 1 } }
|
|
638
|
+
]);
|
|
639
|
+
const records = [];
|
|
640
|
+
const indexById = /* @__PURE__ */ new Map();
|
|
641
|
+
const places = /* @__PURE__ */ new Map();
|
|
642
|
+
const errors = [];
|
|
643
|
+
for (const row of rows) {
|
|
644
|
+
const cell = /* @__PURE__ */ __name((name) => row.cells[header.indexOf(name)] ?? "", "cell");
|
|
645
|
+
const id = cell("external_id").trim();
|
|
646
|
+
if (!id) {
|
|
647
|
+
errors.push({
|
|
648
|
+
pointer: "",
|
|
649
|
+
code: "record.invalid",
|
|
650
|
+
message: "a row has no external_id",
|
|
651
|
+
place: { line: row.line, column: "external_id" }
|
|
652
|
+
});
|
|
653
|
+
continue;
|
|
654
|
+
}
|
|
655
|
+
const known = indexById.get(id);
|
|
656
|
+
const index = known ?? records.length;
|
|
657
|
+
const record = records[index] ?? {
|
|
658
|
+
key: `${type}:${id}`,
|
|
659
|
+
type,
|
|
660
|
+
external_id: id,
|
|
661
|
+
operation: "upsert",
|
|
662
|
+
fields: {},
|
|
663
|
+
relations: []
|
|
664
|
+
};
|
|
665
|
+
if (known === void 0) {
|
|
666
|
+
records.push(record);
|
|
667
|
+
indexById.set(id, index);
|
|
668
|
+
places.set(pointerOf("records", index), { line: row.line });
|
|
669
|
+
}
|
|
670
|
+
const fields = record.fields;
|
|
671
|
+
const item = {};
|
|
672
|
+
let list = "";
|
|
673
|
+
header.forEach((name, i) => {
|
|
674
|
+
const column = byName.get(name);
|
|
675
|
+
const raw = row.cells[i] ?? "";
|
|
676
|
+
if (!column || column.kind === "id" || raw.trim() === "")
|
|
677
|
+
return;
|
|
678
|
+
const at = { line: row.line, column: name };
|
|
679
|
+
if (column.kind === "field") {
|
|
680
|
+
fields[name] = normalized(column, raw);
|
|
681
|
+
places.set(pointerOf("records", index, "fields", name), at);
|
|
682
|
+
} else if (column.kind === "role") {
|
|
683
|
+
const relations = relationsOf(column, raw);
|
|
684
|
+
if (!Array.isArray(relations)) {
|
|
685
|
+
errors.push({ ...relations, pointer: pointerOf("records", index, "relations"), key: record.key, place: at });
|
|
686
|
+
return;
|
|
687
|
+
}
|
|
688
|
+
record.relations = [...(record.relations ?? []).filter((r) => r.role !== name), ...relations];
|
|
689
|
+
places.set(pointerOf("records", index, "relations"), at);
|
|
690
|
+
} else {
|
|
691
|
+
const [of = "", key = ""] = name.split(".");
|
|
692
|
+
list = of;
|
|
693
|
+
item[key] = normalized(column, raw);
|
|
694
|
+
}
|
|
695
|
+
});
|
|
696
|
+
if (list) {
|
|
697
|
+
fields[list] ??= [];
|
|
698
|
+
const items = fields[list];
|
|
699
|
+
places.set(pointerOf("records", index, "fields", list, items.length), { line: row.line });
|
|
700
|
+
items.push(item);
|
|
701
|
+
}
|
|
702
|
+
}
|
|
703
|
+
if (errors.length > 0)
|
|
704
|
+
throw new TableError(errors);
|
|
705
|
+
const envelope = {
|
|
706
|
+
schema_version: RECORDS_SCHEMA_VERSION,
|
|
707
|
+
source,
|
|
708
|
+
...options ? { options } : {},
|
|
709
|
+
records
|
|
710
|
+
};
|
|
711
|
+
return {
|
|
712
|
+
envelope,
|
|
713
|
+
placeOf(pointer) {
|
|
714
|
+
const item = /^\/records\/\d+\/fields\/([^/]+)\/\d+\/([^/]+)/.exec(pointer);
|
|
715
|
+
for (let at = pointer; at !== ""; at = at.slice(0, at.lastIndexOf("/"))) {
|
|
716
|
+
const place = places.get(at);
|
|
717
|
+
if (place)
|
|
718
|
+
return item && !place.column ? { ...place, column: `${item[1]}.${item[2]}` } : place;
|
|
719
|
+
}
|
|
720
|
+
return void 0;
|
|
721
|
+
}
|
|
722
|
+
};
|
|
723
|
+
}, "envelopeOfCsv");
|
|
724
|
+
|
|
365
725
|
// node_modules/.pnpm/qrcode-generator@2.0.4/node_modules/qrcode-generator/dist/qrcode.mjs
|
|
366
726
|
var qrcode = /* @__PURE__ */ __name(function(typeNumber, errorCorrectionLevel) {
|
|
367
727
|
const PAD0 = 236;
|
|
@@ -1996,7 +2356,7 @@ var createDataURL = /* @__PURE__ */ __name(function(width, height, getPixel) {
|
|
|
1996
2356
|
var qrcode_default = qrcode;
|
|
1997
2357
|
var stringToBytes = qrcode.stringToBytes;
|
|
1998
2358
|
|
|
1999
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2359
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.647.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_a46df5420a4458268e3f15f3e8c41b99/node_modules/@wirecat/cli-core/dist/terminal/qr.js
|
|
2000
2360
|
var QUIET_ZONE = 4;
|
|
2001
2361
|
var BLACK_ON_WHITE = "\x1B[30;107m";
|
|
2002
2362
|
var RESET = "\x1B[0m";
|
|
@@ -2043,7 +2403,7 @@ var plainQr = /* @__PURE__ */ __name((link) => {
|
|
|
2043
2403
|
return lines.join("\n");
|
|
2044
2404
|
}, "plainQr");
|
|
2045
2405
|
|
|
2046
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2406
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.647.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_a46df5420a4458268e3f15f3e8c41b99/node_modules/@wirecat/cli-core/dist/terminal/login-qr.js
|
|
2047
2407
|
var MARGIN = 2;
|
|
2048
2408
|
var atTerminal = /* @__PURE__ */ __name((input) => input.isTTY === true && !inputPolicy(input).noInput, "atTerminal");
|
|
2049
2409
|
var PASTE_QR = "agents: paste the QR code above into the chat as a code block, exactly as printed; when a new one is printed, paste it and say the old one expired";
|
|
@@ -2092,6 +2452,11 @@ export {
|
|
|
2092
2452
|
parseMarkdown,
|
|
2093
2453
|
parseMarkdownSpans,
|
|
2094
2454
|
countedPoll,
|
|
2455
|
+
TABLE_RECORD_TYPES,
|
|
2456
|
+
TableError,
|
|
2457
|
+
recordColumns,
|
|
2458
|
+
recordTemplate,
|
|
2459
|
+
envelopeOfCsv,
|
|
2095
2460
|
terminalQr,
|
|
2096
2461
|
plainQr,
|
|
2097
2462
|
atTerminal,
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
__name
|
|
5
5
|
} from "./chunk-ZVVMGPBJ.js";
|
|
6
6
|
|
|
7
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
7
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/errors.js
|
|
8
8
|
var errorCodes = [
|
|
9
9
|
"validation_error",
|
|
10
10
|
"configuration_error",
|
|
@@ -39,7 +39,7 @@ var CliError = class extends Error {
|
|
|
39
39
|
};
|
|
40
40
|
var isCliError = /* @__PURE__ */ __name((value) => typeof value === "object" && value !== null && value[BRAND] === true, "isCliError");
|
|
41
41
|
|
|
42
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
42
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/sanitize.js
|
|
43
43
|
var CONTROL = (
|
|
44
44
|
// biome-ignore lint/suspicious/noControlCharactersInRegex: matching them is the whole point
|
|
45
45
|
/[\u0000-\u0008\u000B-\u001F\u007F-\u009F\u200B\u200E\u200F\u202A-\u202E\u2066-\u2069\uFEFF\u{E0000}-\u{E007F}]/gu
|
|
@@ -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.647.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_a46df5420a4458268e3f15f3e8c41b99/node_modules/@wirecat/cli-core/dist/mcp/instructions.js
|
|
8
8
|
var instructions = /* @__PURE__ */ __name(({ command, name, profile, writes, skill }) => {
|
|
9
9
|
const all = typeof profile !== "string";
|
|
10
10
|
const offers = /* @__PURE__ */ __name((key) => all || writes.includes(key), "offers");
|