@wirecat/attio-cli 0.8.0 → 0.10.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/contracts/wirecat.json +1 -0
- package/dist/bin/attio.js +11 -11
- package/dist/bundle/attio.js +5 -166
- package/dist/bundle/{chunk-UXJZISVL.js → chunk-OGWKDPR5.js} +2 -1
- package/dist/bundle/chunk-TQAECZFO.js +13 -0
- package/dist/bundle/{definitions-FODOIPM2.js → definitions-J73IBAHT.js} +1 -1
- package/dist/bundle/program-NSBWZ25F.js +6201 -0
- package/dist/bundle/{schemas-YGSTNU6F.js → schemas-G3HFAS45.js} +576 -29
- package/dist/commands/api.js +1 -2
- package/dist/commands/crm.js +1 -4
- package/dist/commands/schedule.js +1 -1
- package/dist/commands/session.js +1 -2
- package/dist/config.js +1 -2
- package/dist/context.js +1 -1
- package/dist/identity.js +1 -0
- package/dist/program.js +1 -2
- package/dist/version.js +1 -1
- package/package.json +4 -4
- package/dist/activities.d.ts +0 -4
- package/dist/activities.d.ts.map +0 -1
- package/dist/activities.js.map +0 -1
- package/dist/bin/attio.d.ts +0 -3
- package/dist/bin/attio.d.ts.map +0 -1
- package/dist/bin/attio.js.map +0 -1
- package/dist/bundle/agent-GUXXSLT5.js +0 -38
- package/dist/bundle/all-profiles-63N3EQ46.js +0 -320
- package/dist/bundle/anthropic-B4W7MZQE.js +0 -91
- package/dist/bundle/app-server-EXNGTHWO.js +0 -250
- package/dist/bundle/bun-OPDGMZZQ.js +0 -169
- package/dist/bundle/bun-sqlite-NBAY7FR2.js +0 -76
- package/dist/bundle/chunk-2JHVQMVC.js +0 -16
- package/dist/bundle/chunk-2QDUP74I.js +0 -794
- package/dist/bundle/chunk-2XBDILVW.js +0 -53
- package/dist/bundle/chunk-3HC5F3P7.js +0 -24
- package/dist/bundle/chunk-3MSHGNVE.js +0 -1243
- package/dist/bundle/chunk-3YM4B2GT.js +0 -63
- package/dist/bundle/chunk-4N7PP76S.js +0 -6848
- package/dist/bundle/chunk-4RBMCXZT.js +0 -1337
- package/dist/bundle/chunk-4RSWOPKL.js +0 -323
- package/dist/bundle/chunk-5JKTVAXX.js +0 -2788
- package/dist/bundle/chunk-5N2V6XO7.js +0 -119
- package/dist/bundle/chunk-5WD22IXQ.js +0 -66
- package/dist/bundle/chunk-6K4Z6CAM.js +0 -43997
- package/dist/bundle/chunk-6TD3DCWC.js +0 -106
- package/dist/bundle/chunk-7Z53MLQP.js +0 -388
- package/dist/bundle/chunk-AATTOFNY.js +0 -2045
- package/dist/bundle/chunk-APARYILG.js +0 -743
- package/dist/bundle/chunk-D72URWJE.js +0 -532
- package/dist/bundle/chunk-DFDN6AUB.js +0 -21
- package/dist/bundle/chunk-DM7KWVDZ.js +0 -3752
- package/dist/bundle/chunk-DNCLQPOM.js +0 -7
- package/dist/bundle/chunk-DPD4FMHN.js +0 -388
- package/dist/bundle/chunk-DPV53EZC.js +0 -206
- package/dist/bundle/chunk-DURNR4RO.js +0 -353
- package/dist/bundle/chunk-EH6ZEJGT.js +0 -932
- package/dist/bundle/chunk-EVUMQKV7.js +0 -76
- package/dist/bundle/chunk-EY36BTKZ.js +0 -108
- package/dist/bundle/chunk-FH6OEGGN.js +0 -557
- package/dist/bundle/chunk-FOP6G45D.js +0 -358
- package/dist/bundle/chunk-GGMAIIVE.js +0 -38
- package/dist/bundle/chunk-GTEX4IUO.js +0 -334
- package/dist/bundle/chunk-HZ3C4WXD.js +0 -142
- package/dist/bundle/chunk-IA7LLLEI.js +0 -100
- package/dist/bundle/chunk-J6GVVISK.js +0 -185
- package/dist/bundle/chunk-JG6LCSEX.js +0 -407
- package/dist/bundle/chunk-JIGEJZ4I.js +0 -68943
- package/dist/bundle/chunk-KVTNYRDO.js +0 -1007
- package/dist/bundle/chunk-L45WN3AR.js +0 -80
- package/dist/bundle/chunk-L72WUJAS.js +0 -54
- package/dist/bundle/chunk-LKH3UKLO.js +0 -230
- package/dist/bundle/chunk-LM3W7YOM.js +0 -274
- package/dist/bundle/chunk-M4AC55ZB.js +0 -12733
- package/dist/bundle/chunk-MCLQTCGH.js +0 -1202
- package/dist/bundle/chunk-NB7EOAUZ.js +0 -123
- package/dist/bundle/chunk-NISH4UXM.js +0 -58
- package/dist/bundle/chunk-OYEVYOCL.js +0 -259
- package/dist/bundle/chunk-P7G5HFY3.js +0 -288
- package/dist/bundle/chunk-PAEKXVJW.js +0 -188
- package/dist/bundle/chunk-PL5P7UKW.js +0 -25216
- package/dist/bundle/chunk-PLPBEWD4.js +0 -170
- package/dist/bundle/chunk-PMQ7GP6X.js +0 -95
- package/dist/bundle/chunk-Q7ICVP25.js +0 -18
- package/dist/bundle/chunk-QPPOIWPY.js +0 -1246
- package/dist/bundle/chunk-QSJKSPWF.js +0 -131
- package/dist/bundle/chunk-RDVTHFPP.js +0 -338
- package/dist/bundle/chunk-RQORQN2V.js +0 -4072
- package/dist/bundle/chunk-RRTMPSQR.js +0 -29
- package/dist/bundle/chunk-S4UUN6LD.js +0 -1410
- package/dist/bundle/chunk-S6JG4YUH.js +0 -72
- package/dist/bundle/chunk-SCI7QEHF.js +0 -362
- package/dist/bundle/chunk-SSA6JBPA.js +0 -778
- package/dist/bundle/chunk-T4J7XFXT.js +0 -9667
- package/dist/bundle/chunk-TTF5DP4V.js +0 -1197
- package/dist/bundle/chunk-TXDR6YSF.js +0 -23
- package/dist/bundle/chunk-TY7NDMFY.js +0 -46
- package/dist/bundle/chunk-UDSL3MUU.js +0 -2333
- package/dist/bundle/chunk-UKHF37ZU.js +0 -1068
- package/dist/bundle/chunk-V57E7PJQ.js +0 -161
- package/dist/bundle/chunk-V7IF2K3P.js +0 -52
- package/dist/bundle/chunk-VB7FZOYX.js +0 -633
- package/dist/bundle/chunk-VZ5PPYDG.js +0 -77
- package/dist/bundle/chunk-WOPVBRPV.js +0 -29
- package/dist/bundle/chunk-WXQGA6XK.js +0 -50
- package/dist/bundle/chunk-XQGN2D44.js +0 -86
- package/dist/bundle/chunk-XQUUANA2.js +0 -24600
- package/dist/bundle/chunk-Y5E2WNWB.js +0 -35
- package/dist/bundle/chunk-YNGU36GW.js +0 -218
- package/dist/bundle/chunk-YWDFYQOU.js +0 -82
- package/dist/bundle/chunk-ZVVMGPBJ.js +0 -50
- package/dist/bundle/chunk-ZZD2YPOX.js +0 -156
- package/dist/bundle/command-contract-KCCW4LNI.js +0 -37
- package/dist/bundle/command-server-entry-3NPPABQQ.js +0 -166
- package/dist/bundle/decode-26M7XE2B.js +0 -297
- package/dist/bundle/dispatch-2FTOHA5D.js +0 -411
- package/dist/bundle/dist-EM7KLEG4.js +0 -7577
- package/dist/bundle/dist-PAKDDIBT.js +0 -191
- package/dist/bundle/echarts-O3TNDAXJ.js +0 -42501
- package/dist/bundle/embed-XJLEAWXE.js +0 -38
- package/dist/bundle/embedder-OEL6PXEH.js +0 -111
- package/dist/bundle/failure-OHIXWTR6.js +0 -25
- package/dist/bundle/first-run-CIXGBXY6.js +0 -29
- package/dist/bundle/first-screen-5FK4D45F.js +0 -38
- package/dist/bundle/instructions-AMH5RWVJ.js +0 -11
- package/dist/bundle/mcp-5HFPWC3W.js +0 -167
- package/dist/bundle/meeting-combined-DMVGQNJ7.js +0 -24
- package/dist/bundle/meeting-model-2THAT7OH.js +0 -25
- package/dist/bundle/meeting-semantic-Q6XYFYUD.js +0 -22
- package/dist/bundle/node-EGMCBAO7.js +0 -176
- package/dist/bundle/node-KM3CUABH.js +0 -2340
- package/dist/bundle/node-TLZSIHIJ.js +0 -21
- package/dist/bundle/node-sqlite-2SWWGW6H.js +0 -74
- package/dist/bundle/oauth-V5LGTXF2.js +0 -20
- package/dist/bundle/open-25EKOTZA.js +0 -23
- package/dist/bundle/openai-VX3OLIHM.js +0 -238
- package/dist/bundle/process-SGHEN6MQ.js +0 -91
- package/dist/bundle/program-Z5NUNXME.js +0 -34214
- package/dist/bundle/prompt-2VSPX5S7.js +0 -17
- package/dist/bundle/recognize-NA5XUFKK.js +0 -26
- package/dist/bundle/remote-BOME6XOE.js +0 -31
- package/dist/bundle/rerank-NG3XMFCV.js +0 -52
- package/dist/bundle/serve-MR67OBED.js +0 -199
- package/dist/bundle/server-4BWAGJQO.js +0 -80
- package/dist/bundle/server-OP2HJNXD.js +0 -213
- package/dist/bundle/sqlite-runtime-V5U6F5EB.js +0 -20
- package/dist/bundle/state-L4MWAATO.js +0 -36
- package/dist/bundle/store-2ALTEH55.js +0 -181
- package/dist/bundle/store-CXZFRG5D.js +0 -297
- package/dist/bundle/store-maintenance-command-LC55DRQA.js +0 -67
- package/dist/bundle/surface-3GRJ7473.js +0 -66
- package/dist/commands/api.d.ts +0 -12
- package/dist/commands/api.d.ts.map +0 -1
- package/dist/commands/api.js.map +0 -1
- package/dist/commands/crm.d.ts +0 -7
- package/dist/commands/crm.d.ts.map +0 -1
- package/dist/commands/crm.js.map +0 -1
- package/dist/commands/schedule.d.ts +0 -3
- package/dist/commands/schedule.d.ts.map +0 -1
- package/dist/commands/schedule.js.map +0 -1
- package/dist/commands/session.d.ts +0 -8
- package/dist/commands/session.d.ts.map +0 -1
- package/dist/commands/session.js.map +0 -1
- package/dist/config.d.ts +0 -13
- package/dist/config.d.ts.map +0 -1
- package/dist/config.js.map +0 -1
- package/dist/context.d.ts +0 -37
- package/dist/context.d.ts.map +0 -1
- package/dist/context.js.map +0 -1
- package/dist/generated/definitions.d.ts +0 -3
- package/dist/generated/definitions.d.ts.map +0 -1
- package/dist/generated/definitions.js.map +0 -1
- package/dist/generated/manifest.d.ts +0 -6
- package/dist/generated/manifest.d.ts.map +0 -1
- package/dist/generated/manifest.js.map +0 -1
- package/dist/generated/schemas.d.ts +0 -383
- package/dist/generated/schemas.d.ts.map +0 -1
- package/dist/generated/schemas.js.map +0 -1
- package/dist/generated/types.d.ts +0 -10166
- package/dist/generated/types.d.ts.map +0 -1
- package/dist/generated/types.js.map +0 -1
- package/dist/generated/wirecat-config.d.ts +0 -15
- package/dist/generated/wirecat-config.d.ts.map +0 -1
- package/dist/generated/wirecat-config.js.map +0 -1
- package/dist/hooks.d.ts +0 -33
- package/dist/hooks.d.ts.map +0 -1
- package/dist/hooks.js.map +0 -1
- package/dist/identity.d.ts +0 -33
- package/dist/identity.d.ts.map +0 -1
- package/dist/identity.js.map +0 -1
- package/dist/index.d.ts +0 -3
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/links.d.ts +0 -10
- package/dist/links.d.ts.map +0 -1
- package/dist/links.js.map +0 -1
- package/dist/meetings.d.ts +0 -57
- package/dist/meetings.d.ts.map +0 -1
- package/dist/meetings.js.map +0 -1
- package/dist/program.d.ts +0 -6
- package/dist/program.d.ts.map +0 -1
- package/dist/program.js.map +0 -1
- package/dist/version.d.ts +0 -2
- package/dist/version.d.ts.map +0 -1
- package/dist/version.js.map +0 -1
- package/dist/wcat.d.ts +0 -3
- package/dist/wcat.d.ts.map +0 -1
- package/dist/wcat.js.map +0 -1
|
@@ -1,323 +0,0 @@
|
|
|
1
|
-
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
-
const require = __bundleRequire(import.meta.url);
|
|
3
|
-
import {
|
|
4
|
-
wrapAnsi
|
|
5
|
-
} from "./chunk-EH6ZEJGT.js";
|
|
6
|
-
import {
|
|
7
|
-
WIRECAT_TOOLS
|
|
8
|
-
} from "./chunk-NB7EOAUZ.js";
|
|
9
|
-
import {
|
|
10
|
-
hasOwnAction,
|
|
11
|
-
isHidden
|
|
12
|
-
} from "./chunk-WOPVBRPV.js";
|
|
13
|
-
import {
|
|
14
|
-
commandPathOf,
|
|
15
|
-
outputOf
|
|
16
|
-
} from "./chunk-QSJKSPWF.js";
|
|
17
|
-
import {
|
|
18
|
-
Command,
|
|
19
|
-
Help,
|
|
20
|
-
NO_EFFECTS,
|
|
21
|
-
Option,
|
|
22
|
-
annotate,
|
|
23
|
-
commandAt,
|
|
24
|
-
environmentOf,
|
|
25
|
-
metaOf,
|
|
26
|
-
takesProfile
|
|
27
|
-
} from "./chunk-M4AC55ZB.js";
|
|
28
|
-
import {
|
|
29
|
-
writes
|
|
30
|
-
} from "./chunk-QPPOIWPY.js";
|
|
31
|
-
import {
|
|
32
|
-
CliError
|
|
33
|
-
} from "./chunk-S6JG4YUH.js";
|
|
34
|
-
import {
|
|
35
|
-
__name
|
|
36
|
-
} from "./chunk-ZVVMGPBJ.js";
|
|
37
|
-
|
|
38
|
-
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/cli/help/command-help.js
|
|
39
|
-
var ARGUMENT_KINDS = {
|
|
40
|
-
chat: "chat",
|
|
41
|
-
chats: "chat",
|
|
42
|
-
message: "message",
|
|
43
|
-
messages: "message",
|
|
44
|
-
post: "message",
|
|
45
|
-
person: "person",
|
|
46
|
-
people: "person",
|
|
47
|
-
task: "task",
|
|
48
|
-
meeting: "meeting",
|
|
49
|
-
folder: "folder",
|
|
50
|
-
folders: "folder",
|
|
51
|
-
topic: "topic",
|
|
52
|
-
note: "note",
|
|
53
|
-
document: "document",
|
|
54
|
-
model: "model"
|
|
55
|
-
};
|
|
56
|
-
var ENTITY_KINDS = {
|
|
57
|
-
message: "message",
|
|
58
|
-
message_link: "message",
|
|
59
|
-
chat: "chat",
|
|
60
|
-
contact: "person",
|
|
61
|
-
member: "person",
|
|
62
|
-
person: "person",
|
|
63
|
-
task: "task",
|
|
64
|
-
meeting: "meeting",
|
|
65
|
-
meeting_details: "meeting",
|
|
66
|
-
meeting_hit: "meeting",
|
|
67
|
-
meeting_summary: "meeting",
|
|
68
|
-
folder: "folder",
|
|
69
|
-
topic: "topic",
|
|
70
|
-
note: "note",
|
|
71
|
-
document: "document",
|
|
72
|
-
model: "model"
|
|
73
|
-
};
|
|
74
|
-
var HOME = {
|
|
75
|
-
chat: "chats",
|
|
76
|
-
message: "messages",
|
|
77
|
-
person: "contacts",
|
|
78
|
-
task: "tasks",
|
|
79
|
-
meeting: "meetings",
|
|
80
|
-
folder: "folders",
|
|
81
|
-
topic: "topics",
|
|
82
|
-
note: "notes",
|
|
83
|
-
document: "documents",
|
|
84
|
-
model: "models"
|
|
85
|
-
};
|
|
86
|
-
var SAMPLES = {
|
|
87
|
-
chat: "Team",
|
|
88
|
-
message: "1234",
|
|
89
|
-
post: "1234",
|
|
90
|
-
person: "Anna",
|
|
91
|
-
people: "Anna",
|
|
92
|
-
task: "12",
|
|
93
|
-
meeting: "123",
|
|
94
|
-
folder: "Work",
|
|
95
|
-
topic: "General",
|
|
96
|
-
model: "default",
|
|
97
|
-
query: '"invoice"',
|
|
98
|
-
text: '"on my way"',
|
|
99
|
-
title: '"Weekly sync"',
|
|
100
|
-
name: "daily",
|
|
101
|
-
id: "1",
|
|
102
|
-
file: "./report.pdf",
|
|
103
|
-
link: "https://example.com/join/abc",
|
|
104
|
-
url: "https://example.com",
|
|
105
|
-
since: "1d",
|
|
106
|
-
duration: "1d",
|
|
107
|
-
limit: "20"
|
|
108
|
-
};
|
|
109
|
-
var MAX_NEXT = 3;
|
|
110
|
-
var choices = /* @__PURE__ */ new WeakMap();
|
|
111
|
-
var kindOfArgument = /* @__PURE__ */ __name((argument) => ARGUMENT_KINDS[argument.name()], "kindOfArgument");
|
|
112
|
-
var runs = /* @__PURE__ */ __name((command) => command.commands.length === 0 || hasOwnAction(command), "runs");
|
|
113
|
-
var leaves = /* @__PURE__ */ __name((command) => command.commands.filter((child) => !isHidden(child)).flatMap((child) => [...runs(child) ? [child] : [], ...leaves(child)]), "leaves");
|
|
114
|
-
var rootOf = /* @__PURE__ */ __name((command) => {
|
|
115
|
-
let at = command;
|
|
116
|
-
while (at.parent)
|
|
117
|
-
at = at.parent;
|
|
118
|
-
return at;
|
|
119
|
-
}, "rootOf");
|
|
120
|
-
var call = /* @__PURE__ */ __name((command) => [
|
|
121
|
-
rootOf(command).name(),
|
|
122
|
-
...commandPathOf(command),
|
|
123
|
-
...command.registeredArguments.map((one) => one.required ? `<${one.name()}>` : `[${one.name()}]`)
|
|
124
|
-
].join(" "), "call");
|
|
125
|
-
var fieldsOf = /* @__PURE__ */ __name((schema) => {
|
|
126
|
-
const variants = schema.anyOf;
|
|
127
|
-
if (variants)
|
|
128
|
-
return variants.flatMap(fieldsOf);
|
|
129
|
-
const required = schema.required ?? [];
|
|
130
|
-
return [...required, ...Object.keys(schema.properties ?? {})];
|
|
131
|
-
}, "fieldsOf");
|
|
132
|
-
var returnsOf = /* @__PURE__ */ __name((command) => {
|
|
133
|
-
const output = metaOf(command).output;
|
|
134
|
-
const { item, coverage } = outputOf(command);
|
|
135
|
-
if (!output || coverage !== "declared-entity")
|
|
136
|
-
return "";
|
|
137
|
-
const fields = [...new Set(fieldsOf(item))];
|
|
138
|
-
const noun = (output.view ? `${output.entity} ${output.view}` : output.entity).replaceAll("_", " ");
|
|
139
|
-
const more = fields.length > 8 ? `, and ${fields.length - 8} more` : "";
|
|
140
|
-
const root = rootOf(command);
|
|
141
|
-
const schema = commandAt(root, "commands info") ? `; every field: ${root.name()} commands info ${commandPathOf(command).join(" ")}` : "";
|
|
142
|
-
return `${noun} \u2014 ${fields.slice(0, 8).join(", ")}${more}${schema}`;
|
|
143
|
-
}, "returnsOf");
|
|
144
|
-
var nextOf = /* @__PURE__ */ __name((command) => {
|
|
145
|
-
const root = rootOf(command);
|
|
146
|
-
const choice = choices.get(command) ?? {};
|
|
147
|
-
const drop = new Set(choice.drop ?? []);
|
|
148
|
-
const pinned = (choice.pin ?? []).flatMap((path) => commandAt(root, path) ?? []);
|
|
149
|
-
const output = metaOf(command).output;
|
|
150
|
-
const kind = output ? ENTITY_KINDS[output.entity] : void 0;
|
|
151
|
-
const all = leaves(root);
|
|
152
|
-
const derived = kind ? all.filter((other) => other !== command && !pinned.includes(other)).filter((other) => other.registeredArguments.some((argument) => kindOfArgument(argument) === kind)).map((other, order) => ({ other, order })).sort((a, b) => {
|
|
153
|
-
const rank = /* @__PURE__ */ __name((other) => [
|
|
154
|
-
Number(writes(metaOf(other).effects)),
|
|
155
|
-
Number(!other.registeredArguments.some((one) => one.required && kindOfArgument(one) === kind)),
|
|
156
|
-
Number(commandPathOf(other)[0] !== HOME[kind]),
|
|
157
|
-
Number(other.parent !== command.parent)
|
|
158
|
-
], "rank");
|
|
159
|
-
const [left, right] = [rank(a.other), rank(b.other)];
|
|
160
|
-
return left.reduce((found, value, at) => found || value - (right[at] ?? 0), 0) || a.order - b.order;
|
|
161
|
-
}).map(({ other }) => other) : [];
|
|
162
|
-
return [...pinned, ...derived].filter((other) => !drop.has(commandPathOf(other).join(" "))).slice(0, MAX_NEXT);
|
|
163
|
-
}, "nextOf");
|
|
164
|
-
var sample = /* @__PURE__ */ __name((name) => SAMPLES[name] ?? `<${name}>`, "sample");
|
|
165
|
-
var generatedExample = /* @__PURE__ */ __name((command) => {
|
|
166
|
-
const { query } = metaOf(command);
|
|
167
|
-
const words = command.registeredArguments.flatMap((argument) => {
|
|
168
|
-
const name = argument.name();
|
|
169
|
-
if (name === "query" && query)
|
|
170
|
-
return [];
|
|
171
|
-
if (!argument.required && SAMPLES[name] === void 0)
|
|
172
|
-
return [];
|
|
173
|
-
return [argument.argChoices?.[0] ?? sample(name)];
|
|
174
|
-
});
|
|
175
|
-
const options = command.options.filter((option) => option.mandatory).flatMap((option) => {
|
|
176
|
-
const flag = option.long ?? option.short ?? option.flags;
|
|
177
|
-
const placeholder = /[<[]([^>\]]+)[>\]]/.exec(option.flags)?.[1];
|
|
178
|
-
if (!(option.required || option.optional))
|
|
179
|
-
return [flag];
|
|
180
|
-
return [flag, option.argChoices?.[0] ?? sample(placeholder ?? option.attributeName())];
|
|
181
|
-
});
|
|
182
|
-
return [rootOf(command).name(), ...commandPathOf(command), ...words, ...options].join(" ");
|
|
183
|
-
}, "generatedExample");
|
|
184
|
-
var profiled = /* @__PURE__ */ new WeakSet();
|
|
185
|
-
var EXAMPLE_PROFILE = "personal";
|
|
186
|
-
var withProfile = /* @__PURE__ */ __name((command, example) => {
|
|
187
|
-
const root = rootOf(command);
|
|
188
|
-
const top = commandPathOf(command)[0];
|
|
189
|
-
if (!profiled.has(root) || top === void 0 || !takesProfile(command))
|
|
190
|
-
return example;
|
|
191
|
-
if (example.split(" ").includes("--profiles"))
|
|
192
|
-
return example;
|
|
193
|
-
const prefix = `${root.name()} ${top}`;
|
|
194
|
-
return example === prefix || example.startsWith(`${prefix} `) ? `${root.name()} ${EXAMPLE_PROFILE} ${example.slice(root.name().length + 1)}` : example;
|
|
195
|
-
}, "withProfile");
|
|
196
|
-
var commandHelp = /* @__PURE__ */ __name((command) => {
|
|
197
|
-
const written = metaOf(command).examples ?? [];
|
|
198
|
-
return {
|
|
199
|
-
returns: returnsOf(command),
|
|
200
|
-
next: nextOf(command).map(call),
|
|
201
|
-
examples: (written.length > 0 ? written : [generatedExample(command)]).map((one) => withProfile(command, one)),
|
|
202
|
-
origin: written.length > 0 ? "written" : "generated"
|
|
203
|
-
};
|
|
204
|
-
}, "commandHelp");
|
|
205
|
-
var LABEL = 15;
|
|
206
|
-
var commandHelpText = /* @__PURE__ */ __name((command) => {
|
|
207
|
-
const { returns, next, examples } = commandHelp(command);
|
|
208
|
-
const rows = /* @__PURE__ */ __name((label, values) => values.map((value, at) => `${(at === 0 ? label : "").padEnd(LABEL)}${value}`), "rows");
|
|
209
|
-
const availability = environmentOf(command).discoveryAvailability?.({
|
|
210
|
-
...metaOf(command),
|
|
211
|
-
path: commandPathOf(command)
|
|
212
|
-
});
|
|
213
|
-
const profileMatters = profiled.has(rootOf(command)) && takesProfile(command);
|
|
214
|
-
const access = !availability ? [] : availability.available ? profileMatters ? rows("Availability:", ["available for this profile"]) : [] : rows("Availability:", [`unavailable \u2014 ${availability.reason}`]);
|
|
215
|
-
return [
|
|
216
|
-
"",
|
|
217
|
-
...access,
|
|
218
|
-
...rows("Returns:", returns ? [returns] : []),
|
|
219
|
-
...rows("Next usually:", next),
|
|
220
|
-
...rows("Example:", examples),
|
|
221
|
-
""
|
|
222
|
-
].join("\n");
|
|
223
|
-
}, "commandHelpText");
|
|
224
|
-
var installCommandHelp = /* @__PURE__ */ __name((program, { profile = true } = {}) => {
|
|
225
|
-
if (profile)
|
|
226
|
-
profiled.add(program);
|
|
227
|
-
for (const command of leaves(program))
|
|
228
|
-
command.addHelpText("after", () => commandHelpText(command));
|
|
229
|
-
}, "installCommandHelp");
|
|
230
|
-
|
|
231
|
-
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/cli/help/first-screen.js
|
|
232
|
-
var WIDTH = 100;
|
|
233
|
-
var widest = /* @__PURE__ */ __name((texts) => texts.reduce((most, text) => Math.max(most, text.length), 0), "widest");
|
|
234
|
-
var block = /* @__PURE__ */ __name((title, rows, column) => rows.length === 0 ? [] : ["", `${title}:`, ...rows.map(([left, right]) => ` ${left.padEnd(column)}${right}`)], "block");
|
|
235
|
-
var TOPICS = [
|
|
236
|
-
["--json", "output"],
|
|
237
|
-
["--offline", "offline"],
|
|
238
|
-
["--timeout", "timeouts"],
|
|
239
|
-
["--dry-run", "dry run"]
|
|
240
|
-
];
|
|
241
|
-
var optionTopics = /* @__PURE__ */ __name((program) => {
|
|
242
|
-
const longs = new Set(program.options.map((option) => option.long));
|
|
243
|
-
const topics = TOPICS.filter(([long]) => longs.has(long)).map(([, topic]) => topic);
|
|
244
|
-
return topics.length > 0 ? topics.join(", ") : "the options every command takes";
|
|
245
|
-
}, "optionTopics");
|
|
246
|
-
var pointers = /* @__PURE__ */ __name((program, cli, start, profile) => {
|
|
247
|
-
const has = /* @__PURE__ */ __name((path) => commandAt(program, path) !== void 0, "has");
|
|
248
|
-
const next = [
|
|
249
|
-
has("commands") ? [`${cli} commands`, "every command, by section"] : void 0,
|
|
250
|
-
has("guide") ? [`${cli} guide`, "scenarios: command sequences for common tasks"] : void 0,
|
|
251
|
-
[`${cli} help options`, optionTopics(program)]
|
|
252
|
-
].filter((row) => row !== void 0);
|
|
253
|
-
const rows = [
|
|
254
|
-
...start ? [["Start here:", start, profile ? "(any profile name works)" : ""]] : [],
|
|
255
|
-
...has("account list") ? [["", `${cli} account list`, "your profiles and their logged-in accounts"]] : [],
|
|
256
|
-
...next.map(([command = "", does = ""], at) => [at === 0 ? "Next:" : "", command, does]),
|
|
257
|
-
...has("skill show") ? [["For agents:", `${cli} skill show`, "rules and the discovery loop"]] : []
|
|
258
|
-
];
|
|
259
|
-
const width = widest(rows.map(([, command]) => command)) + 2;
|
|
260
|
-
return ["", ...rows.map(([label, command, does]) => `${label.padEnd(14)}${command.padEnd(width)}${does}`.trimEnd())];
|
|
261
|
-
}, "pointers");
|
|
262
|
-
var firstScreen = /* @__PURE__ */ __name((program, screen = {}) => {
|
|
263
|
-
const cli = program.name();
|
|
264
|
-
const profile = screen.profile !== false;
|
|
265
|
-
const pitch = screen.pitch ?? program.description().split("\n")[0] ?? "";
|
|
266
|
-
const can = (screen.can ?? []).map(({ command, does }) => [command, does]);
|
|
267
|
-
const works = WIRECAT_TOOLS.filter((tool) => tool.command !== cli).map(({ command, shown, does }) => [shown ?? command, does]);
|
|
268
|
-
const column = Math.max(22, widest([...can, ...works].map(([left]) => left))) + 2;
|
|
269
|
-
const start = screen.start ?? (commandAt(program, "setup") ? `${cli} ${EXAMPLE_PROFILE} setup` : void 0);
|
|
270
|
-
return [
|
|
271
|
-
wrapAnsi(`${cli} \u2014 ${pitch}`, WIDTH),
|
|
272
|
-
"",
|
|
273
|
-
`Usage: ${cli} ${profile ? "<profile> " : ""}<command> [options]`,
|
|
274
|
-
...profile ? ["Account commands start with your profile, a name you choose; none is ever assumed."] : [],
|
|
275
|
-
...block("What you can do", can, column),
|
|
276
|
-
...block("Works with", works, column),
|
|
277
|
-
...pointers(program, cli, start, profile),
|
|
278
|
-
""
|
|
279
|
-
].join("\n");
|
|
280
|
-
}, "firstScreen");
|
|
281
|
-
var optionsScreen = /* @__PURE__ */ __name((program) => {
|
|
282
|
-
const helper = program.createHelp();
|
|
283
|
-
const width = helper.longestOptionTermLength(program, helper);
|
|
284
|
-
return [
|
|
285
|
-
`Options for every ${program.name()} command:`,
|
|
286
|
-
...helper.visibleOptions(program).map((option) => helper.formatItem(helper.optionTerm(option), width, helper.optionDescription(option), helper)),
|
|
287
|
-
""
|
|
288
|
-
].join("\n");
|
|
289
|
-
}, "optionsScreen");
|
|
290
|
-
var installHelp = /* @__PURE__ */ __name((program, screen = {}) => {
|
|
291
|
-
let full = false;
|
|
292
|
-
const own = program.configureHelp();
|
|
293
|
-
program.configureHelp({
|
|
294
|
-
...own,
|
|
295
|
-
// Commander copies this configuration to children made with `.command()`, so only the root gets the screen.
|
|
296
|
-
formatHelp: /* @__PURE__ */ __name((command, helper) => command === program && !full ? firstScreen(program, screen) : (own.formatHelp ?? Help.prototype.formatHelp).call(helper, command, helper), "formatHelp")
|
|
297
|
-
});
|
|
298
|
-
installCommandHelp(program, { profile: screen.profile !== false });
|
|
299
|
-
program.addOption(new Option("--help-all", "the full help: every command and option").hideHelp());
|
|
300
|
-
program.on("option:help-all", () => {
|
|
301
|
-
full = true;
|
|
302
|
-
program.help();
|
|
303
|
-
});
|
|
304
|
-
if (program.commands.some((command) => command.name() === "help"))
|
|
305
|
-
return program;
|
|
306
|
-
const help = annotate(new Command("help"), { effects: NO_EFFECTS, mcp: false }).description("this screen; help options: the options for every command; help <command>: that command's help").argument("[topic...]", "options, or a command path").action((topic) => {
|
|
307
|
-
if (topic.length === 0)
|
|
308
|
-
return program.outputHelp();
|
|
309
|
-
if (topic.length === 1 && topic[0] === "options")
|
|
310
|
-
return program.configureOutput().writeOut?.(optionsScreen(program));
|
|
311
|
-
const command = commandAt(program, topic.join(" "));
|
|
312
|
-
if (!command)
|
|
313
|
-
throw new CliError("validation_error", `no command "${topic.join(" ")}" \u2014 run \`${program.name()} help\`, or \`${program.name()} help options\``, { available: program.commands.map((one) => one.name()).filter((name) => name !== "help") });
|
|
314
|
-
command.outputHelp();
|
|
315
|
-
});
|
|
316
|
-
program.addCommand(help, { hidden: true });
|
|
317
|
-
return program;
|
|
318
|
-
}, "installHelp");
|
|
319
|
-
|
|
320
|
-
export {
|
|
321
|
-
firstScreen,
|
|
322
|
-
installHelp
|
|
323
|
-
};
|