@wirecat/wirecat 0.0.0-stage → 1.1.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/LICENSE +204 -0
- package/README.md +399 -2
- package/THIRD_PARTY_NOTICES +2 -0
- package/contracts/wirecat.json +4612 -0
- package/dist/actions/actions.js +269 -0
- package/dist/actions/command.js +102 -0
- package/dist/agents/command.js +17 -0
- package/dist/agents/log.js +23 -0
- package/dist/answer.js +100 -0
- package/dist/answers/command.js +128 -0
- package/dist/app.js +15 -0
- package/dist/author.js +109 -0
- package/dist/bin/wcat-wirecat.js +40 -0
- package/dist/bots/command.js +175 -0
- package/dist/bundle/auto-O24ISPOI.js +43 -0
- package/dist/bundle/chunk-2A3YPENI.js +31 -0
- package/dist/bundle/chunk-6BDIFKF5.js +222 -0
- package/dist/bundle/chunk-7O7XM37N.js +2 -0
- package/dist/bundle/chunk-AYHZY24E.js +120 -0
- package/dist/bundle/chunk-CKBTMZUX.js +72 -0
- package/dist/bundle/chunk-FGXUH3XL.js +416 -0
- package/dist/bundle/chunk-I5JQBRRC.js +807 -0
- package/dist/bundle/chunk-RKVAWMZT.js +38 -0
- package/dist/bundle/chunk-SCDNOUUR.js +395 -0
- package/dist/bundle/chunk-T7TG4JKR.js +312 -0
- package/dist/bundle/chunk-XBUCXQKT.js +51 -0
- package/dist/bundle/entry-EW5A7FYV.js +64 -0
- package/dist/bundle/failure-HMELJ3K5.js +19 -0
- package/dist/bundle/from-memo-F7NTUXAR.js +314 -0
- package/dist/bundle/program-7XWGFN4H.js +14994 -0
- package/dist/bundle/server-T7RVBNRW.js +303 -0
- package/dist/bundle/update-JZDS7B6L.js +22 -0
- package/dist/bundle/wcat-wirecat.js +83 -0
- package/dist/config-command.js +39 -0
- package/dist/config-issues.js +15 -0
- package/dist/config.js +187 -0
- package/dist/context/command.js +162 -0
- package/dist/context/context.js +197 -0
- package/dist/contract-overrides/commands.js +81 -0
- package/dist/contract-overrides/mcp.js +241 -0
- package/dist/contract-overrides/meetings.js +344 -0
- package/dist/contract-overrides/search.js +508 -0
- package/dist/contract-overrides/skill.js +85 -0
- package/dist/contract-overrides.js +7 -0
- package/dist/digest/backfill.js +175 -0
- package/dist/digest/brief.js +189 -0
- package/dist/digest/catch-up-record.js +30 -0
- package/dist/digest/catch-up.js +86 -0
- package/dist/digest/command.js +110 -0
- package/dist/digest/digest-commands.js +327 -0
- package/dist/digest/digest.js +560 -0
- package/dist/digest/digests.js +213 -0
- package/dist/digest/history.js +202 -0
- package/dist/digest/input.js +30 -0
- package/dist/digest/known.js +28 -0
- package/dist/digest/sources.js +155 -0
- package/dist/digest/sync-health.js +158 -0
- package/dist/digest/task-proposals.js +67 -0
- package/dist/digest/tasks.js +145 -0
- package/dist/digest/text.js +49 -0
- package/dist/discovery/command.js +107 -0
- package/dist/doctor/command.js +167 -0
- package/dist/documents/command.js +107 -0
- package/dist/domain-lists/command.js +13 -0
- package/dist/events/command.js +35 -0
- package/dist/events/events.js +196 -0
- package/dist/examples.js +609 -0
- package/dist/facts/command.js +100 -0
- package/dist/facts/fact.js +54 -0
- package/dist/facts/facts.js +15 -0
- package/dist/failure.js +58 -0
- package/dist/finance/command.js +121 -0
- package/dist/finance/contracts-command.js +109 -0
- package/dist/finance/deal-text.js +34 -0
- package/dist/finance/deals-command.js +346 -0
- package/dist/finance/finance.js +129 -0
- package/dist/finance/lines-command.js +70 -0
- package/dist/finance/orders-command.js +94 -0
- package/dist/finance/products-command.js +98 -0
- package/dist/finance/subscriptions-command.js +152 -0
- package/dist/finance/transactions-command.js +136 -0
- package/dist/finance/wallets-command.js +105 -0
- package/dist/finance/written.js +36 -0
- package/dist/findings/command.js +102 -0
- package/dist/findings-input.js +23 -0
- package/dist/identity.js +20 -0
- package/dist/install/postinstall.js +47 -0
- package/dist/json-fields.js +48 -0
- package/dist/knowledge/business-text.js +19 -0
- package/dist/knowledge/command.js +435 -0
- package/dist/knowledge/document-context.js +33 -0
- package/dist/knowledge/key-documents.js +120 -0
- package/dist/knowledge/list-queries.js +20 -0
- package/dist/knowledge/meeting-projects-command.js +61 -0
- package/dist/knowledge/messenger-sync.js +253 -0
- package/dist/knowledge/money-text.js +16 -0
- package/dist/knowledge/notes-about.js +81 -0
- package/dist/knowledge/organization-delete-command.js +44 -0
- package/dist/knowledge/organization-text.js +27 -0
- package/dist/knowledge/project-actions-command.js +130 -0
- package/dist/knowledge/project-actions.js +104 -0
- package/dist/knowledge/project-activity-command.js +70 -0
- package/dist/knowledge/project-context.js +101 -0
- package/dist/knowledge/project-findings.js +41 -0
- package/dist/knowledge/project-gather-command.js +100 -0
- package/dist/knowledge/project-status-command.js +129 -0
- package/dist/knowledge/project-transfer-command.js +58 -0
- package/dist/knowledge/project-transfer.js +107 -0
- package/dist/knowledge/relationships-scan.js +116 -0
- package/dist/knowledge/relationships.js +115 -0
- package/dist/knowledge/roles-command.js +67 -0
- package/dist/mail/command.js +20 -0
- package/dist/mail/findings-command.js +143 -0
- package/dist/mail/findings-duplicates.js +159 -0
- package/dist/mail/messages-command.js +77 -0
- package/dist/mail/review-command.js +59 -0
- package/dist/mail/subscriptions-command.js +84 -0
- package/dist/mcp/catalogue.js +159 -0
- package/dist/mcp/command.js +125 -0
- package/dist/mcp/granted.js +18 -0
- package/dist/mcp/permissions.js +61 -0
- package/dist/mcp/server.js +128 -0
- package/dist/meetings/command.js +31 -0
- package/dist/meetings/list-command.js +59 -0
- package/dist/meetings/preparation-command.js +42 -0
- package/dist/meetings/preparation-text.js +44 -0
- package/dist/meetings/preparation.js +50 -0
- package/dist/meetings/read.js +32 -0
- package/dist/memories/command.js +105 -0
- package/dist/memories/memories.js +17 -0
- package/dist/memories/memory.js +89 -0
- package/dist/memories/sources.js +111 -0
- package/dist/mentions/command.js +91 -0
- package/dist/migrate/check.js +48 -0
- package/dist/migrate/from-memo.js +345 -0
- package/dist/migrate/skill.js +35 -0
- package/dist/models/command.js +19 -0
- package/dist/options.js +35 -0
- package/dist/output.js +17 -0
- package/dist/page.js +14 -0
- package/dist/people/command.js +144 -0
- package/dist/people/delete-command.js +53 -0
- package/dist/people/doubts-command.js +81 -0
- package/dist/people/identities-command.js +188 -0
- package/dist/people/identity.js +42 -0
- package/dist/people/owner.js +14 -0
- package/dist/people/proposal-rows.js +70 -0
- package/dist/people/proposals-command.js +248 -0
- package/dist/people/review-context.js +108 -0
- package/dist/people/subject.js +19 -0
- package/dist/program.js +875 -0
- package/dist/read-only.js +51 -0
- package/dist/reasons.js +368 -0
- package/dist/records/import.js +135 -0
- package/dist/records/input.js +210 -0
- package/dist/records/mapping.js +80 -0
- package/dist/records/record-commands.js +125 -0
- package/dist/records/sources.js +73 -0
- package/dist/refs.js +28 -0
- package/dist/review/command.js +171 -0
- package/dist/review/kinds.js +44 -0
- package/dist/review/review.js +299 -0
- package/dist/review/status.js +93 -0
- package/dist/rows.js +219 -0
- package/dist/run/auto.js +237 -0
- package/dist/run/entry.js +62 -0
- package/dist/run/files.js +51 -0
- package/dist/run/import.js +253 -0
- package/dist/run/lock.js +20 -0
- package/dist/save-help.js +3 -0
- package/dist/schedule/command.js +58 -0
- package/dist/schedule/mail-triage-input.js +152 -0
- package/dist/schedule/task-triage-input.js +152 -0
- package/dist/search/answers.js +176 -0
- package/dist/search/command.js +257 -0
- package/dist/search/denied.js +9 -0
- package/dist/search/embed.js +126 -0
- package/dist/search/hits.js +4 -0
- package/dist/search/lane-gates.js +76 -0
- package/dist/search/notes-text.js +18 -0
- package/dist/search/people.js +88 -0
- package/dist/search/search.js +306 -0
- package/dist/show/command.js +179 -0
- package/dist/store/crm-viewer.js +102 -0
- package/dist/store/group.js +112 -0
- package/dist/store/groups-command.js +136 -0
- package/dist/store/guard.js +94 -0
- package/dist/store/held.js +21 -0
- package/dist/store/info-command.js +37 -0
- package/dist/store/scope.js +53 -0
- package/dist/store/source-list.js +222 -0
- package/dist/store/source-target.js +28 -0
- package/dist/tags/command.js +176 -0
- package/dist/tasks/command.js +174 -0
- package/dist/tasks/context.js +74 -0
- package/dist/tasks/list.js +199 -0
- package/dist/tasks/proposal-duplicates.js +70 -0
- package/dist/tasks/relations-command.js +28 -0
- package/dist/tasks/shared.js +105 -0
- package/dist/tasks/tasks.js +197 -0
- package/dist/templates/command.js +18 -0
- package/dist/terminal.js +23 -0
- package/dist/update.js +35 -0
- package/dist/version.js +2 -0
- package/dist/vocabulary/command.js +103 -0
- package/dist/vocabulary/inspect.js +23 -0
- package/dist/vocabulary/inspection.js +18 -0
- package/dist/vocabulary/list.js +18 -0
- package/dist/vocabulary/project.js +19 -0
- package/dist/wcat.js +3 -0
- package/install/postinstall.mjs +9 -0
- package/package.json +89 -4
- package/scenarios/decision-trail.md +21 -0
- package/scenarios/person-brief.md +35 -0
- package/scenarios/prepare-meeting.md +17 -0
- package/scenarios/project-state.md +26 -0
- package/scenarios/set-up.md +18 -0
- package/scenarios/start-the-day.md +19 -0
- package/skills/mail-triage/SKILL.md +208 -0
- package/skills/morning-digest/SKILL.md +147 -0
- package/skills/task-triage/SKILL.md +79 -0
- package/skills/wcat/SKILL.md +65 -0
- package/skills/wcat/topics/mail.md +32 -0
- package/skills/wcat/topics/mcp.md +22 -0
- package/skills/wcat/topics/meetings.md +37 -0
- package/skills/wcat/topics/money.md +52 -0
- package/skills/wcat/topics/projects.md +54 -0
- package/skills/wcat/topics/proposals.md +113 -0
- package/skills/wcat/topics/search.md +85 -0
- package/skills/wcat/topics/vocabulary.md +8 -0
|
@@ -0,0 +1,312 @@
|
|
|
1
|
+
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
+
const require = __bundleRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
boolean,
|
|
5
|
+
check,
|
|
6
|
+
integer,
|
|
7
|
+
literal,
|
|
8
|
+
looseObject,
|
|
9
|
+
maxLength,
|
|
10
|
+
minLength,
|
|
11
|
+
minValue,
|
|
12
|
+
number,
|
|
13
|
+
optional,
|
|
14
|
+
picklist,
|
|
15
|
+
pipe,
|
|
16
|
+
record,
|
|
17
|
+
regex,
|
|
18
|
+
strictObject,
|
|
19
|
+
string,
|
|
20
|
+
union,
|
|
21
|
+
unknown
|
|
22
|
+
} from "./chunk-I5JQBRRC.js";
|
|
23
|
+
import {
|
|
24
|
+
__name
|
|
25
|
+
} from "./chunk-SCDNOUUR.js";
|
|
26
|
+
|
|
27
|
+
// dist/config.js
|
|
28
|
+
import { CliError as CliError2, configFilePath, resolvePaths, saveConfigFile } from "@wirecat/cli-base";
|
|
29
|
+
import { checkConfigText, DEFAULT_DECISION_POLICY, issueMessage, KEEP_RUNS_FOR_DAYS, KEEP_SUCCESSFUL_RUNS_FOR_DAYS, onThisComputer, RUNS_SIZE_LIMIT_MB, readConfigFile, readConfigText, SCHEDULE_SETTINGS, scheduleLimitsOf, settingPathOf, withoutSetting, withSettingDefaults } from "@wirecat/cli-core";
|
|
30
|
+
import { bulkTriageOf, MAIL_BULK_SETTINGS } from "@wirecat/cli-core/mail";
|
|
31
|
+
|
|
32
|
+
// dist/config-issues.js
|
|
33
|
+
import { knownPermissionKeys } from "@wirecat/cli-core";
|
|
34
|
+
|
|
35
|
+
// dist/search/lane-gates.js
|
|
36
|
+
import { CliError } from "@wirecat/cli-base";
|
|
37
|
+
import { DEAL_KINDS, RESOURCES_SEARCHED } from "@wirecat/cli-core";
|
|
38
|
+
|
|
39
|
+
// dist/mcp/granted.js
|
|
40
|
+
import { levelFor, rootOf } from "@wirecat/cli-core";
|
|
41
|
+
var granted = /* @__PURE__ */ new WeakMap();
|
|
42
|
+
var grantLevels = /* @__PURE__ */ __name((program, levels) => {
|
|
43
|
+
granted.set(program, levels);
|
|
44
|
+
}, "grantLevels");
|
|
45
|
+
var grantedLevel = /* @__PURE__ */ __name((command, key) => {
|
|
46
|
+
const levels = granted.get(rootOf(command));
|
|
47
|
+
return levels === void 0 ? void 0 : levelFor(levels, key).level;
|
|
48
|
+
}, "grantedLevel");
|
|
49
|
+
|
|
50
|
+
// dist/search/lane-gates.js
|
|
51
|
+
var LANE_GATES = [
|
|
52
|
+
{
|
|
53
|
+
lane: "business",
|
|
54
|
+
key: "business.list",
|
|
55
|
+
kinds: {
|
|
56
|
+
invoice: "invoices.list",
|
|
57
|
+
payment: "payments.list",
|
|
58
|
+
order: "orders.list",
|
|
59
|
+
contract: "contracts.list",
|
|
60
|
+
subscription: "subscriptions.list",
|
|
61
|
+
product: "products.list",
|
|
62
|
+
wallet: "wallets.list"
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
{ lane: "crm", key: "crm.list", kinds: { deal: "deals.list", lead: "leads.list" } },
|
|
66
|
+
{ lane: "events", key: "events.list", kinds: { event: "events.list" } },
|
|
67
|
+
// wcat has no tracker commands to key each kind by, and its own projects.list is about wcat's projects: one key.
|
|
68
|
+
{
|
|
69
|
+
lane: "tracker",
|
|
70
|
+
key: "tracker.list",
|
|
71
|
+
kinds: { issue: "tracker.list", issue_comment: "tracker.list", project: "tracker.list" }
|
|
72
|
+
}
|
|
73
|
+
];
|
|
74
|
+
var LANE_KEYS = LANE_GATES.map(({ key }) => key);
|
|
75
|
+
var leftOut = /* @__PURE__ */ __name((lane, what, key) => ({
|
|
76
|
+
code: "permission_error",
|
|
77
|
+
resource: lane,
|
|
78
|
+
reason: `${what} left out: wcat's MCP server denies ${key}`
|
|
79
|
+
}), "leftOut");
|
|
80
|
+
var lanesFor = /* @__PURE__ */ __name((command, asked, denied = []) => {
|
|
81
|
+
const lanes = asked ?? [...RESOURCES_SEARCHED];
|
|
82
|
+
const granted2 = /* @__PURE__ */ __name((key) => grantedLevel(command, key) === "deny", "granted");
|
|
83
|
+
const skipped = [];
|
|
84
|
+
const hidden = /* @__PURE__ */ new Set();
|
|
85
|
+
const off = /* @__PURE__ */ new Set();
|
|
86
|
+
for (const gate of LANE_GATES) {
|
|
87
|
+
if (!lanes.includes(gate.lane))
|
|
88
|
+
continue;
|
|
89
|
+
if (granted2(gate.key)) {
|
|
90
|
+
off.add(gate.lane);
|
|
91
|
+
skipped.push(leftOut(gate.lane, gate.lane, gate.key));
|
|
92
|
+
continue;
|
|
93
|
+
}
|
|
94
|
+
for (const [kind, key] of Object.entries(gate.kinds)) {
|
|
95
|
+
const saved = denied.find((one) => one.kind === kind);
|
|
96
|
+
if (granted2(key)) {
|
|
97
|
+
hidden.add(kind);
|
|
98
|
+
skipped.push(leftOut(gate.lane, kind, key));
|
|
99
|
+
} else if (saved) {
|
|
100
|
+
hidden.add(kind);
|
|
101
|
+
skipped.push({ code: "permission_error", resource: gate.lane, reason: saved.why });
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
if (Object.keys(gate.kinds).every((kind) => hidden.has(kind)))
|
|
105
|
+
off.add(gate.lane);
|
|
106
|
+
}
|
|
107
|
+
const shows = hidden.size ? { shows: /* @__PURE__ */ __name((item) => !hidden.has(item.kind), "shows") } : {};
|
|
108
|
+
const crmKinds = DEAL_KINDS.filter((kind) => !hidden.has(kind));
|
|
109
|
+
const narrowed = crmKinds.length < DEAL_KINDS.length && !off.has("crm") ? { crmKinds } : {};
|
|
110
|
+
if (!off.size)
|
|
111
|
+
return { only: asked, ...narrowed, skipped, ...shows };
|
|
112
|
+
const only = lanes.filter((lane) => !off.has(lane));
|
|
113
|
+
if (!only.length)
|
|
114
|
+
throw new CliError("permission_error", `search all has nothing it may read: ${skipped.map(({ reason }) => reason).join("; ")}`, { reason: "search.all-denied" });
|
|
115
|
+
return { only, ...narrowed, skipped, ...shows };
|
|
116
|
+
}, "lanesFor");
|
|
117
|
+
|
|
118
|
+
// dist/config-issues.js
|
|
119
|
+
var pathOf = /* @__PURE__ */ __name((command) => {
|
|
120
|
+
const words = [];
|
|
121
|
+
for (let at = command; at.parent; at = at.parent)
|
|
122
|
+
words.unshift(at.name());
|
|
123
|
+
return words;
|
|
124
|
+
}, "pathOf");
|
|
125
|
+
var permissionKeyOf = /* @__PURE__ */ __name((command) => pathOf(command).join(".") || null, "permissionKeyOf");
|
|
126
|
+
var memoPermissionKeys = /* @__PURE__ */ __name((program) => knownPermissionKeys(program, permissionKeyOf, ["mcp.authority", ...LANE_KEYS]), "memoPermissionKeys");
|
|
127
|
+
|
|
128
|
+
// dist/config.js
|
|
129
|
+
var ConfigSchema = strictObject({
|
|
130
|
+
permissions: optional(record(string(), picklist(["deny", "readonly", "ask", "allow"]))),
|
|
131
|
+
/** The files CLI's settings from before the split; it copies them on its first start, and wcat reads none of them. */
|
|
132
|
+
notes: optional(looseObject({})),
|
|
133
|
+
auto: optional(strictObject({
|
|
134
|
+
enabled: optional(boolean()),
|
|
135
|
+
every: optional(string()),
|
|
136
|
+
/** WCAT_CONFIG_DIR, MESSAGING_STORE… as they were at `wcat jobs start`, passed to every timer run. */
|
|
137
|
+
places: optional(record(string(), string()))
|
|
138
|
+
})),
|
|
139
|
+
/** `false` keeps only failed runs in `wcat runs list`. `--record` and `--no-record` win. */
|
|
140
|
+
record: optional(boolean()),
|
|
141
|
+
keep_runs_for_days: optional(pipe(number(), integer(), minValue(1))),
|
|
142
|
+
keep_successful_runs_for_days: optional(pipe(number(), integer(), minValue(1))),
|
|
143
|
+
runs_size_limit_mb: optional(pipe(number(), integer(), minValue(1))),
|
|
144
|
+
/** `false` leaves what was typed out of a run's command line, `"failed"` out of a successful one; secrets always. */
|
|
145
|
+
record_input: optional(union([boolean(), literal("failed")])),
|
|
146
|
+
/** `false` stops the once-a-day check for a newer wcat. */
|
|
147
|
+
update_check: optional(boolean()),
|
|
148
|
+
/** `false` stops an agent deciding proposals for you: `projects actions confirm` and `reject` then need you. */
|
|
149
|
+
agent_decisions: optional(boolean()),
|
|
150
|
+
/** `strong` lets an agent's `people link` merge at once on strong evidence; `propose` makes every one wait for you. */
|
|
151
|
+
agent_merges: optional(picklist(["strong", "propose"])),
|
|
152
|
+
/** An agent gated on new mail starts once the oldest waiting email waited this long (`30m`), or this many wait. */
|
|
153
|
+
schedule_mail_wait: optional(pipe(string(), regex(/^\d+[mhd]$/, "has to be a duration such as 30m or 2h"))),
|
|
154
|
+
schedule_mail_batch: optional(pipe(number(), integer(), minValue(1))),
|
|
155
|
+
/** US dollars a day of an agent schedule's runs may cost; 0 turns the cap off. */
|
|
156
|
+
schedule_max_cost_per_day: optional(pipe(number(), minValue(0))),
|
|
157
|
+
/** The model a new agent schedule runs on unless `--model` names one; empty for the harness's own default. */
|
|
158
|
+
schedule_model_claude: optional(string()),
|
|
159
|
+
schedule_model_codex: optional(string()),
|
|
160
|
+
/** `false` lets a new claude agent schedule load your MCP servers, skills, settings and CLAUDE.md. */
|
|
161
|
+
schedule_lean_start: optional(boolean()),
|
|
162
|
+
/** How the mail-triage agent's `review mail --holder` treats bulk mail: newsletters out, the rest as excerpts. */
|
|
163
|
+
mail_bulk_excerpts: optional(boolean()),
|
|
164
|
+
mail_bulk_excerpts_per_read: optional(pipe(number(), integer(), minValue(1))),
|
|
165
|
+
mail_bulk_excerpt_chars: optional(pipe(number(), integer(), minValue(40))),
|
|
166
|
+
mail_bulk_newsletter_score: optional(pipe(number(), integer(), minValue(1))),
|
|
167
|
+
mail_bulk_newsletter_words: optional(string()),
|
|
168
|
+
mail_bulk_newsletter_senders: optional(string()),
|
|
169
|
+
mail_bulk_order_words: optional(string()),
|
|
170
|
+
/** The reader `wcat sources suggest` sends a source's text to, and its model; only the owner picks them. */
|
|
171
|
+
sources: optional(strictObject({
|
|
172
|
+
reader: optional(pipe(string(), minLength(1))),
|
|
173
|
+
model: optional(pipe(string(), minLength(1), maxLength(200))),
|
|
174
|
+
/** Where the Ollama reader is, when not on its own port: an address on this computer only. */
|
|
175
|
+
base_url: optional(pipe(string(), check(onThisComputer, "use an address on this computer")))
|
|
176
|
+
})),
|
|
177
|
+
/** Retired: wcat no longer imports mail, the `mail` CLI does. Still loads so an old config works; doctor names it. */
|
|
178
|
+
mail: optional(unknown())
|
|
179
|
+
});
|
|
180
|
+
var WCAT_SETTINGS = [
|
|
181
|
+
{
|
|
182
|
+
key: "agent_decisions",
|
|
183
|
+
default: DEFAULT_DECISION_POLICY.agentDecisions,
|
|
184
|
+
description: "true lets an agent confirm or reject proposals for you; false keeps every decision yours"
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
key: "agent_merges",
|
|
188
|
+
default: "strong",
|
|
189
|
+
description: `strong: an agent's people link merges at once when the store finds strong evidence; "propose": every one waits for you`
|
|
190
|
+
},
|
|
191
|
+
{ key: "update_check", default: true, description: "check once a day for a newer wcat" },
|
|
192
|
+
{ key: "record", default: true, description: "keep every run in wcat runs list; false keeps failed runs only" },
|
|
193
|
+
{
|
|
194
|
+
key: "record_input",
|
|
195
|
+
default: true,
|
|
196
|
+
description: `keep what was typed in a run's command line: true, false, or "failed" for failed runs only`
|
|
197
|
+
},
|
|
198
|
+
{ key: "keep_runs_for_days", default: KEEP_RUNS_FOR_DAYS, description: "days a run is kept" },
|
|
199
|
+
{
|
|
200
|
+
key: "keep_successful_runs_for_days",
|
|
201
|
+
default: KEEP_SUCCESSFUL_RUNS_FOR_DAYS,
|
|
202
|
+
description: "days a successful run is kept"
|
|
203
|
+
},
|
|
204
|
+
{ key: "runs_size_limit_mb", default: RUNS_SIZE_LIMIT_MB, description: "the most megabytes all runs may take" },
|
|
205
|
+
...SCHEDULE_SETTINGS,
|
|
206
|
+
...MAIL_BULK_SETTINGS
|
|
207
|
+
];
|
|
208
|
+
var configPath = /* @__PURE__ */ __name((env = process.env) => configFilePath(resolvePaths({ appName: "wcat", prefix: "WCAT", env }).config), "configPath");
|
|
209
|
+
var loadConfig = /* @__PURE__ */ __name((env = process.env) => {
|
|
210
|
+
const path = configPath(env);
|
|
211
|
+
const read = readConfigText(path);
|
|
212
|
+
if ("issue" in read)
|
|
213
|
+
throw new CliError2("configuration_error", issueMessage([read.issue], "wcat doctor"));
|
|
214
|
+
if (read.text === void 0)
|
|
215
|
+
return {};
|
|
216
|
+
const { issues, config } = checkConfigText(read.text, { file: path, tool: "wcat", schema: ConfigSchema });
|
|
217
|
+
if (issues.length > 0 || config === void 0)
|
|
218
|
+
throw new CliError2("configuration_error", issueMessage(issues, "wcat doctor"));
|
|
219
|
+
return config;
|
|
220
|
+
}, "loadConfig");
|
|
221
|
+
var decisionPolicy = /* @__PURE__ */ __name((env) => {
|
|
222
|
+
let agentDecisions = false;
|
|
223
|
+
try {
|
|
224
|
+
agentDecisions = loadConfig(env).agent_decisions === true;
|
|
225
|
+
} catch {
|
|
226
|
+
}
|
|
227
|
+
return { ...DEFAULT_DECISION_POLICY, agentDecisions };
|
|
228
|
+
}, "decisionPolicy");
|
|
229
|
+
var agentMergesApply = /* @__PURE__ */ __name((env) => {
|
|
230
|
+
try {
|
|
231
|
+
return loadConfig(env).agent_merges !== "propose";
|
|
232
|
+
} catch {
|
|
233
|
+
return false;
|
|
234
|
+
}
|
|
235
|
+
}, "agentMergesApply");
|
|
236
|
+
var scheduleLimits = /* @__PURE__ */ __name((env) => {
|
|
237
|
+
try {
|
|
238
|
+
return scheduleLimitsOf(loadConfig(env));
|
|
239
|
+
} catch {
|
|
240
|
+
return {};
|
|
241
|
+
}
|
|
242
|
+
}, "scheduleLimits");
|
|
243
|
+
var bulkTriage = /* @__PURE__ */ __name((env) => {
|
|
244
|
+
try {
|
|
245
|
+
return bulkTriageOf(loadConfig(env));
|
|
246
|
+
} catch {
|
|
247
|
+
return bulkTriageOf({});
|
|
248
|
+
}
|
|
249
|
+
}, "bulkTriage");
|
|
250
|
+
var inspectConfig = /* @__PURE__ */ __name((env, program) => {
|
|
251
|
+
const path = configPath(env);
|
|
252
|
+
const read = readConfigText(path);
|
|
253
|
+
if ("issue" in read)
|
|
254
|
+
return { path, found: true, issues: [read.issue], config: {} };
|
|
255
|
+
if (read.text === void 0)
|
|
256
|
+
return { path, found: false, issues: [], config: {} };
|
|
257
|
+
const { issues, config } = checkConfigText(read.text, {
|
|
258
|
+
file: path,
|
|
259
|
+
tool: "wcat",
|
|
260
|
+
schema: ConfigSchema,
|
|
261
|
+
knownPermissions: memoPermissionKeys(program)
|
|
262
|
+
});
|
|
263
|
+
return { path, found: true, issues, config: config ?? {} };
|
|
264
|
+
}, "inspectConfig");
|
|
265
|
+
var unsetConfigKey = /* @__PURE__ */ __name((key, env = process.env) => {
|
|
266
|
+
if (settingPathOf(key).some((part) => part === ""))
|
|
267
|
+
throw new CliError2("validation_error", `${key} is not a setting path`);
|
|
268
|
+
const path = configPath(env);
|
|
269
|
+
const read = readConfigFile(path);
|
|
270
|
+
if ("issue" in read)
|
|
271
|
+
throw new CliError2("configuration_error", issueMessage([read.issue], "wcat doctor"));
|
|
272
|
+
const { config, removed } = withoutSetting(read.raw, key);
|
|
273
|
+
if (removed)
|
|
274
|
+
saveConfigFile(path, config);
|
|
275
|
+
return removed;
|
|
276
|
+
}, "unsetConfigKey");
|
|
277
|
+
var updateConfig = /* @__PURE__ */ __name((change, env = process.env) => {
|
|
278
|
+
const next = change(loadConfig(env));
|
|
279
|
+
saveConfigFile(configPath(env), withSettingDefaults(next, WCAT_SETTINGS).config);
|
|
280
|
+
return next;
|
|
281
|
+
}, "updateConfig");
|
|
282
|
+
var rawConfig = /* @__PURE__ */ __name((env = process.env) => {
|
|
283
|
+
const read = readConfigFile(configPath(env));
|
|
284
|
+
if ("issue" in read)
|
|
285
|
+
throw new CliError2("configuration_error", issueMessage([read.issue], "wcat doctor"));
|
|
286
|
+
return read.raw;
|
|
287
|
+
}, "rawConfig");
|
|
288
|
+
var migrateConfig = /* @__PURE__ */ __name((env = process.env) => {
|
|
289
|
+
const { config, added } = withSettingDefaults(rawConfig(env), WCAT_SETTINGS);
|
|
290
|
+
if (added.length > 0)
|
|
291
|
+
saveConfigFile(configPath(env), config);
|
|
292
|
+
return added;
|
|
293
|
+
}, "migrateConfig");
|
|
294
|
+
|
|
295
|
+
export {
|
|
296
|
+
grantLevels,
|
|
297
|
+
grantedLevel,
|
|
298
|
+
lanesFor,
|
|
299
|
+
memoPermissionKeys,
|
|
300
|
+
WCAT_SETTINGS,
|
|
301
|
+
configPath,
|
|
302
|
+
loadConfig,
|
|
303
|
+
decisionPolicy,
|
|
304
|
+
agentMergesApply,
|
|
305
|
+
scheduleLimits,
|
|
306
|
+
bulkTriage,
|
|
307
|
+
inspectConfig,
|
|
308
|
+
unsetConfigKey,
|
|
309
|
+
updateConfig,
|
|
310
|
+
rawConfig,
|
|
311
|
+
migrateConfig
|
|
312
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
+
const require = __bundleRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
loadConfig
|
|
5
|
+
} from "./chunk-T7TG4JKR.js";
|
|
6
|
+
import {
|
|
7
|
+
APP,
|
|
8
|
+
VERSION,
|
|
9
|
+
__name
|
|
10
|
+
} from "./chunk-SCDNOUUR.js";
|
|
11
|
+
|
|
12
|
+
// dist/update.js
|
|
13
|
+
import { join } from "node:path";
|
|
14
|
+
import { createRenderer, resolvePaths } from "@wirecat/cli-base";
|
|
15
|
+
import { annotate } from "@wirecat/cli-base/commands";
|
|
16
|
+
import { appUpdate, FETCH, overrideSharedContract, upgradeCommand as sharedUpgradeCommand } from "@wirecat/cli-core";
|
|
17
|
+
var PACKAGE = "@wirecat/wirecat";
|
|
18
|
+
var { installer, latest, runUpdate, updateNotice } = appUpdate({
|
|
19
|
+
packageName: PACKAGE,
|
|
20
|
+
command: APP.command,
|
|
21
|
+
version: VERSION,
|
|
22
|
+
entry: new URL("../update.js", import.meta.url).href,
|
|
23
|
+
statePath: /* @__PURE__ */ __name((env) => join(resolvePaths({ appName: APP.appName, prefix: APP.envPrefix, env }).state, "update-check.json"), "statePath"),
|
|
24
|
+
enabled: /* @__PURE__ */ __name((env) => loadConfig(env).update_check !== false, "enabled"),
|
|
25
|
+
// WCAT_AUTO marks the timer's own run, where nobody reads stderr.
|
|
26
|
+
offVariables: ["WCAT_NO_UPDATE_CHECK", "WCAT_AUTO"],
|
|
27
|
+
quietWords: ["--help", "-h", "--version", "-V", "--json", "--quiet", "commands", "upgrade", "mcp", "complete"]
|
|
28
|
+
});
|
|
29
|
+
var upgradeCommand = /* @__PURE__ */ __name((streams, environment = {}) => overrideSharedContract(sharedUpgradeCommand(APP, PACKAGE, (command) => {
|
|
30
|
+
const format = command.opts().json ? "json" : "pretty";
|
|
31
|
+
return {
|
|
32
|
+
renderer: createRenderer({ format, color: false, streams }),
|
|
33
|
+
format,
|
|
34
|
+
streams,
|
|
35
|
+
installer: /* @__PURE__ */ __name(() => installer(environment), "installer"),
|
|
36
|
+
latest: /* @__PURE__ */ __name(() => latest(environment), "latest"),
|
|
37
|
+
install: /* @__PURE__ */ __name((argv) => runUpdate(argv, environment), "install")
|
|
38
|
+
};
|
|
39
|
+
}), "wcat's package updater checks npm and uses command-local JSON because it has no messenger program shell.", (command) => {
|
|
40
|
+
annotate(command, { effects: FETCH });
|
|
41
|
+
command.option("--json", "print JSON");
|
|
42
|
+
}), "upgradeCommand");
|
|
43
|
+
|
|
44
|
+
export {
|
|
45
|
+
PACKAGE,
|
|
46
|
+
installer,
|
|
47
|
+
latest,
|
|
48
|
+
runUpdate,
|
|
49
|
+
updateNotice,
|
|
50
|
+
upgradeCommand
|
|
51
|
+
};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
+
const require = __bundleRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
interactiveOf
|
|
5
|
+
} from "./chunk-2A3YPENI.js";
|
|
6
|
+
import {
|
|
7
|
+
APP,
|
|
8
|
+
__name
|
|
9
|
+
} from "./chunk-SCDNOUUR.js";
|
|
10
|
+
|
|
11
|
+
// dist/run/entry.js
|
|
12
|
+
import { errorObjectOf, exitCodeOfError, processStreams, renderError } from "@wirecat/cli-base";
|
|
13
|
+
var memoEntry = /* @__PURE__ */ __name((io) => {
|
|
14
|
+
const programs = /* @__PURE__ */ new WeakMap();
|
|
15
|
+
let failure;
|
|
16
|
+
return {
|
|
17
|
+
app: APP,
|
|
18
|
+
sqlite: true,
|
|
19
|
+
interactive: interactiveOf,
|
|
20
|
+
reasons: APP.errors.reasons,
|
|
21
|
+
...io === void 0 ? {} : { io },
|
|
22
|
+
run: /* @__PURE__ */ __name(async (entry) => {
|
|
23
|
+
failure = await import("./failure-HMELJ3K5.js");
|
|
24
|
+
const { createProgram, liftGroup, refuseJoinedPath } = await import("./program-7XWGFN4H.js");
|
|
25
|
+
const { autoNotice, followInstall } = await import("./auto-O24ISPOI.js");
|
|
26
|
+
const lifting = createProgram({ signal: entry.signal });
|
|
27
|
+
programs.set(entry, lifting);
|
|
28
|
+
const { group, rest: args } = await liftGroup(lifting, entry.args, entry.env);
|
|
29
|
+
const program = group === void 0 ? lifting : createProgram({ signal: entry.signal, group });
|
|
30
|
+
programs.set(entry, program);
|
|
31
|
+
if (args[0] !== "jobs") {
|
|
32
|
+
const notice2 = autoNotice(entry.env);
|
|
33
|
+
if (notice2)
|
|
34
|
+
processStreams.diagnostic(notice2);
|
|
35
|
+
}
|
|
36
|
+
const { updateNotice } = await import("./update-JZDS7B6L.js");
|
|
37
|
+
const notice = updateNotice(args);
|
|
38
|
+
program.hook("preAction", (_root, command) => entry.atStart(command));
|
|
39
|
+
failure.throwParseFailures(program);
|
|
40
|
+
refuseJoinedPath(program, args);
|
|
41
|
+
await program.parseAsync(args, { from: "user" });
|
|
42
|
+
await followInstall(entry.env).catch(() => void 0);
|
|
43
|
+
const line = await notice;
|
|
44
|
+
if (line && !process.exitCode)
|
|
45
|
+
processStreams.diagnostic(line);
|
|
46
|
+
return void 0;
|
|
47
|
+
}, "run"),
|
|
48
|
+
fail: /* @__PURE__ */ __name((error, entry) => {
|
|
49
|
+
if (failure)
|
|
50
|
+
return failure.reportFailure(error, {
|
|
51
|
+
args: entry.args,
|
|
52
|
+
program: programs.get(entry),
|
|
53
|
+
streams: processStreams,
|
|
54
|
+
tty: entry.tty
|
|
55
|
+
});
|
|
56
|
+
const object = errorObjectOf(error);
|
|
57
|
+
processStreams.diagnostic(renderError(object, { cli: APP.command, interactive: interactiveOf(entry.args, entry.tty) }));
|
|
58
|
+
return exitCodeOfError(object);
|
|
59
|
+
}, "fail")
|
|
60
|
+
};
|
|
61
|
+
}, "memoEntry");
|
|
62
|
+
export {
|
|
63
|
+
memoEntry
|
|
64
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
+
const require = __bundleRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
errorObject,
|
|
5
|
+
mcpFailure,
|
|
6
|
+
recognisable,
|
|
7
|
+
reportFailure,
|
|
8
|
+
throwParseFailures
|
|
9
|
+
} from "./chunk-CKBTMZUX.js";
|
|
10
|
+
import "./chunk-I5JQBRRC.js";
|
|
11
|
+
import "./chunk-2A3YPENI.js";
|
|
12
|
+
import "./chunk-SCDNOUUR.js";
|
|
13
|
+
export {
|
|
14
|
+
errorObject,
|
|
15
|
+
mcpFailure,
|
|
16
|
+
recognisable,
|
|
17
|
+
reportFailure,
|
|
18
|
+
throwParseFailures
|
|
19
|
+
};
|