@wirecat/wirecat 0.0.0-stage → 1.0.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 +400 -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-YETGUQ2J.js +43 -0
- package/dist/bundle/chunk-3ME37WWB.js +31 -0
- package/dist/bundle/chunk-4WI3FO7T.js +395 -0
- package/dist/bundle/chunk-7O7XM37N.js +2 -0
- package/dist/bundle/chunk-DWQQRBQV.js +51 -0
- package/dist/bundle/chunk-FOWR5KJS.js +72 -0
- package/dist/bundle/chunk-GGRL6DTE.js +120 -0
- package/dist/bundle/chunk-KNFSW562.js +312 -0
- package/dist/bundle/chunk-KPJVVFQF.js +416 -0
- package/dist/bundle/chunk-WMPDRWVF.js +222 -0
- package/dist/bundle/chunk-X5OK73GU.js +807 -0
- package/dist/bundle/chunk-ZC4PRE6C.js +38 -0
- package/dist/bundle/entry-S4DSYEAY.js +64 -0
- package/dist/bundle/failure-FALOD7QW.js +19 -0
- package/dist/bundle/from-memo-XVOLSUOM.js +314 -0
- package/dist/bundle/program-XSZSINBU.js +14994 -0
- package/dist/bundle/server-GQ4NZUDL.js +303 -0
- package/dist/bundle/update-2EH5KHTV.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,197 @@
|
|
|
1
|
+
import { CliError } from "@wirecat/cli-base";
|
|
2
|
+
import { parseLocator, storeOnlyDeps, tasksService, WORK_TASK_TYPES, } from "@wirecat/cli-core";
|
|
3
|
+
import { APP } from "../app.js";
|
|
4
|
+
import { authorOf } from "../author.js";
|
|
5
|
+
import { isNoteReference } from "../knowledge/notes-about.js";
|
|
6
|
+
import { refuseBareNumber } from "../refs.js";
|
|
7
|
+
import { heldMessage } from "../store/held.js";
|
|
8
|
+
import { selectAccount } from "../store/scope.js";
|
|
9
|
+
import { canonicalProject } from "../vocabulary/project.js";
|
|
10
|
+
const personRef = (person) => (person.startsWith("person:") ? person : `person:${person}`);
|
|
11
|
+
export const fieldsOf = (options) => ({
|
|
12
|
+
...(options.title === undefined ? {} : { title: options.title }),
|
|
13
|
+
...(options.priority === undefined ? {} : { priority: options.priority }),
|
|
14
|
+
...(options.parent === undefined ? {} : { parent: options.parent }),
|
|
15
|
+
...(options.description === undefined ? {} : { description: options.description }),
|
|
16
|
+
...(options.externalId === undefined ? {} : { externalId: options.externalId }),
|
|
17
|
+
...(options.sourceUrl === undefined ? {} : { sourceUrl: options.sourceUrl }),
|
|
18
|
+
});
|
|
19
|
+
const assignAll = async (store, env, id, people) => {
|
|
20
|
+
for (const person of people ?? [])
|
|
21
|
+
await store.tasks.assign(id, { to: personRef(person), role: "assignee" }, authorOf(env));
|
|
22
|
+
};
|
|
23
|
+
const addToProject = async (store, env, options) => {
|
|
24
|
+
if (options.project === undefined || options.title === undefined)
|
|
25
|
+
throw new CliError("validation_error", "a task without a source needs --project and --title");
|
|
26
|
+
if (options.into !== undefined || options.new)
|
|
27
|
+
throw new CliError("validation_error", "--into and --new are for a task from a source");
|
|
28
|
+
const type = options.type ?? "chore";
|
|
29
|
+
if (!WORK_TASK_TYPES.includes(type))
|
|
30
|
+
throw new CliError("validation_error", `a task in a project is ${WORK_TASK_TYPES.join(", ")}`);
|
|
31
|
+
const task = await store.tasks.create({
|
|
32
|
+
project: await canonicalProject(store, options.project),
|
|
33
|
+
title: options.title,
|
|
34
|
+
...fieldsOf(options),
|
|
35
|
+
type: type,
|
|
36
|
+
...(options.due === undefined || options.due === "none" ? {} : { dueAt: options.due }),
|
|
37
|
+
...(options.status === undefined ? {} : { status: options.status }),
|
|
38
|
+
...(options.agent === undefined ? {} : { agent: options.agent }),
|
|
39
|
+
}, authorOf(env));
|
|
40
|
+
await assignAll(store, env, task.id, options.assignee);
|
|
41
|
+
return store.tasks.details(task.id);
|
|
42
|
+
};
|
|
43
|
+
/** A file from a notes folder names its account, the folder; a note written with `notes add` names none. */
|
|
44
|
+
const folderOf = async (store, source) => {
|
|
45
|
+
const folderId = (await store.notes.resolveNote(source.trim()))?.folderId;
|
|
46
|
+
if (folderId == null)
|
|
47
|
+
return undefined;
|
|
48
|
+
const folder = (await store.accounts.storedAccounts()).find(({ id }) => String(id) === folderId);
|
|
49
|
+
return folder && { provider: folder.provider, account: folder.account };
|
|
50
|
+
};
|
|
51
|
+
const addFromSource = async (store, env, source, options) => {
|
|
52
|
+
if (options.due !== undefined || options.status !== undefined || options.agent !== undefined)
|
|
53
|
+
throw new CliError("validation_error", "--due, --status and --agent are for a task in a project");
|
|
54
|
+
if (options.project !== undefined)
|
|
55
|
+
throw new CliError("validation_error", "a task from a source goes in its account; --project is for one without");
|
|
56
|
+
const type = options.type ?? "request";
|
|
57
|
+
if (WORK_TASK_TYPES.includes(type))
|
|
58
|
+
throw new CliError("validation_error", "a bug, feature or chore has no source: give --project and --title");
|
|
59
|
+
const native = isNoteReference(source.trim());
|
|
60
|
+
const parsed = native ? undefined : parseLocator(source);
|
|
61
|
+
if (parsed &&
|
|
62
|
+
((options.provider && options.provider !== parsed.provider) ||
|
|
63
|
+
(options.account && options.account !== parsed.account)))
|
|
64
|
+
throw new CliError("validation_error", "locator and selected account disagree");
|
|
65
|
+
const key = parsed
|
|
66
|
+
? { provider: parsed.provider, account: parsed.account }
|
|
67
|
+
: ((options.provider === undefined ? await folderOf(store, source) : undefined) ??
|
|
68
|
+
(await selectAccount(store, env, options)));
|
|
69
|
+
if (parsed &&
|
|
70
|
+
parsed.provider !== "notes" &&
|
|
71
|
+
(await heldMessage(store, key, parsed.message, parsed.chat)) === undefined)
|
|
72
|
+
throw new CliError("not_found", "the task source is unavailable or deleted");
|
|
73
|
+
const author = authorOf(env);
|
|
74
|
+
const answer = await tasksService(storeOnlyDeps(store, key, { app: APP, env })).add(source, type, author === "owner" ? "owner" : "agent", undefined, {
|
|
75
|
+
...(options.into === undefined ? {} : { attach: options.into }),
|
|
76
|
+
...(options.new ? { new: true } : {}),
|
|
77
|
+
}, author);
|
|
78
|
+
const fields = fieldsOf(options);
|
|
79
|
+
if (Object.keys(fields).length === 0 && !options.assignee?.length)
|
|
80
|
+
return answer;
|
|
81
|
+
await store.tasks.edit(answer.task.id, fields, "owner");
|
|
82
|
+
await assignAll(store, env, answer.task.id, options.assignee);
|
|
83
|
+
return { ...answer, details: await store.tasks.details(answer.task.id) };
|
|
84
|
+
};
|
|
85
|
+
/** A task in a project when no source is given, otherwise one from the source in its account. */
|
|
86
|
+
export const addTask = async (store, env, source, options) => {
|
|
87
|
+
if (source === undefined)
|
|
88
|
+
return addToProject(store, env, options);
|
|
89
|
+
await refuseBareNumber(store, source, ["note", "document"]);
|
|
90
|
+
return addFromSource(store, env, source, options);
|
|
91
|
+
};
|
|
92
|
+
const checkOf = (revision) => (revision === undefined ? {} : { revision });
|
|
93
|
+
export const closeTask = async (store, env, id, options) => {
|
|
94
|
+
if ((await store.tasks.get(id)) === undefined) {
|
|
95
|
+
const reason = options.reason === undefined ? {} : { reason: options.reason };
|
|
96
|
+
return store.tasks.edit(id, { status: options.as, ...reason }, authorOf(env), checkOf(options.revision));
|
|
97
|
+
}
|
|
98
|
+
if (options.revision !== undefined)
|
|
99
|
+
throw new CliError("validation_error", "--revision checks a project task; a task from a message has none");
|
|
100
|
+
const key = await selectAccount(store, env, options);
|
|
101
|
+
return tasksService(storeOnlyDeps(store, key, { app: APP, env })).close(id, {
|
|
102
|
+
as: options.as,
|
|
103
|
+
by: "owner",
|
|
104
|
+
...(options.reason === undefined ? {} : { reason: options.reason }),
|
|
105
|
+
});
|
|
106
|
+
};
|
|
107
|
+
/**
|
|
108
|
+
* A project task is edited in the store. A task from a message takes its board fields (priority, parent, status,
|
|
109
|
+
* agent, kind, project) in the store too, and the rest through cli-core's plan, which checks the category, refuses a
|
|
110
|
+
* due date on a closed task and resolves `sender`.
|
|
111
|
+
*/
|
|
112
|
+
export const updateTask = async (store, env, id, options) => {
|
|
113
|
+
const fields = fieldsOf(options);
|
|
114
|
+
const times = {
|
|
115
|
+
...(options.due === undefined ? {} : { dueAt: options.due }),
|
|
116
|
+
...(options.remindTime === undefined ? {} : { nextCheckAt: options.remindTime }),
|
|
117
|
+
};
|
|
118
|
+
if (Object.keys(fields).length + Object.keys(times).length === 0 &&
|
|
119
|
+
options.category === undefined &&
|
|
120
|
+
options.assignee === undefined &&
|
|
121
|
+
options.status === undefined &&
|
|
122
|
+
options.agent === undefined &&
|
|
123
|
+
options.project === undefined &&
|
|
124
|
+
options.type === undefined)
|
|
125
|
+
throw new CliError("validation_error", "give --title, --description, --priority, --parent, --due, --remind-time, --category, --assignee, --status, " +
|
|
126
|
+
"--agent, --project or --type");
|
|
127
|
+
if ((await store.tasks.get(id)) === undefined) {
|
|
128
|
+
if (options.category !== undefined || options.assignee !== undefined)
|
|
129
|
+
throw new CliError("validation_error", "--category and --assignee are for a task from a source; name a project task's people with tasks assign");
|
|
130
|
+
return store.tasks.edit(id, {
|
|
131
|
+
...fields,
|
|
132
|
+
...times,
|
|
133
|
+
...(options.status === undefined ? {} : { status: options.status }),
|
|
134
|
+
...(options.agent === undefined ? {} : { agent: options.agent === "none" ? null : options.agent }),
|
|
135
|
+
...(options.project === undefined ? {} : { project: await canonicalProject(store, options.project) }),
|
|
136
|
+
...(options.type === undefined ? {} : { type: options.type }),
|
|
137
|
+
}, authorOf(env), checkOf(options.revision));
|
|
138
|
+
}
|
|
139
|
+
const author = authorOf(env);
|
|
140
|
+
// A found task becomes a bug or a chore only in a project, so a kind given with --project goes with the move.
|
|
141
|
+
const kind = options.type === undefined ? {} : { type: options.type };
|
|
142
|
+
const board = {
|
|
143
|
+
...(options.priority === undefined ? {} : { priority: options.priority }),
|
|
144
|
+
...(options.parent === undefined ? {} : { parent: options.parent }),
|
|
145
|
+
...(options.status === undefined ? {} : { status: options.status }),
|
|
146
|
+
...(options.agent === undefined ? {} : { agent: options.agent === "none" ? null : options.agent }),
|
|
147
|
+
...(options.project === undefined ? kind : {}),
|
|
148
|
+
};
|
|
149
|
+
if (Object.keys(board).length > 0 || options.revision !== undefined)
|
|
150
|
+
await store.tasks.edit(id, board, author, checkOf(options.revision));
|
|
151
|
+
const planned = options.title !== undefined ||
|
|
152
|
+
options.description !== undefined ||
|
|
153
|
+
Object.keys(times).length > 0 ||
|
|
154
|
+
options.category !== undefined ||
|
|
155
|
+
options.assignee !== undefined;
|
|
156
|
+
const plan = planned ? await planFound(store, env, id, options, times) : undefined;
|
|
157
|
+
// Moved last: once in a project, the task is no longer its account's, and the plan above could not reach it.
|
|
158
|
+
if (options.project !== undefined)
|
|
159
|
+
return store.tasks.edit(id, { project: await canonicalProject(store, options.project), ...kind }, author);
|
|
160
|
+
return plan !== undefined && Object.keys(board).length === 0 ? plan : store.tasks.details(id);
|
|
161
|
+
};
|
|
162
|
+
const planFound = async (store, env, id, options, times) => {
|
|
163
|
+
const assignees = options.assignee?.map((one) => (one === "sender" || one === "none" ? one : personRef(one)));
|
|
164
|
+
const key = await selectAccount(store, env, options);
|
|
165
|
+
return tasksService(storeOnlyDeps(store, key, { app: APP, env })).plan(id, {
|
|
166
|
+
...(options.title === undefined ? {} : { title: options.title }),
|
|
167
|
+
...(options.description === undefined ? {} : { description: options.description }),
|
|
168
|
+
...times,
|
|
169
|
+
...(options.category === undefined ? {} : { category: options.category }),
|
|
170
|
+
...(assignees === undefined
|
|
171
|
+
? {}
|
|
172
|
+
: { assignees: assignees.length === 1 && assignees[0] === "none" ? null : assignees }),
|
|
173
|
+
}, authorOf(env) === "owner" ? "owner" : "agent");
|
|
174
|
+
};
|
|
175
|
+
export const assignTask = (store, env, id, person, role, revision) => store.tasks.assign(id, { to: personRef(person), role }, authorOf(env), checkOf(revision));
|
|
176
|
+
export const unassignTask = (store, env, id, person, role, revision) => store.tasks.unassign(id, { to: personRef(person), role }, authorOf(env), checkOf(revision));
|
|
177
|
+
/** The task in its new place; `label.changed` says a move across a band edge changed its priority's label. */
|
|
178
|
+
export const moveTask = (store, env, id, options) => {
|
|
179
|
+
const { revision, ...move } = options;
|
|
180
|
+
return store.tasks.move(id, move, authorOf(env), checkOf(revision));
|
|
181
|
+
};
|
|
182
|
+
/** Who changed what and when, oldest first; `by` names the person or agent as the store knows it now. */
|
|
183
|
+
export const commentTask = (store, env, id, text) => store.tasks.comment(id, text, authorOf(env));
|
|
184
|
+
export const taskHistory = async (store, id) => {
|
|
185
|
+
const owner = (await store.people.owner())?.uid;
|
|
186
|
+
return (await store.tasks.events(id)).map((event) => ({
|
|
187
|
+
at: event.at,
|
|
188
|
+
kind: event.kind,
|
|
189
|
+
by: event.actor && {
|
|
190
|
+
ref: `${event.actor.type}:${event.actor.id}`,
|
|
191
|
+
name: event.actor.name,
|
|
192
|
+
owner: event.actor.type === "person" && String(event.actor.id) === String(owner),
|
|
193
|
+
},
|
|
194
|
+
changes: event.changes,
|
|
195
|
+
}));
|
|
196
|
+
};
|
|
197
|
+
//# sourceMappingURL=tasks.js.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { overrideSharedContract, templatesCommand as sharedTemplatesCommand } from "@wirecat/cli-core";
|
|
2
|
+
import { answers } from "../answer.js";
|
|
3
|
+
import { APP } from "../app.js";
|
|
4
|
+
/** cli-core's `templates`: the owner's own digest templates in the shared store; `edit` and `reset` are his alone. */
|
|
5
|
+
export const templatesCommand = (program, streams, env) => {
|
|
6
|
+
const { print } = answers(program, streams, env);
|
|
7
|
+
const templates = sharedTemplatesCommand(APP, {
|
|
8
|
+
env: () => env,
|
|
9
|
+
output: (body, command) => print(command.optsWithGlobals().json, body),
|
|
10
|
+
diagnostic: (line) => streams.diagnostic(line),
|
|
11
|
+
});
|
|
12
|
+
for (const one of templates.commands)
|
|
13
|
+
overrideSharedContract(one, "wcat's output flag is command-local because this provider does not use the messenger program shell.", (command) => {
|
|
14
|
+
command.option("--json", "print JSON");
|
|
15
|
+
});
|
|
16
|
+
program.addCommand(templates);
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=command.js.map
|
package/dist/terminal.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
const MACHINE_FLAGS = new Set(["--json", "--jsonl"]);
|
|
2
|
+
export const optionsOf = (args) => {
|
|
3
|
+
const end = args.indexOf("--");
|
|
4
|
+
return end < 0 ? args : args.slice(0, end);
|
|
5
|
+
};
|
|
6
|
+
/** A person at a terminal who did not ask for machine output. */
|
|
7
|
+
export const interactiveOf = (args, tty) => tty && !optionsOf(args).some((flag) => MACHINE_FLAGS.has(flag));
|
|
8
|
+
const terminals = new WeakMap();
|
|
9
|
+
let processTerminal = () => ({ present: Boolean(process.stdin.isTTY && process.stdout.isTTY) });
|
|
10
|
+
/** The test sandbox's: a suite's runs stand for the owner at a terminal unless a test hands in another. */
|
|
11
|
+
export const assumeTerminal = (terminal) => {
|
|
12
|
+
processTerminal = () => terminal;
|
|
13
|
+
};
|
|
14
|
+
export const provideTerminal = (program, terminal) => {
|
|
15
|
+
terminals.set(program, terminal ?? processTerminal());
|
|
16
|
+
};
|
|
17
|
+
export const terminalOf = (command) => {
|
|
18
|
+
let root = command;
|
|
19
|
+
while (root.parent)
|
|
20
|
+
root = root.parent;
|
|
21
|
+
return terminals.get(root) ?? { present: false };
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=terminal.js.map
|
package/dist/update.js
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { join } from "node:path";
|
|
2
|
+
import { createRenderer, resolvePaths } from "@wirecat/cli-base";
|
|
3
|
+
import { annotate } from "@wirecat/cli-base/commands";
|
|
4
|
+
import { appUpdate, FETCH, overrideSharedContract, upgradeCommand as sharedUpgradeCommand, } from "@wirecat/cli-core";
|
|
5
|
+
import { APP } from "./app.js";
|
|
6
|
+
import { loadConfig } from "./config.js";
|
|
7
|
+
import { VERSION } from "./version.js";
|
|
8
|
+
export const PACKAGE = "@wirecat/wirecat";
|
|
9
|
+
export const { installer, latest, runUpdate, updateNotice } = appUpdate({
|
|
10
|
+
packageName: PACKAGE,
|
|
11
|
+
command: APP.command,
|
|
12
|
+
version: VERSION,
|
|
13
|
+
entry: import.meta.url,
|
|
14
|
+
statePath: (env) => join(resolvePaths({ appName: APP.appName, prefix: APP.envPrefix, env }).state, "update-check.json"),
|
|
15
|
+
enabled: (env) => loadConfig(env).update_check !== false,
|
|
16
|
+
// WCAT_AUTO marks the timer's own run, where nobody reads stderr.
|
|
17
|
+
offVariables: ["WCAT_NO_UPDATE_CHECK", "WCAT_AUTO"],
|
|
18
|
+
quietWords: ["--help", "-h", "--version", "-V", "--json", "--quiet", "commands", "upgrade", "mcp", "complete"],
|
|
19
|
+
});
|
|
20
|
+
/** cli-core's `upgrade`: the package manager that installed wcat, or only a look with `--check`. */
|
|
21
|
+
export const upgradeCommand = (streams, environment = {}) => overrideSharedContract(sharedUpgradeCommand(APP, PACKAGE, (command) => {
|
|
22
|
+
const format = command.opts().json ? "json" : "pretty";
|
|
23
|
+
return {
|
|
24
|
+
renderer: createRenderer({ format, color: false, streams }),
|
|
25
|
+
format,
|
|
26
|
+
streams,
|
|
27
|
+
installer: () => installer(environment),
|
|
28
|
+
latest: () => latest(environment),
|
|
29
|
+
install: (argv) => runUpdate(argv, environment),
|
|
30
|
+
};
|
|
31
|
+
}), "wcat's package updater checks npm and uses command-local JSON because it has no messenger program shell.", (command) => {
|
|
32
|
+
annotate(command, { effects: FETCH });
|
|
33
|
+
command.option("--json", "print JSON");
|
|
34
|
+
});
|
|
35
|
+
//# sourceMappingURL=update.js.map
|
package/dist/version.js
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { CliError } from "@wirecat/cli-base";
|
|
2
|
+
import { annotate } from "@wirecat/cli-base/commands";
|
|
3
|
+
import { LOCAL_READ, LOCAL_WRITE, withQuery, } from "@wirecat/cli-core";
|
|
4
|
+
import { answers, itemAnswer } from "../answer.js";
|
|
5
|
+
import { oneOf, positive } from "../options.js";
|
|
6
|
+
import { addVocabularyInspection } from "./inspect.js";
|
|
7
|
+
import { VOCABULARY_QUERY, vocabularyFilter } from "./list.js";
|
|
8
|
+
const kinds = ["project", "tag", "topic"];
|
|
9
|
+
const targetOf = (reference) => {
|
|
10
|
+
const match = reference.match(/^(project|tag|topic):([1-9]\d*)$/);
|
|
11
|
+
if (!match)
|
|
12
|
+
throw new CliError("validation_error", "choose project:<id>, tag:<id> or topic:<id> from vocabulary list");
|
|
13
|
+
return { kind: match[1], id: match[2] };
|
|
14
|
+
};
|
|
15
|
+
export const vocabularyCommand = (program, streams, env) => {
|
|
16
|
+
const vocabulary = program
|
|
17
|
+
.command("vocabulary")
|
|
18
|
+
.description("canonical projects, tags and topics with explicit aliases");
|
|
19
|
+
const { run } = answers(program, streams, env);
|
|
20
|
+
addVocabularyInspection(vocabulary, program, streams, env);
|
|
21
|
+
const execute = (options, work) => run(options.json, async (store) => itemAnswer(await work(store)));
|
|
22
|
+
const budgetOptions = (command) => command
|
|
23
|
+
.option("--max-entries <n>", "catalog input budget, not a page size", positive)
|
|
24
|
+
.option("--max-read-bytes <bytes>", "catalog input byte budget", positive)
|
|
25
|
+
.option("--json", "print JSON; --json=id,title keeps only those fields");
|
|
26
|
+
const readOptions = (command) => budgetOptions(command
|
|
27
|
+
.option("--kind <kind>", "project, tag or topic", oneOf(kinds))
|
|
28
|
+
.option("--scope <scope>", "personal or work projects", oneOf(["personal", "work"])));
|
|
29
|
+
const catalogOptions = (options) => ({
|
|
30
|
+
...(options.kind === undefined ? {} : { kind: options.kind }),
|
|
31
|
+
...(options.scope === undefined ? {} : { scope: options.scope }),
|
|
32
|
+
...(options.maxEntries === undefined ? {} : { maxEntries: options.maxEntries }),
|
|
33
|
+
...(options.maxReadBytes === undefined ? {} : { maxReadBytes: options.maxReadBytes }),
|
|
34
|
+
});
|
|
35
|
+
budgetOptions(withQuery(annotate(vocabulary.command("list"), { effects: LOCAL_READ, output: { entity: "vocabulary" } }).description("list canonical IDs, aliases, usage counts and a preview fingerprint"), VOCABULARY_QUERY)).action((words, options) => execute(options, (store) => store.knowledge.vocabulary({ ...catalogOptions(options), ...vocabularyFilter(words, "vocabulary list") })));
|
|
36
|
+
readOptions(annotate(vocabulary.command("show"), { effects: LOCAL_READ })
|
|
37
|
+
.argument("<name>", "the name or alias to look up, exactly")
|
|
38
|
+
.description("the project, tag or topic an exact name or alias names; ambiguity is reported")).action((name, options) => execute(options, (store) => store.knowledge.resolveVocabulary(name, catalogOptions(options))));
|
|
39
|
+
readOptions(annotate(vocabulary.command("check"), { effects: LOCAL_READ })
|
|
40
|
+
.argument("[name]", "a tag or topic you mean to create; without it, the whole vocabulary")
|
|
41
|
+
.summary("check a new name for existing labels, or the vocabulary for likely synonyms")
|
|
42
|
+
.description("check a new name for an existing label or likely duplicates before vocabulary create, or without a name " +
|
|
43
|
+
"the whole vocabulary for likely synonyms. It merges and creates nothing"))
|
|
44
|
+
.option("--min-similarity <n>", "without a name: minimum lexical similarity, 0.65–1", Number)
|
|
45
|
+
.option("--max-comparisons <n>", "without a name: most name comparisons", positive)
|
|
46
|
+
.option("--limit <n>", "without a name: most candidate pairs", positive)
|
|
47
|
+
.action((name, options) => execute(options, (store) => {
|
|
48
|
+
if (name === undefined)
|
|
49
|
+
return store.knowledge.auditVocabulary({
|
|
50
|
+
...catalogOptions(options),
|
|
51
|
+
...(options.minSimilarity === undefined ? {} : { minSimilarity: options.minSimilarity }),
|
|
52
|
+
...(options.maxComparisons === undefined ? {} : { maxComparisons: options.maxComparisons }),
|
|
53
|
+
...(options.limit === undefined ? {} : { limit: options.limit }),
|
|
54
|
+
});
|
|
55
|
+
if (options.kind === "project" || options.scope !== undefined)
|
|
56
|
+
throw new CliError("validation_error", "a new name is a tag or topic: --kind tag or --kind topic, no --scope");
|
|
57
|
+
if (options.minSimilarity !== undefined ||
|
|
58
|
+
options.maxComparisons !== undefined ||
|
|
59
|
+
options.limit !== undefined)
|
|
60
|
+
throw new CliError("validation_error", "--min-similarity, --max-comparisons and --limit check the whole vocabulary: leave out the name");
|
|
61
|
+
return store.knowledge.tagPreflight(name, {
|
|
62
|
+
...(options.kind === undefined ? {} : { kind: options.kind }),
|
|
63
|
+
...(options.maxEntries === undefined ? {} : { maxEntries: options.maxEntries }),
|
|
64
|
+
...(options.maxReadBytes === undefined ? {} : { maxReadBytes: options.maxReadBytes }),
|
|
65
|
+
});
|
|
66
|
+
}));
|
|
67
|
+
annotate(vocabulary.command("create"), { effects: LOCAL_WRITE })
|
|
68
|
+
.argument("<name>", "the new tag or topic")
|
|
69
|
+
.description("owner: create a distinct tag or topic after vocabulary check <name>")
|
|
70
|
+
.option("--kind <kind>", "tag or topic", oneOf(["tag", "topic"]))
|
|
71
|
+
.requiredOption("--fingerprint <hash>", "the creation_fingerprint vocabulary check <name> gave")
|
|
72
|
+
.option("--json", "print JSON; --json=id,title keeps only those fields")
|
|
73
|
+
.action((name, options) => execute(options, (store) => store.knowledge.createTag(name, {
|
|
74
|
+
by: "owner",
|
|
75
|
+
...(options.kind === undefined ? {} : { kind: options.kind }),
|
|
76
|
+
expectedCreationFingerprint: options.fingerprint,
|
|
77
|
+
})));
|
|
78
|
+
const aliases = vocabulary.command("aliases").description("owner-reviewed aliases on stable canonical IDs");
|
|
79
|
+
annotate(aliases.command("add"), { effects: LOCAL_WRITE })
|
|
80
|
+
.description("owner: add another name for a project, tag or topic")
|
|
81
|
+
.argument("<reference>", "project:<id>, tag:<id> or topic:<id>, from vocabulary list")
|
|
82
|
+
.argument("<name>", "the other name")
|
|
83
|
+
.requiredOption("--fingerprint <hash>", "the current vocabulary preview fingerprint")
|
|
84
|
+
.option("--json", "print JSON; --json=id,title keeps only those fields")
|
|
85
|
+
.action((reference, name, options) => {
|
|
86
|
+
const target = targetOf(reference);
|
|
87
|
+
return execute(options, (store) => store.knowledge.addVocabularyAlias(target, name, { by: "owner", expectedFingerprint: options.fingerprint }));
|
|
88
|
+
});
|
|
89
|
+
annotate(aliases.command("remove"), { effects: LOCAL_WRITE })
|
|
90
|
+
.description("owner: remove another name from a project, tag or topic")
|
|
91
|
+
.argument("<reference>", "project:<id>, tag:<id> or topic:<id>, from vocabulary list")
|
|
92
|
+
.argument("<alias-id>", "the alias's id, from vocabulary list")
|
|
93
|
+
.requiredOption("--fingerprint <hash>", "the current vocabulary preview fingerprint")
|
|
94
|
+
.option("--json", "print JSON; --json=id,title keeps only those fields")
|
|
95
|
+
.action((reference, aliasId, options) => {
|
|
96
|
+
const target = targetOf(reference);
|
|
97
|
+
return execute(options, (store) => store.knowledge.removeVocabularyAlias(target, aliasId, {
|
|
98
|
+
by: "owner",
|
|
99
|
+
expectedFingerprint: options.fingerprint,
|
|
100
|
+
}));
|
|
101
|
+
});
|
|
102
|
+
};
|
|
103
|
+
//# sourceMappingURL=command.js.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { annotate } from "@wirecat/cli-base/commands";
|
|
2
|
+
import { LOCAL_READ } from "@wirecat/cli-core";
|
|
3
|
+
import { answers, itemAnswer } from "../answer.js";
|
|
4
|
+
import { positive } from "../options.js";
|
|
5
|
+
import { tagInspectionOptions } from "./inspection.js";
|
|
6
|
+
export const addVocabularyInspection = (parent, program, streams, env) => {
|
|
7
|
+
const { run } = answers(program, streams, env);
|
|
8
|
+
annotate(parent.command("inspect"), { effects: LOCAL_READ, output: { entity: "vocabulary_inspection" } })
|
|
9
|
+
.argument("<source>", "the duplicate tag:<id> to inspect, from vocabulary list")
|
|
10
|
+
.argument("<survivor>", "the canonical tag:<id> you would keep; nothing is merged")
|
|
11
|
+
.description("preview two tags' assignments, aliases, automatic claims and links before consolidation; writes and merges nothing")
|
|
12
|
+
.summary("inspect two tags before consolidation, without merging them")
|
|
13
|
+
.requiredOption("--fingerprint <hash>", "the current fingerprint from unfiltered vocabulary list")
|
|
14
|
+
.option("--max-rows <n>", "dependency row budget, 1–20000 (default 5000)", positive)
|
|
15
|
+
.option("--max-read-bytes <bytes>", "dependency byte budget, 1–16777216 (default 1048576)", positive)
|
|
16
|
+
.option("--limit <n>", "samples per table, 1–100 (default 10); counts remain complete", positive)
|
|
17
|
+
.option("--json", "print the standard JSON answer")
|
|
18
|
+
.action((source, survivor, options) => {
|
|
19
|
+
const input = tagInspectionOptions({ source, survivor, ...options });
|
|
20
|
+
return run(options.json, async (store) => itemAnswer(await store.knowledge.previewTagConsolidation(input)));
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=inspect.js.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { CliError } from "@wirecat/cli-base";
|
|
2
|
+
export const tagInspectionOptions = (input) => {
|
|
3
|
+
const id = (reference, field) => {
|
|
4
|
+
const match = reference.match(/^tag:([1-9]\d*)$/);
|
|
5
|
+
if (!match || !Number.isSafeInteger(Number(match[1])))
|
|
6
|
+
throw new CliError("validation_error", `${field} must be tag:<id> from vocabulary list`);
|
|
7
|
+
return match[1];
|
|
8
|
+
};
|
|
9
|
+
return {
|
|
10
|
+
sourceId: id(input.source, "source"),
|
|
11
|
+
survivorId: id(input.survivor, "survivor"),
|
|
12
|
+
expectedVocabularyFingerprint: input.fingerprint,
|
|
13
|
+
...(input.maxRows === undefined ? {} : { maxRows: input.maxRows }),
|
|
14
|
+
...(input.maxReadBytes === undefined ? {} : { maxReadBytes: input.maxReadBytes }),
|
|
15
|
+
...(input.limit === undefined ? {} : { sampleLimit: input.limit }),
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=inspection.js.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { queryTerms, termField } from "@wirecat/cli-core";
|
|
2
|
+
export const VOCABULARY_QUERY = {
|
|
3
|
+
entity: "vocabulary",
|
|
4
|
+
backend: "native",
|
|
5
|
+
fields: [
|
|
6
|
+
termField("kind", "enum", "kind:tag", { values: ["project", "tag", "topic"] }),
|
|
7
|
+
termField("scope", "enum", "scope:work", { values: ["personal", "work"] }),
|
|
8
|
+
],
|
|
9
|
+
};
|
|
10
|
+
/** The catalog's kind and scope from a query; the store reads only those rows. */
|
|
11
|
+
export const vocabularyFilter = (query, command) => {
|
|
12
|
+
const terms = queryTerms(query, VOCABULARY_QUERY, command);
|
|
13
|
+
return {
|
|
14
|
+
...(terms.has("kind") ? { kind: terms.get("kind") } : {}),
|
|
15
|
+
...(terms.has("scope") ? { scope: terms.get("scope") } : {}),
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=list.js.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { CliError } from "@wirecat/cli-base";
|
|
2
|
+
export const canonicalProject = async (store, reference, limits = {}) => {
|
|
3
|
+
if (/^project:[1-9]\d*$/.test(reference)) {
|
|
4
|
+
const catalog = await store.knowledge.vocabulary({ kind: "project", ...limits });
|
|
5
|
+
if (!catalog.entries.some((entry) => entry.id === reference.slice(8)))
|
|
6
|
+
throw new CliError("not_found", "the owner project is unavailable");
|
|
7
|
+
return reference;
|
|
8
|
+
}
|
|
9
|
+
const found = await store.knowledge.resolveVocabulary(reference, { kind: "project", ...limits });
|
|
10
|
+
if (found.matches.length !== 1)
|
|
11
|
+
throw new CliError(found.matches.length ? "validation_error" : "not_found", found.matches.length
|
|
12
|
+
? `${reference} names ${found.matches.length} projects; give one by its key, as wcat vocabulary show ${reference} lists them`
|
|
13
|
+
: `no project ${reference}; wcat projects list shows yours, wcat projects add creates one`, { candidates: found.matches.map((entry) => ({ id: entry.id, key: entry.key, name: entry.name })) });
|
|
14
|
+
const entry = found.matches[0];
|
|
15
|
+
if (!entry)
|
|
16
|
+
throw new CliError("not_found", "the owner project is unavailable");
|
|
17
|
+
return `project:${entry.id}`;
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=project.js.map
|
package/dist/wcat.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
if (process.env.npm_config_global === "true") {
|
|
2
|
+
try {
|
|
3
|
+
const { completeGlobalInstall } = await import("../dist/install/postinstall.js")
|
|
4
|
+
completeGlobalInstall()
|
|
5
|
+
} catch (error) {
|
|
6
|
+
process.stderr.write(`wcat installation incomplete: ${error instanceof Error ? error.message : String(error)}\n`)
|
|
7
|
+
process.exitCode = 1
|
|
8
|
+
}
|
|
9
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,91 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wirecat/wirecat",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Local context for AI agents across messengers, mail and notes, from a local store",
|
|
5
|
+
"mcpName": "dev.wirecat/wirecat",
|
|
6
|
+
"license": "Apache-2.0",
|
|
7
|
+
"author": "Viacheslav Ptsarev",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/WireCatLabs/wirecat.git"
|
|
11
|
+
},
|
|
12
|
+
"type": "module",
|
|
13
|
+
"engines": {
|
|
14
|
+
"node": "^22.16.0 || >=24"
|
|
15
|
+
},
|
|
16
|
+
"packageManager": "pnpm@11.28.8",
|
|
17
|
+
"bin": {
|
|
18
|
+
"wcat-wirecat": "dist/bin/wcat-wirecat.js"
|
|
19
|
+
},
|
|
20
|
+
"files": [
|
|
21
|
+
"dist",
|
|
22
|
+
"contracts/wirecat.json",
|
|
23
|
+
"scenarios",
|
|
24
|
+
"skills",
|
|
25
|
+
"install",
|
|
26
|
+
"README.md",
|
|
27
|
+
"LICENSE",
|
|
28
|
+
"THIRD_PARTY_NOTICES"
|
|
29
|
+
],
|
|
30
|
+
"scripts": {
|
|
31
|
+
"build": "tsc --build --force && cli-dev bundle --bin dist/bin/wcat-wirecat.js",
|
|
32
|
+
"typecheck": "tsc --build --force --emitDeclarationOnly && tsc -p tsconfig.test.json",
|
|
33
|
+
"lint": "biome check .",
|
|
34
|
+
"lint:fix": "biome check --write .",
|
|
35
|
+
"test": "vitest run",
|
|
36
|
+
"test:watch": "vitest",
|
|
37
|
+
"test:coverage": "vitest run --coverage",
|
|
38
|
+
"lint:commands": "node --experimental-strip-types scripts/sandboxed.ts cli-dev lint --cli dist/bin/wcat-wirecat.js --budget 32",
|
|
39
|
+
"release:check": "cli-dev changelog level && pnpm lint && pnpm typecheck && pnpm test && pnpm build && node --experimental-strip-types scripts/commands.ts --check && pnpm lint:commands && pnpm secrets:scan",
|
|
40
|
+
"prepare": "lefthook install || true",
|
|
41
|
+
"postinstall": "node install/postinstall.mjs",
|
|
42
|
+
"secrets:scan": "gitleaks git --no-banner --redact .",
|
|
43
|
+
"prepublishOnly": "pnpm build",
|
|
44
|
+
"standards:check": "node config/wirecat/check.mjs",
|
|
45
|
+
"generate": "pnpm build && node --experimental-strip-types scripts/commands.ts && cli-dev manifest --program dist/program.js --identity dist/wcat.js",
|
|
46
|
+
"generate:check": "pnpm build && node --experimental-strip-types scripts/commands.ts --check && cli-dev manifest --program dist/program.js --identity dist/wcat.js --check",
|
|
47
|
+
"docs:lint": "markdownlint-cli2",
|
|
48
|
+
"docs:spell": "cspell lint --config cspell.json --no-progress README.md \"docs/*.md\"",
|
|
49
|
+
"ci:quick": "pnpm typecheck && pnpm build && pnpm lint:commands",
|
|
50
|
+
"contracts:check": "cli-contract contracts/plan.json",
|
|
51
|
+
"contracts:upgrade": "cli-contract contracts/upgrade.json",
|
|
52
|
+
"security:no-leak": "cli-testing security no-leak . contracts/no-leak.json",
|
|
53
|
+
"version:check": "cli-dev version",
|
|
54
|
+
"version:sync": "cli-dev version --sync",
|
|
55
|
+
"package:check": "node --experimental-strip-types scripts/package-check.ts",
|
|
56
|
+
"docs:check": "cli-dev docs-check --rules scripts/docs-rules.ts --pages && node --experimental-strip-types scripts/changelog-fragments.ts --rules scripts/docs-rules.ts && cspell --no-progress --no-summary README.md 'docs/*.md' && pnpm docs:lint",
|
|
57
|
+
"test:matrix:check": "cli-dev test-matrix --program scripts/command-program.ts --untested scripts/test-matrix-untested.ts --name wcat --check && git diff --exit-code -- docs/dev/test-matrix.md",
|
|
58
|
+
"test:matrix": "vitest run >/dev/null && pnpm build >/dev/null && pnpm test:matrix:check",
|
|
59
|
+
"smoke:bun": "bun scripts/smoke.ts && bun scripts/smoke-bundle.ts",
|
|
60
|
+
"smoke:node": "node --experimental-strip-types scripts/smoke-bundle.ts"
|
|
61
|
+
},
|
|
62
|
+
"dependencies": {
|
|
63
|
+
"@modelcontextprotocol/server": "2.4.0",
|
|
64
|
+
"@wirecat/cli-base": "2.1.0",
|
|
65
|
+
"@wirecat/cli-core": "3.0.0",
|
|
66
|
+
"commander": "15.0.0",
|
|
67
|
+
"valibot": "1.5.0"
|
|
68
|
+
},
|
|
69
|
+
"devDependencies": {
|
|
70
|
+
"@biomejs/biome": "2.6.3",
|
|
71
|
+
"@cspell/dict-en-gb": "5.0.38",
|
|
72
|
+
"@cspell/dict-es-es": "3.0.9",
|
|
73
|
+
"@cspell/dict-ru_ru": "2.3.4",
|
|
74
|
+
"@huggingface/tokenizers": "0.2.0",
|
|
75
|
+
"@modelcontextprotocol/client": "2.3.0",
|
|
76
|
+
"@types/node": "^22.20.5",
|
|
77
|
+
"@vitest/coverage-v8": "5.0.5",
|
|
78
|
+
"@wirecat/cli-core-onnx": "1.2.0",
|
|
79
|
+
"@wirecat/cli-testing": "0.7.0",
|
|
80
|
+
"cspell": "10.4.0",
|
|
81
|
+
"esbuild": "0.28.2",
|
|
82
|
+
"lefthook": "2.2.2",
|
|
83
|
+
"markdownlint-cli2": "0.24.0",
|
|
84
|
+
"onnxruntime-common": "1.30.0",
|
|
85
|
+
"typescript": "^7.0.2",
|
|
86
|
+
"vitest": "^5.0.5"
|
|
87
|
+
},
|
|
88
|
+
"publishConfig": {
|
|
89
|
+
"access": "public"
|
|
90
|
+
}
|
|
91
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: What did we decide about X, across every source
|
|
3
|
+
goal: Find the decision on one topic and the evidence for it in notes, mail, messages, meetings and documents, then record it once.
|
|
4
|
+
steps:
|
|
5
|
+
- run: wcat facts list kind:decision project:HRB
|
|
6
|
+
why: decisions already recorded for the project, each with the evidence it cites
|
|
7
|
+
- run: wcat search all venue
|
|
8
|
+
why: messages, mail and notes that mention the topic, ranked together
|
|
9
|
+
- run: wcat search meetings venue
|
|
10
|
+
why: what was said about it in meetings, with the passage to cite
|
|
11
|
+
- run: drive personal search venue
|
|
12
|
+
why: Drive documents about it
|
|
13
|
+
- run: wcat answers create "what did we decide about the venue?" --all
|
|
14
|
+
why: the cited evidence in one bundle, for you or your agent to read
|
|
15
|
+
- run: wcat facts add "The team day is at the harbour venue" --kind decision --evidence msg:telegram/1/77/42 --project HRB
|
|
16
|
+
why: keep the decision with its source, so the next search finds it first
|
|
17
|
+
look:
|
|
18
|
+
- the newest decision and who made it
|
|
19
|
+
- later messages or meetings that reverse it
|
|
20
|
+
- whether the recorded decision cites the source you found
|
|
21
|
+
---
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: One person across every tool
|
|
3
|
+
goal: Know everything about one person before a call — messages in tg, MAX and WhatsApp, mail, phone calls, notes, meetings, CRM deals and Drive documents — with a source for each line.
|
|
4
|
+
steps:
|
|
5
|
+
- run: wcat context telegram:Kai
|
|
6
|
+
why: their messages, mail, notes and open tasks in one answer, each with a link to its source, led by history — what happened last across messages, mail and calls, newest first; email:kai@example.com finds them by address
|
|
7
|
+
- run: wcat context person:42 --before-time 2026-10-01T00:00:00Z
|
|
8
|
+
why: the history further back; history.before_time gives the time to pass for the next older page, --since-time 30d bounds it
|
|
9
|
+
- run: pbx office meetings transcript 7
|
|
10
|
+
why: the whole of a call the history shows a snippet of, by the meeting id of its ref
|
|
11
|
+
- run: wcat facts list subject:"person:42"
|
|
12
|
+
why: decisions, promises and questions already recorded about them; the person reference comes from context's answer
|
|
13
|
+
- run: wcat memories list subject:"person:42"
|
|
14
|
+
why: preferences and summaries kept about them
|
|
15
|
+
- run: wcat search meetings Kai
|
|
16
|
+
why: meetings that mention them, with the passage to cite
|
|
17
|
+
- run: tg personal contacts context Kai
|
|
18
|
+
why: shared Telegram chats, the last messages each way and where others mentioned them
|
|
19
|
+
- run: max personal contacts context Kai
|
|
20
|
+
why: the same for MAX
|
|
21
|
+
- run: zm personal meetings context person:42
|
|
22
|
+
why: what stored Zoom meetings say about them, through the identities linked to that person
|
|
23
|
+
- run: drive personal search Kai
|
|
24
|
+
why: Drive documents that name them
|
|
25
|
+
- run: wcat answers create "what is open with Kai?" --all
|
|
26
|
+
why: one cited evidence bundle across every account and the notes, ready to hand to your agent
|
|
27
|
+
look:
|
|
28
|
+
- open tasks and promises, both ways
|
|
29
|
+
- the last contact in each channel, and who wrote last
|
|
30
|
+
- decisions recorded about them, and anything newer that contradicts one
|
|
31
|
+
- documents worth rereading before the call
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
wcat joins what the store already holds; the other tools add what only they read. Every step reads — nothing is
|
|
35
|
+
sent and nothing changes.
|