@wirecat/cli-core 0.691.0 → 0.692.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 +8 -0
- package/README.md +142 -204
- package/dist/background/daily-archive-timer.d.ts +1 -1
- package/dist/cli/documents/folders.js +1 -1
- package/dist/cli/documents/search.js +3 -3
- package/dist/cli/documents/words.d.ts +3 -1
- package/dist/cli/documents/words.js +1 -0
- package/dist/cli/index.d.ts +1 -0
- package/dist/cli/index.js +1 -0
- package/dist/cli/service-api-call.d.ts +26 -0
- package/dist/cli/service-api-call.js +34 -0
- package/dist/cli/service-api-manifest.d.ts +4 -0
- package/dist/cli/service-api-manifest.js +1 -1
- package/dist/crm/index.d.ts +2 -0
- package/dist/crm/index.js +2 -0
- package/dist/crm/manifest/manifest.d.ts +176 -0
- package/dist/crm/manifest/manifest.js +156 -0
- package/dist/crm/manifest/map.d.ts +53 -0
- package/dist/crm/manifest/map.js +234 -0
- package/dist/crm/manifest/source.d.ts +18 -0
- package/dist/crm/manifest/source.js +314 -0
- package/dist/errors/reasons.js +1 -0
- package/dist/services/metadata.d.ts +1 -1
- package/package.json +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,14 @@ Notable changes to `@wirecat/cli-core` (`@wirecat/cli-messaging` up to 0.261.0,
|
|
|
5
5
|
minor version may break callers, and says how under "Changed — may break callers". `pnpm docs:check` checks the
|
|
6
6
|
shape of this file.
|
|
7
7
|
|
|
8
|
+
## 0.692.0 — 17.11.2026
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
- **A documents CLI that adds a folder by path shows that path in `folders add`'s example and in `search`'s hint.**
|
|
13
|
+
Both said `FOLDER_ID`, which ydisk refuses: its `folders add` takes a Disk path such as `/Documents`. The CLI sets
|
|
14
|
+
`text.folderToAdd` in its `DocumentWords`; without it both keep `FOLDER_ID`.
|
|
15
|
+
|
|
8
16
|
## 0.691.0 — 17.11.2026
|
|
9
17
|
|
|
10
18
|
### Added
|
package/README.md
CHANGED
|
@@ -1,14 +1,58 @@
|
|
|
1
1
|
<p align="center">
|
|
2
|
-
<img src="https://raw.githubusercontent.com/WireCatLabs/cli-core/main/docs/images/cli-core-banner.png" alt="cli-core:
|
|
2
|
+
<img src="https://raw.githubusercontent.com/WireCatLabs/cli-core/main/docs/images/cli-core-banner.png" alt="cli-core: messages and mail your agent can search" width="100%">
|
|
3
3
|
</p>
|
|
4
4
|
|
|
5
5
|
# @wirecat/cli-core
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
Build a CLI that lets people and AI agents search a messenger, a mailbox or any service with a history, in
|
|
8
|
+
TypeScript on Node or Bun. You write the adapter that talks to the service, and cli-core gives it a local store with
|
|
9
|
+
search, the shared commands and an MCP server.
|
|
10
|
+
|
|
11
|
+
```ts
|
|
12
|
+
import { type Messenger, mcpCommand, messagesCommand, run, searchCommand, settingsFor } from "@wirecat/cli-core/cli"
|
|
13
|
+
import { acmeAdapter } from "./adapter.js" // your code: the only part that speaks to Acme Chat
|
|
14
|
+
|
|
15
|
+
const app = { command: "acme", appName: "acme-cli", envPrefix: "ACME", description: "Acme Chat", version: "0.1.0" }
|
|
16
|
+
const settings = settingsFor(app)
|
|
17
|
+
|
|
18
|
+
const acme: Messenger = {
|
|
19
|
+
app,
|
|
20
|
+
provider: "acme",
|
|
21
|
+
resolveSettings: settings.resolveSettings,
|
|
22
|
+
connect: async () => acmeAdapter(),
|
|
23
|
+
chatArgument: "a chat: its name or its Acme id",
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
process.exitCode = await run(process.argv.slice(2), {
|
|
27
|
+
app,
|
|
28
|
+
configuration: settings,
|
|
29
|
+
commands: () => [messagesCommand(acme), searchCommand(acme), mcpCommand(acme)],
|
|
30
|
+
})
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
```sh
|
|
34
|
+
acme personal messages sync --all # every chat's history into the local store
|
|
35
|
+
acme personal search messages come --json=excerpt # {"items":[{"excerpt":"are you coming?",…}],…}
|
|
36
|
+
acme personal mcp check # {"item":{"healthy":true,…,"tools":3,…},…}
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
That output is real, from this program with the in-memory `fakeAdapter` of `@wirecat/cli-core/testing` in place of
|
|
40
|
+
Acme. The search found "are you coming?" from the word "come", with no network.
|
|
41
|
+
|
|
42
|
+
**Built on it:** [tg-cli](https://github.com/WireCatLabs/tg-cli), [max-cli](https://github.com/WireCatLabs/max-cli),
|
|
43
|
+
[gcal-cli](https://github.com/WireCatLabs/gcal-cli) and 12 more WireCat CLIs, such as the mail and notes tool
|
|
44
|
+
[cli-memo](https://github.com/WireCatLabs/cli-memo), the [WhatsApp tool](https://github.com/WireCatLabs/whatsapp-cli),
|
|
45
|
+
[zoom-cli](https://github.com/WireCatLabs/zoom-cli) and [drive-cli](https://github.com/WireCatLabs/drive-cli).
|
|
46
|
+
|
|
47
|
+
## Install
|
|
48
|
+
|
|
49
|
+
```sh
|
|
50
|
+
npm install --save-exact @wirecat/cli-core
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
npm 7+ and pnpm also install its peers: `@wirecat/cli-base` in the range `package.json` names, and `commander` 15 or
|
|
54
|
+
later. `@napi-rs/canvas` is optional, and charts need it only for PNG output. It runs on Node 22.16+ and 24+, and on
|
|
55
|
+
Bun. Pin an exact version, because any release before 1.0 may break a caller ([Build on it](#build-on-it)).
|
|
12
56
|
|
|
13
57
|
[Architecture](docs/dev/ARCHITECTURE.md) · [Write an adapter](docs/dev/ADAPTERS.md) ·
|
|
14
58
|
[Query language](docs/search/query-language.md) · [Messenger rules](docs/dev/STANDARD.md) ·
|
|
@@ -20,57 +64,49 @@ write. A messenger plugs in as one adapter and gets all of it.
|
|
|
20
64
|
[](https://bun.sh/)
|
|
21
65
|
[](LICENSE)
|
|
22
66
|
|
|
23
|
-
##
|
|
67
|
+
## Which package to install
|
|
24
68
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
| [Messenger rules](docs/dev/STANDARD.md) | What binds tg, max and wa beyond the [CLI standards handbook](https://github.com/WireCatLabs/cli-base/blob/main/docs/standards/README.md): parity, the option catalogue, `bot` |
|
|
32
|
-
| [Glossary](docs/dev/GLOSSARY.md) | One word, one meaning across the tools |
|
|
33
|
-
| [Query language](docs/search/query-language.md) · [spec](docs/search/query-language-spec.md) · [Image search](docs/search/images.md) | The search syntax and its exact grammar; finding pictures by context and by what they show |
|
|
34
|
-
| [Mentions](docs/mentions.md) · [how they work](docs/dev/MENTIONS.md) | Phones, e-mail, links, documents and names found in messages: search, review, rebuild; the tables and the rules |
|
|
35
|
-
| [Storage](docs/storage/README.md) | The schema, the search indexes and the decisions behind them |
|
|
36
|
-
| [Knowledge](docs/dev/KNOWLEDGE.md) · [Meetings](docs/dev/MEETINGS.md) | Labels, links and proposals across sources; the meetings module and its providers |
|
|
37
|
-
| [Testing](docs/dev/TESTING.md) · [Parity audit](docs/dev/PARITY-AUDIT.md) | The sandbox, the coverage floor, the checks across tg and max |
|
|
38
|
-
| [Tool boundaries](docs/dev/TOOL-BOUNDARIES.md) | Which tool owns which command |
|
|
39
|
-
| [API reference](docs/REFERENCE.md) | Every entry point and the detailed contract of each feature |
|
|
40
|
-
| [Roadmap](docs/roadmap.md) | What is being built next for developers on this package |
|
|
41
|
-
| [Changelog](CHANGELOG.md) | What each version changed, and what may break callers |
|
|
42
|
-
|
|
43
|
-
## What it is
|
|
44
|
-
|
|
45
|
-
A messaging CLI has two halves. One speaks a protocol: MTProto for Telegram, a WebSocket for MAX, IMAP for mail.
|
|
46
|
-
The other half is the same for every messenger: store what was read, search it, render it for a person and as JSON
|
|
47
|
-
for a program, guard every send, expose it all to an agent. This package is the second half.
|
|
48
|
-
|
|
49
|
-
[tg-cli](https://github.com/WireCatLabs/tg-cli), [max-cli](https://github.com/WireCatLabs/max-cli) and
|
|
50
|
-
the [WhatsApp tool](https://github.com/WireCatLabs/whatsapp-cli) are built on it, and so are the mail and notes tool
|
|
51
|
-
[cli-memo](https://github.com/WireCatLabs/cli-memo), [zoom-cli](https://github.com/WireCatLabs/zoom-cli) and
|
|
52
|
-
[drive-cli](https://github.com/WireCatLabs/drive-cli). They import it as `@wirecat/cli-core`. Up to 0.261.0 the package
|
|
53
|
-
was named `@wirecat/cli-messaging`, which is deprecated. The npm versions 0.0.0-stage, 0.0.0 and 0.18–0.20 of
|
|
54
|
-
`@wirecat/cli-core` are deprecated too: they are placeholders and the old cli-base.
|
|
55
|
-
|
|
56
|
-
**Who it is for.** First of all, it is the engine of the WireCat tools, and it changes as fast as they need. You can
|
|
57
|
-
build your own messenger CLI on it, but expect to follow a moving API (see [Build on it](#build-on-it)).
|
|
58
|
-
|
|
59
|
-
```sh
|
|
60
|
-
npm install --save-exact @wirecat/cli-core
|
|
69
|
+
```mermaid
|
|
70
|
+
flowchart LR
|
|
71
|
+
cli["Your CLI"] -->|"keeps messages, mail or files to search"| core["@wirecat/cli-core"]
|
|
72
|
+
cli -->|"any other CLI"| base["@wirecat/cli-base"]
|
|
73
|
+
core --> base
|
|
74
|
+
base --> runtime["Node or Bun"]
|
|
61
75
|
```
|
|
62
76
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
streams, closed error codes, the keyring, injectable clocks, the query parser. cli-base is a peer dependency, so an
|
|
68
|
-
install holds one copy.
|
|
77
|
+
cli-core is for a tool that keeps what it reads in a local store and searches it. It is built on
|
|
78
|
+
[`@wirecat/cli-base`](https://github.com/WireCatLabs/cli-base), the layer every CLI needs: two output streams, closed
|
|
79
|
+
error codes, the keyring, injectable clocks and the query parser. cli-base is a peer dependency, so an install holds
|
|
80
|
+
one copy. A CLI with nothing to store needs only cli-base.
|
|
69
81
|
|
|
70
|
-
|
|
71
|
-
It runs on Node 22.16+ and 24+, and on Bun.
|
|
82
|
+
## Features
|
|
72
83
|
|
|
73
|
-
|
|
84
|
+
- **Search that finds the message, not only the word.** One query language for every list and every source, a
|
|
85
|
+
TypeScript port of the Apache Lucene 9.12.3 parsers: phrases, `from:(alice OR bob)`, `date:[2026-01-01 TO
|
|
86
|
+
2026-02-01}`, `size>10MB`. Word forms in Russian, English and Spanish (`встреча` finds `встречи`), any three letters
|
|
87
|
+
inside a word, and search by meaning when you opt in. A question over 100,341 synthetic messages took 54 ms at the
|
|
88
|
+
median ([measured](https://github.com/WireCatLabs/cli-testing/blob/main/performance/search/model-free/FRESH-VALIDATION.md#archive-size-latency-and-query-ram),
|
|
89
|
+
[every search measurement](https://github.com/WireCatLabs/cli-testing/tree/main/performance/search)).
|
|
90
|
+
[Syntax](docs/search/query-language.md) · [grammar](docs/search/query-language-spec.md) ·
|
|
91
|
+
[image search](docs/search/images.md)
|
|
92
|
+
- **One store for every source.** Messages from Telegram and MAX, mail, notes and meeting transcripts sit side by side
|
|
93
|
+
in one SQLite file, `wirecat.db`, so one query searches all of them. Edits are kept as revisions and deletions as
|
|
94
|
+
tombstones. Migrations only move forward, and an older CLI keeps reading a file a newer one migrated.
|
|
95
|
+
[Storage](docs/storage/README.md) · [why SQLite FTS5 and no daemon](docs/storage/decisions.md)
|
|
96
|
+
- **An MCP server that leaves room in the agent's context.** The shared commands reach an agent as 3 MCP tools: find a
|
|
97
|
+
command, run a read, run a write. It runs over stdio, or over HTTP on 127.0.0.1 behind the owner's tunnel with a
|
|
98
|
+
one-owner OAuth login.
|
|
99
|
+
- **Every write behind a guard.** A permission level per command path (deny, readonly, ask or allow), a list of
|
|
100
|
+
allowed recipients, and at most 30 sends an hour by default. A write whose outcome is unknown is never retried, and
|
|
101
|
+
a retry under the same send id cannot send twice.
|
|
102
|
+
- **Knowledge, tasks and meetings across sources.** What an agent proposes stays proposed until the owner accepts it.
|
|
103
|
+
Tasks have project keys like `RES-12`, and a meeting transcript is kept by revision.
|
|
104
|
+
[Knowledge](docs/dev/KNOWLEDGE.md) · [Meetings](docs/dev/MEETINGS.md) · [Mentions](docs/mentions.md)
|
|
105
|
+
- **Files and voice as text.** Readers for PDF, Word, HTML and more, each loaded on first use, and speech recognition
|
|
106
|
+
on your computer from a pinned model catalogue. [Document workflows](docs/dev/DOCUMENTS.md) ·
|
|
107
|
+
[Media archives](docs/dev/MEDIA-ARCHIVE.md)
|
|
108
|
+
|
|
109
|
+
## How it works
|
|
74
110
|
|
|
75
111
|
```mermaid
|
|
76
112
|
flowchart TB
|
|
@@ -90,152 +126,14 @@ Five layers, and each calls only the layers below it: domain, adapters behind a
|
|
|
90
126
|
|
|
91
127
|
- **The CLI and the MCP server are two adapters over the same services.** A command and its MCP tool answer with
|
|
92
128
|
the same data, because one service produces it.
|
|
93
|
-
- **A port with one required core and optional groups.** `MessengerCore` is what every messenger must do.
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
- **Decorators, so no service can forget.** Every adapter is wrapped twice: `stored` saves what a read answered,
|
|
98
|
-
and `observed` times each call for the run record.
|
|
99
|
-
- **Override a use case, not a command.** A tool replaces one service through `Messenger.services`; every command
|
|
129
|
+
- **A port with one required core and optional groups.** `MessengerCore` is what every messenger must do. Groups such
|
|
130
|
+
as polls or forums are optional and reached through `capability()`. A messenger without a group refuses the command
|
|
131
|
+
before it connects. It never crashes and never drops an option in silence.
|
|
132
|
+
- **Override a use case, not a command.** A tool replaces one service through `Messenger.services`, and every command
|
|
100
133
|
and tool that uses it follows.
|
|
101
|
-
- **
|
|
102
|
-
store
|
|
103
|
-
|
|
104
|
-
**The build enforces these boundaries.** Biome import rules refuse, under `src/`:
|
|
105
|
-
|
|
106
|
-
- any messenger library or adapter — this package speaks no provider;
|
|
107
|
-
- `commander` or a command file in services, sends or MCP;
|
|
108
|
-
- the SQLite table modules anywhere outside the store's own interface;
|
|
109
|
-
- any import from the rest of the package inside tasks and meetings, and any file system or SQLite there.
|
|
110
|
-
|
|
111
|
-
Tests guard the rest. Migrations must be numbered without gaps and may not rebuild a table. The schema spec, the
|
|
112
|
-
code and its document must agree. A search plan that reads an index once per message fails the build.
|
|
113
|
-
|
|
114
|
-
## Features
|
|
115
|
-
|
|
116
|
-
### Search that finds it
|
|
117
|
-
|
|
118
|
-
- **One query language for every list and every source.** A TypeScript port of the Apache Lucene 9.12.3 parsers,
|
|
119
|
-
with no runtime parser dependency. Phrases, `AND` / `OR` / `NOT`, `+required`, grouping, field groups like
|
|
120
|
-
`from:(alice OR bob)`, ranges `date:[2026-01-01 TO 2026-02-01}`, comparisons `size>10MB`, wildcards and regular
|
|
121
|
-
expressions. 27 fields: sender, chat, date, file name, MIME type, transcript, subject, label and more.
|
|
122
|
-
Proximity `"invoice paid"~3` finds the words close together in one message; the fuzzy operator `word~1` is
|
|
123
|
-
refused with an error that names the alternative.
|
|
124
|
-
[Syntax](docs/search/query-language.md) · [grammar](docs/search/query-language-spec.md)
|
|
125
|
-
- **Any three letters inside a word.** An FTS5 trigram index finds `port` inside `report`. A
|
|
126
|
-
second, word index ranks by BM25.
|
|
127
|
-
- **Word forms in three languages.** Snowball 3.1.1 stemmers for Russian, English and Spanish: `встреча` finds
|
|
128
|
-
`встречи`. Exact forms rank first; `exact:` turns stemming off.
|
|
129
|
-
- **Safe regular expressions.** A Thompson NFA without backtracking, with budgets for states and work, so no
|
|
130
|
-
pattern can hang the search.
|
|
131
|
-
- **Presets for what people actually look for.** `preset:password`, `api-key`, `card`, `phone`, `email`, `url` and
|
|
132
|
-
seven more find candidates, labelled as candidates.
|
|
133
|
-
- **Search by meaning, opt in.** Conversations are split into chunks and embedded locally by ONNX Runtime — native
|
|
134
|
-
on Linux (glibc), Apple-silicon Macs and Windows once `models download` has fetched it, WebAssembly elsewhere, on
|
|
135
|
-
Node and Bun alike — EmbeddingGemma by default (e5-small to choose), or any OpenAI-compatible API with your own key, after
|
|
136
|
-
you see the cost. Results by meaning and by words are merged by reciprocal rank fusion.
|
|
137
|
-
- **The archive and the server together.** `--backend both` also asks the messenger's own search; its hits are saved
|
|
138
|
-
and filtered by the same query, so nothing is counted twice. `--thread` brings the reply thread around a hit.
|
|
139
|
-
- **Bounded by design.** Query size, depth, nodes, pattern length, expansions and run time all have limits.
|
|
140
|
-
|
|
141
|
-
Measured on synthetic data ([methodology and results](https://github.com/WireCatLabs/cli-testing/tree/main/performance/search)):
|
|
142
|
-
|
|
143
|
-
| Stored messages | Search p50 / p95 |
|
|
144
|
-
|---|---|
|
|
145
|
-
| 10,341 | 9.0 / 22.6 ms |
|
|
146
|
-
| 100,341 | 53.9 / 107.6 ms |
|
|
147
|
-
|
|
148
|
-
### One local store for every source
|
|
149
|
-
|
|
150
|
-
- **One file, every messenger and account:** `wirecat.db` in `~/.local/share/WireCat/` (`%LOCALAPPDATA%\WireCat\Data\`
|
|
151
|
-
on Windows). Messages from Telegram and MAX, mail, notes and meeting transcripts sit side by side, so one query
|
|
152
|
-
searches all of them.
|
|
153
|
-
- **`node:sqlite` under Node and `bun:sqlite` under Bun,** behind a small seam. WAL and a busy timeout on both.
|
|
154
|
-
- **History you can trust.** Edits are kept as revisions and deletions as tombstones. Every sender is an identity
|
|
155
|
-
with a person of their own, so one person across two messengers can be linked.
|
|
156
|
-
- **Migrations an older build survives.** Forward-only, additive and frozen once released. `min_compatible` lets an
|
|
157
|
-
older CLI keep using a file a newer one migrated, and refuses a file it cannot read.
|
|
158
|
-
- **Built for the long run.** History download is resumable and respects the messenger's rate limits; it can run in
|
|
159
|
-
the background as a job. `store check`, `backup` and `restore` look after the file itself.
|
|
160
|
-
|
|
161
|
-
[Storage](docs/storage/README.md) · [why SQLite FTS5 and no daemon](docs/storage/decisions.md)
|
|
162
|
-
|
|
163
|
-
### A full CLI and an MCP server from one adapter
|
|
164
|
-
|
|
165
|
-
Describe a messenger once — its name, how to connect, how `me` maps to a chat — and the tool gets about sixty
|
|
166
|
-
shared commands: chats, contacts, messages, search, reactions, polls, the inbox of unread messages, `watch` for live
|
|
167
|
-
updates, history download, the store, run records, configuration, shell completion, `doctor`, and `commands --json`,
|
|
168
|
-
the whole command tree as data for an agent.
|
|
169
|
-
|
|
170
|
-
The same commands become MCP tools for agents without a terminal. The server offers three tools — find a command,
|
|
171
|
-
run a read, run a write — so an agent's context does not fill with a hundred tool schemas. It runs over stdio, or
|
|
172
|
-
over HTTP on 127.0.0.1 behind the owner's tunnel, with a one-owner OAuth login.
|
|
173
|
-
|
|
174
|
-
`serve` keeps the store current, one process per profile by a lock file; `server install` adds a systemd user unit
|
|
175
|
-
or a launchd agent that starts at every login.
|
|
176
|
-
|
|
177
|
-
### Every write behind a guard
|
|
178
|
-
|
|
179
|
-
- **A permission level per command path:** deny, readonly, ask or allow. The most specific key wins, and a built-in
|
|
180
|
-
default can only tighten what the owner set. No level lets an agent delete for everyone.
|
|
181
|
-
- **A recipient list and an hourly limit** for sends, and a journal of every attempt that records the length of the
|
|
182
|
-
text, never the text. Each photo or file of an album counts as one send.
|
|
183
|
-
- **A send id across retries.** A write whose outcome is unknown is never retried automatically; a retry under the
|
|
184
|
-
same send id cannot send twice.
|
|
185
|
-
- **Deletion asks first,** at most ten messages at a time.
|
|
186
|
-
- **MCP writes follow the same profile permissions.** An agent sees only the tools the profile allows.
|
|
187
|
-
|
|
188
|
-
### Knowledge, tasks and meetings
|
|
189
|
-
|
|
190
|
-
- **Labels, links and facts across sources,** always scoped to an explicit account. What an agent adds stays
|
|
191
|
-
*proposed* until the owner accepts it, with a fingerprint so a stale review cannot overwrite a newer change.
|
|
192
|
-
- **A shared vocabulary.** Before a new tag is created, similar existing tags and aliases are offered for review.
|
|
193
|
-
- **Tasks** with project keys (`RES-12`), dependencies and a readiness check.
|
|
194
|
-
- **Meetings:** a WebVTT parser, a `MeetingSource` port a provider implements, transcripts kept by revision, and
|
|
195
|
-
references to one cue of one transcript.
|
|
196
|
-
|
|
197
|
-
### Files, voice and charts
|
|
198
|
-
|
|
199
|
-
- **Readers for PDF, Word, ODF, HTML and more,** each library loaded on first use.
|
|
200
|
-
- **Local speech recognition** from a pinned model catalogue; importing it loads no engine and downloads nothing.
|
|
201
|
-
- **Charts from statistics** as JSON, SVG or PNG, with a replaceable renderer loaded only when an image is asked for.
|
|
202
|
-
|
|
203
|
-
## Engineering standards
|
|
204
|
-
|
|
205
|
-
The [WireCat CLI standards handbook](https://github.com/WireCatLabs/cli-base/blob/main/docs/standards/README.md) in cli-base binds every WireCat CLI; the
|
|
206
|
-
[messenger rules](docs/dev/STANDARD.md) add what binds tg, max and wa. They measure themselves against POSIX, GNU,
|
|
207
|
-
[Command Line Interface Guidelines](https://clig.dev), the MCP specification and JSON Schema 2020-12, and say where
|
|
208
|
-
they deliberately differ. A rule changes in its own pull request, before the code that needs it.
|
|
209
|
-
|
|
210
|
-
- **stdout carries data, stderr carries diagnostics,** in every mode. `--json` prints one object; `--jsonl` one per
|
|
211
|
-
line; `--json=id,text` only those fields.
|
|
212
|
-
- **Stable exit codes** a script can branch on: 2 validation, 3 config, 4 auth, 5 permission, 6 not found,
|
|
213
|
-
8 rate limited, 9 timeout, 14 outcome unknown, and the rest. An error is one JSON object with a stable `code` and
|
|
214
|
-
`reason` — callers never parse the message.
|
|
215
|
-
- **Built for agents.** `--no-input` never prompts. Input and output are bounded (16 MiB in, 4 MiB out) and fail
|
|
216
|
-
visibly instead of truncating. One-shot commands time out after 30 seconds and close what they hold. `--dry-run`
|
|
217
|
-
previews any write.
|
|
218
|
-
- **The tool never picks an account.** Every account command names its profile — the first word in tg, max and
|
|
219
|
-
wa, an option such as `--account` or `--profile` in the others; without one, the command stops and lists the
|
|
220
|
-
choices — even when there is only one.
|
|
221
|
-
- **Run records keep the command as typed, never a secret.** Every run is kept, with one line per request it made,
|
|
222
|
-
so `runs show` can explain it: successes for 7 days, failures for 30, within a size limit. A token, a password or
|
|
223
|
-
a phone number is hidden; `record_input: false` leaves the typed words out, `"failed"` keeps them only for a
|
|
224
|
-
failure, and `record: false` keeps failures only.
|
|
225
|
-
- **Tests that cannot touch real data.** A sandbox keeps every test away from the owner's store, and no test may
|
|
226
|
-
sleep. A coverage floor: 92% of lines, and at least half of every file.
|
|
227
|
-
- **Contract cases for every adapter.** `contractCases` turns the port's promises into cases any test runner can run,
|
|
228
|
-
over an in-memory fake or a real client.
|
|
229
|
-
- **Checked across tools and runtimes.** CI runs on Linux: the test suite on Node 24, smoke checks on Bun and on
|
|
230
|
-
Node 22.16, a parity workflow that builds the Telegram, MAX and WhatsApp CLIs against this repository, and
|
|
231
|
-
gitleaks over the full history. macOS and Windows run only four workflows: the SQLite library build (macOS) and
|
|
232
|
-
the ONNX runtime probe (macOS and Windows) run monthly and when started by hand; the native-runtime check (Linux,
|
|
233
|
-
macOS and Windows, x64 and arm64, and Alpine) runs monthly and on every pull request that changes how models
|
|
234
|
-
load; the scheduler test (macOS and Windows) runs only when started by hand. The rest of the suite does not run on
|
|
235
|
-
macOS or Windows.
|
|
236
|
-
- **One shared toolchain.** Biome, markdownlint, CSpell and Lefthook configs come from the
|
|
237
|
-
[WireCat standards](https://github.com/WireCatLabs/community/blob/main/standards/README.md), and CI fails when a
|
|
238
|
-
copy drifts.
|
|
134
|
+
- **The build keeps the lines.** Biome import rules refuse any messenger library under `src/`, `commander` in a
|
|
135
|
+
service, and the SQLite tables outside the store. Tests refuse a gap in the migration numbers and a search plan that
|
|
136
|
+
reads an index once per message.
|
|
239
137
|
|
|
240
138
|
## Build on it
|
|
241
139
|
|
|
@@ -243,8 +141,8 @@ A new messenger is three pieces: an adapter that implements `MessengerCore` (and
|
|
|
243
141
|
`Messenger` that describes it, and the contract cases run against it. The
|
|
244
142
|
[adapter guide](docs/dev/ADAPTERS.md) walks through each one.
|
|
245
143
|
|
|
246
|
-
This runs as it is under vitest. `fakeAdapter` is the in-memory adapter the kit ships
|
|
247
|
-
built over a fake client filled from `seed`. The `./testing` kit is not stable yet.
|
|
144
|
+
This runs as it is under vitest and gives 29 cases. `fakeAdapter` is the in-memory adapter the kit ships. Put your own
|
|
145
|
+
adapter there, built over a fake client filled from `seed`. The `./testing` kit is not stable yet.
|
|
248
146
|
|
|
249
147
|
```ts
|
|
250
148
|
import { contractCases, digitIds, fakeAdapter } from "@wirecat/cli-core/testing"
|
|
@@ -259,15 +157,30 @@ describe("the adapter keeps the port's promises", () => {
|
|
|
259
157
|
})
|
|
260
158
|
```
|
|
261
159
|
|
|
262
|
-
**Before 1.0, any release may break a caller.** Releases are frequent, sometimes several a day, and any of them
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
Pin an exact version too.
|
|
160
|
+
**Before 1.0, any release may break a caller.** Releases are frequent, sometimes several a day, and any of them may
|
|
161
|
+
change any entry point. The [changelog](CHANGELOG.md) lists every such change in its own section, with what to change.
|
|
162
|
+
tg-cli and max-cli pin an exact version and move to a new one in their own pull request. Pin an exact version too.
|
|
266
163
|
The full list of entry points and what each holds is in the [API reference](docs/REFERENCE.md).
|
|
267
164
|
|
|
268
165
|
⚠ **Errors are recognised by shape, not by class** (`isCliFailure`). A package linked during development brings its
|
|
269
166
|
own copy of cli-base, and an error built by one copy is not an `instanceof` the other's class.
|
|
270
167
|
|
|
168
|
+
## Engineering standards
|
|
169
|
+
|
|
170
|
+
The [WireCat CLI standards handbook](https://github.com/WireCatLabs/cli-base/blob/main/docs/standards/README.md) in
|
|
171
|
+
cli-base binds every WireCat CLI, and the [messenger rules](docs/dev/STANDARD.md) add what binds tg, max and wa. They
|
|
172
|
+
measure themselves against POSIX, GNU, [Command Line Interface Guidelines](https://clig.dev), the MCP specification
|
|
173
|
+
and JSON Schema 2020-12, and say where they differ on purpose.
|
|
174
|
+
|
|
175
|
+
- **Tests that cannot touch real data.** A sandbox keeps every test away from the owner's store, and no test may
|
|
176
|
+
sleep. The coverage floor is 92% of lines, and at least half of every file.
|
|
177
|
+
- **Checked against the tools that use it.** Every pull request builds tg-cli, max-cli, whatsapp-cli and
|
|
178
|
+
cli-template against the branch. Which checks run on macOS and Windows is in
|
|
179
|
+
[Testing](docs/dev/TESTING.md#platforms).
|
|
180
|
+
- **One shared toolchain.** Biome, markdownlint, CSpell and Lefthook configs come from the
|
|
181
|
+
[WireCat standards](https://github.com/WireCatLabs/community/blob/main/standards/README.md), and CI fails when a
|
|
182
|
+
copy drifts.
|
|
183
|
+
|
|
271
184
|
## Development
|
|
272
185
|
|
|
273
186
|
```sh
|
|
@@ -276,9 +189,34 @@ pnpm lint && pnpm typecheck && pnpm test
|
|
|
276
189
|
pnpm smoke:bun # the same exports, run under Bun
|
|
277
190
|
```
|
|
278
191
|
|
|
279
|
-
Releases go through `bin/release` from `main
|
|
192
|
+
Releases go through `bin/release` from `main`. It refuses a dirty tree, runs every check, publishes to npm and tags
|
|
280
193
|
`v<version>`. The steps and the release rules are in [RELEASING.md](docs/dev/RELEASING.md).
|
|
281
194
|
|
|
195
|
+
## Key documents
|
|
196
|
+
|
|
197
|
+
| Document | What it answers |
|
|
198
|
+
|---|---|
|
|
199
|
+
| [Architecture](docs/dev/ARCHITECTURE.md) | The layers, the module map, the store internals and migrations, who consumes what |
|
|
200
|
+
| [Document workflows](docs/dev/DOCUMENTS.md) | Shared file ingestion, sync, scoped knowledge and extraction, and the ports a file provider supplies |
|
|
201
|
+
| [Media archives](docs/dev/MEDIA-ARCHIVE.md) | Independent verified file copies, interruption recovery and opt-in daily timers |
|
|
202
|
+
| [Write an adapter](docs/dev/ADAPTERS.md) | How to add a messenger: the port, the `Messenger` description, the contract cases |
|
|
203
|
+
| [Messenger rules](docs/dev/STANDARD.md) | What binds tg, max and wa beyond the [CLI standards handbook](https://github.com/WireCatLabs/cli-base/blob/main/docs/standards/README.md): parity, the option catalogue, `bot` |
|
|
204
|
+
| [Glossary](docs/dev/GLOSSARY.md) | One word, one meaning across the tools |
|
|
205
|
+
| [Query language](docs/search/query-language.md) · [spec](docs/search/query-language-spec.md) · [Image search](docs/search/images.md) | The search syntax and its exact grammar, and finding pictures by context and by what they show |
|
|
206
|
+
| [Mentions](docs/mentions.md) · [how they work](docs/dev/MENTIONS.md) | Phones, e-mail, links, documents and names found in messages: search, review, rebuild, the tables and the rules |
|
|
207
|
+
| [Storage](docs/storage/README.md) | The schema, the search indexes and the decisions behind them |
|
|
208
|
+
| [Knowledge](docs/dev/KNOWLEDGE.md) · [Meetings](docs/dev/MEETINGS.md) | Labels, links and proposals across sources, the meetings module and its providers |
|
|
209
|
+
| [Testing](docs/dev/TESTING.md) · [Parity audit](docs/dev/PARITY-AUDIT.md) | The sandbox, the coverage floor, the checks across tg and max |
|
|
210
|
+
| [Tool boundaries](docs/dev/TOOL-BOUNDARIES.md) | Which tool owns which command |
|
|
211
|
+
| [API reference](docs/REFERENCE.md) | Every entry point and the detailed contract of each feature |
|
|
212
|
+
| [Roadmap](docs/roadmap.md) | What is being built next for developers on this package |
|
|
213
|
+
| [Changelog](CHANGELOG.md) | What each version changed, and what may break callers |
|
|
214
|
+
|
|
215
|
+
## History
|
|
216
|
+
|
|
217
|
+
Up to 0.261.0 the package was named `@wirecat/cli-messaging`, which is deprecated. The npm versions 0.0.0-stage, 0.0.0
|
|
218
|
+
and 0.18 to 0.20 of `@wirecat/cli-core` are deprecated too: they are placeholders and the old cli-base.
|
|
219
|
+
|
|
282
220
|
## Licence
|
|
283
221
|
|
|
284
222
|
[Apache License 2.0](LICENSE).
|
|
@@ -24,12 +24,12 @@ export interface DailyArchiveTimerInput {
|
|
|
24
24
|
}
|
|
25
25
|
export declare const dailyArchiveTimer: (input: DailyArchiveTimerInput) => DailyArchiveTimer;
|
|
26
26
|
export declare const manageDailyArchiveTimer: (plan: DailyArchiveTimer, action: "install" | "start" | "stop" | "status" | "uninstall", system: Pick<ServerSystem, "platform" | "run">, env: NodeJS.ProcessEnv, signal?: AbortSignal) => Promise<{
|
|
27
|
-
action?: undefined;
|
|
28
27
|
name: string;
|
|
29
28
|
installed: boolean;
|
|
30
29
|
active: boolean;
|
|
31
30
|
servicePath: string;
|
|
32
31
|
timerPath: string;
|
|
32
|
+
action?: undefined;
|
|
33
33
|
} | {
|
|
34
34
|
active?: undefined;
|
|
35
35
|
name: string;
|
|
@@ -12,7 +12,7 @@ const addDocumentFolderCommandsDefinition = (program, helpers) => {
|
|
|
12
12
|
const folders = annotate(program.command("folders"), { effects: LOCAL_READ }).description(text.folders);
|
|
13
13
|
examples(annotate(folders.command("add"), { effects: FETCH })
|
|
14
14
|
.argument("<folder>", text.folderArgument)
|
|
15
|
-
.description("import a folder and everything under it on the next sync"), [`${prefix} folders add
|
|
15
|
+
.description("import a folder and everything under it on the next sync"), [`${prefix} folders add ${text.folderToAdd}`]).action(async (input) => {
|
|
16
16
|
const { id, name } = await helpers.add(input);
|
|
17
17
|
output(itemOf({ id, name, added: true }));
|
|
18
18
|
});
|
|
@@ -3,12 +3,12 @@ import { honoursDryRun } from "../dry-run-guard.js";
|
|
|
3
3
|
import { LOCAL_READ } from "../effects.js";
|
|
4
4
|
import { itemOf } from "../envelope.js";
|
|
5
5
|
import { examples, positive, wordsOf } from "./words.js";
|
|
6
|
-
const notImported = (app, { profile, chosen, documents }) => {
|
|
6
|
+
const notImported = (app, folder, { profile, chosen, documents }) => {
|
|
7
7
|
if (documents > 0)
|
|
8
8
|
return undefined;
|
|
9
9
|
return !chosen
|
|
10
10
|
? `profile ${profile} has no folders selected, so nothing is imported to search — ` +
|
|
11
|
-
`${app} ${profile} folders add
|
|
11
|
+
`${app} ${profile} folders add ${folder}, then ${app} ${profile} sync`
|
|
12
12
|
: `profile ${profile} has imported no documents yet — ${app} ${profile} sync`;
|
|
13
13
|
};
|
|
14
14
|
const addDocumentSearchCommandDefinition = (program, helpers) => {
|
|
@@ -26,7 +26,7 @@ const addDocumentSearchCommandDefinition = (program, helpers) => {
|
|
|
26
26
|
offset: (page - 1) * args.limit,
|
|
27
27
|
exact: args.exact ?? false,
|
|
28
28
|
});
|
|
29
|
-
const hint = notImported(wording.app, helpers.imported());
|
|
29
|
+
const hint = notImported(wording.app, wording.text.folderToAdd, helpers.imported());
|
|
30
30
|
helpers.output(itemOf(hint ? { ...result, not_imported: hint } : result));
|
|
31
31
|
});
|
|
32
32
|
};
|
|
@@ -27,6 +27,8 @@ export interface DocumentTexts {
|
|
|
27
27
|
treeArgument: string;
|
|
28
28
|
folders: string;
|
|
29
29
|
folderArgument: string;
|
|
30
|
+
/** What `folders add` takes in examples and hints: `FOLDER_ID`, or a path for a CLI that adds by path. */
|
|
31
|
+
folderToAdd: string;
|
|
30
32
|
syncLimit: string;
|
|
31
33
|
identities: string;
|
|
32
34
|
identitiesList: string;
|
|
@@ -56,8 +58,8 @@ export interface CopyAge {
|
|
|
56
58
|
}
|
|
57
59
|
export declare const ageOf: (lastSync: string | undefined, now?: number) => CopyAge;
|
|
58
60
|
export declare const staleCopy: (provider: string, lastSync: string | undefined, now?: number) => {
|
|
59
|
-
missing?: undefined;
|
|
60
61
|
next?: undefined;
|
|
62
|
+
missing?: undefined;
|
|
61
63
|
meta?: undefined;
|
|
62
64
|
} | {
|
|
63
65
|
missing: {
|
|
@@ -21,6 +21,7 @@ export const wordsOf = (words) => {
|
|
|
21
21
|
treeArgument: `${provider} folder id or URL; defaults to the explicitly selected profile's roots`,
|
|
22
22
|
folders: `choose the ${place} folders that sync imports`,
|
|
23
23
|
folderArgument: `folder id or ${place} URL`,
|
|
24
|
+
folderToAdd: "FOLDER_ID",
|
|
24
25
|
syncLimit: `how many documents to read from ${provider} in this run`,
|
|
25
26
|
identities: `the ${provider} accounts seen on a document, and the people they belong to`,
|
|
26
27
|
identitiesList: `list the people ${provider} shows for a document`,
|
package/dist/cli/index.d.ts
CHANGED
|
@@ -153,6 +153,7 @@ export { HARNESSES, type Harness, harnessesOn, harnessInfo, harnessOfArgv, isHar
|
|
|
153
153
|
export { type AgentScheduleSpec, agentSchedule, backfillScheduleRun, pauseSchedule, removeSchedule, runScheduleNow, SCHEDULE_SETTINGS, type ScheduleHost, type ScheduleLimits, type ScheduleSite, scheduleLimitsOf, scheduleState, slotsOfAt, writeSchedule, } from "./schedule/schedule-command.js";
|
|
154
154
|
export { deniedKinds, deniedKindsOf, type LeftOut, type SearchedKind } from "./search-left-out.js";
|
|
155
155
|
export { type BodyPermission, type ServiceApiOptions, type ServiceApiPermissionsInput, serviceApiKeys, serviceApiPermissions, } from "./service-api.js";
|
|
156
|
+
export { type ServiceApiCall, type ServiceApiCallOptions, serviceApiCall } from "./service-api-call.js";
|
|
156
157
|
export { manifestBaseUrl, type ServiceApiManifest } from "./service-api-manifest.js";
|
|
157
158
|
export { type DeclaredSetting, type SettingRow, settingRows, withSettingDefaults } from "./setting-defaults.js";
|
|
158
159
|
export { type Config, type Configuration, count, first, flag, fromFile, type GlobalFlags, NONE_NAMED, namedProfile, type ProfileKind, plain, type ResolveOptions, type Settings, type SettingsExtension, type SettingsExtensionContext, type Source, settingsFor, } from "./settings.js";
|
package/dist/cli/index.js
CHANGED
|
@@ -142,6 +142,7 @@ export { HARNESSES, harnessesOn, harnessInfo, harnessOfArgv, isHarness, reportsC
|
|
|
142
142
|
export { agentSchedule, backfillScheduleRun, pauseSchedule, removeSchedule, runScheduleNow, SCHEDULE_SETTINGS, scheduleLimitsOf, scheduleState, slotsOfAt, writeSchedule, } from "./schedule/schedule-command.js";
|
|
143
143
|
export { deniedKinds, deniedKindsOf } from "./search-left-out.js";
|
|
144
144
|
export { serviceApiKeys, serviceApiPermissions, } from "./service-api.js";
|
|
145
|
+
export { serviceApiCall } from "./service-api-call.js";
|
|
145
146
|
export { manifestBaseUrl } from "./service-api-manifest.js";
|
|
146
147
|
export { settingRows, withSettingDefaults } from "./setting-defaults.js";
|
|
147
148
|
export { count, first, flag, fromFile, NONE_NAMED, namedProfile, plain, settingsFor, } from "./settings.js";
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { ManifestOperation } from "@wirecat/cli-base/codegen";
|
|
2
|
+
import type { FetchLike } from "@wirecat/cli-base/http";
|
|
3
|
+
import type { ApiCommandInput } from "./bot/api.js";
|
|
4
|
+
import { type HttpApiSendOptions } from "./bot/api-http.js";
|
|
5
|
+
import { type ServiceApiManifest } from "./service-api-manifest.js";
|
|
6
|
+
/** One operation of the generated manifest, by its id, sent with the sign-in its security scheme names. */
|
|
7
|
+
export type ServiceApiCall = (operation: string, input: ApiCommandInput) => Promise<unknown>;
|
|
8
|
+
export interface ServiceApiCallOptions {
|
|
9
|
+
manifest: ServiceApiManifest;
|
|
10
|
+
/** The service's name in messages: "HubSpot". */
|
|
11
|
+
service: string;
|
|
12
|
+
/** The host-checked fetch with the CLI's pace and retry of reads, as the `api` group gets it. */
|
|
13
|
+
fetch: FetchLike;
|
|
14
|
+
token: () => string | Promise<string>;
|
|
15
|
+
/** In place of the manifest's first server. */
|
|
16
|
+
baseUrl?: string;
|
|
17
|
+
/** Headers beside the sign-in, such as the API version. */
|
|
18
|
+
headers?: (operation: ManifestOperation) => Record<string, string>;
|
|
19
|
+
failure?: HttpApiSendOptions["failure"];
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* The `api` group's request path for code that is not a command, such as a source read from a manifest: the same
|
|
23
|
+
* request building, sign-in header, redirect rule, run record and refusals as `serviceApiCommand`, without a guard. It
|
|
24
|
+
* sends reads only; a write goes through the `api` group, where the profile's guard asks.
|
|
25
|
+
*/
|
|
26
|
+
export declare const serviceApiCall: (options: ServiceApiCallOptions) => ServiceApiCall;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { CliError } from "@wirecat/cli-base";
|
|
2
|
+
import { Command } from "commander";
|
|
3
|
+
import { httpApiRequest, httpApiSend } from "./bot/api-http.js";
|
|
4
|
+
import { authHeader, manifestBaseUrl } from "./service-api-manifest.js";
|
|
5
|
+
// The run record and the fetch are the only things httpApiSend asks a command for, and a sync has no command of its own.
|
|
6
|
+
const NO_COMMAND = new Command("source");
|
|
7
|
+
/**
|
|
8
|
+
* The `api` group's request path for code that is not a command, such as a source read from a manifest: the same
|
|
9
|
+
* request building, sign-in header, redirect rule, run record and refusals as `serviceApiCommand`, without a guard. It
|
|
10
|
+
* sends reads only; a write goes through the `api` group, where the profile's guard asks.
|
|
11
|
+
*/
|
|
12
|
+
export const serviceApiCall = (options) => {
|
|
13
|
+
const baseUrl = manifestBaseUrl(options.manifest, options.baseUrl);
|
|
14
|
+
const operations = new Map(options.manifest.operations.map((one) => [one.id, one]));
|
|
15
|
+
const send = httpApiSend({ service: options.service, fetch: () => options.fetch, failure: options.failure });
|
|
16
|
+
return async (id, input) => {
|
|
17
|
+
const operation = operations.get(id);
|
|
18
|
+
if (!operation)
|
|
19
|
+
throw new CliError("configuration_error", `no ${options.service} API operation ${id}`);
|
|
20
|
+
if (operation.effect !== "read")
|
|
21
|
+
throw new CliError("configuration_error", `${operation.command} is not a read; a source only reads`);
|
|
22
|
+
const request = httpApiRequest(operation, input, baseUrl);
|
|
23
|
+
const extra = Object.entries(options.headers?.(operation) ?? {});
|
|
24
|
+
for (const [name, value] of extra)
|
|
25
|
+
request.headers.set(name, value);
|
|
26
|
+
const auth = authHeader(options.manifest, operation);
|
|
27
|
+
if (auth)
|
|
28
|
+
request.headers.set(auth.name, auth.value(await options.token()));
|
|
29
|
+
// A redirect to another host drops only the standard sign-in headers; an API key or a hook's header would go along.
|
|
30
|
+
if ((auth && auth.name !== "authorization") || extra.length)
|
|
31
|
+
request.redirect = "manual";
|
|
32
|
+
return send(NO_COMMAND, operation, request);
|
|
33
|
+
};
|
|
34
|
+
};
|
|
@@ -26,6 +26,10 @@ export declare const parameterValue: (input: ApiCommandInput, parameter: {
|
|
|
26
26
|
in: "query" | "body";
|
|
27
27
|
name: string;
|
|
28
28
|
}) => unknown;
|
|
29
|
+
export declare const withValue: (input: ApiCommandInput, parameter: {
|
|
30
|
+
in: "query" | "body";
|
|
31
|
+
name: string;
|
|
32
|
+
}, value: string | number) => ApiCommandInput;
|
|
29
33
|
/** One page's items, and how to ask for the next: new flags, the next page's whole URL, or `undefined` at the end. */
|
|
30
34
|
export interface PageStep {
|
|
31
35
|
items: readonly unknown[];
|
|
@@ -69,7 +69,7 @@ export const parameterValue = (input, parameter) => parameter.in === "query"
|
|
|
69
69
|
: input.body === undefined
|
|
70
70
|
? undefined
|
|
71
71
|
: parseApiJson(input.body)?.[parameter.name];
|
|
72
|
-
const withValue = (input, parameter, value) => {
|
|
72
|
+
export const withValue = (input, parameter, value) => {
|
|
73
73
|
if (parameter.in === "query")
|
|
74
74
|
return { ...input, query: { ...input.query, [parameter.name]: String(value) } };
|
|
75
75
|
const body = input.body === undefined ? {} : parseApiJson(input.body);
|
package/dist/crm/index.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export { type CrmFileFetchOptions, fetchCrmFile } from "./file-fetch.js";
|
|
2
2
|
export { crmFileId, LINK_REMOVED, parseCrmFileId, withoutFileLinks } from "./files.js";
|
|
3
3
|
export { DAILY_FOREIGN_CONTACTS, type ForeignContacts, foreignContacts, foreignContactsPathFor, refuseForeignClientReads, } from "./foreign-contacts.js";
|
|
4
|
+
export { type CrmChangesCall, type CrmManifest, type CrmManifestEntity, type CrmManifestFields, type CrmManifestHooks, type CrmManifestPipelines, type CrmOperationCall, type CrmRule, parseCrmManifest, } from "./manifest/manifest.js";
|
|
5
|
+
export { type CrmManifestSourceOptions, crmSourceFromManifest } from "./manifest/source.js";
|
|
4
6
|
export { type ProviderCallOptions, providerCall } from "./provider-call.js";
|
|
5
7
|
export { type CrmConditionHooks, type CrmQueryField, conditionsOf, customConditions, customNames, filterableFields, selectedCodes, wantedCodes, withCustomFields, } from "./query.js";
|
|
6
8
|
export { CRM_FILE_SOURCES, type CrmCallContext, type CrmChanges, type CrmCondition, type CrmFile, type CrmFileOwner, type CrmFileSourceKind, type CrmFiles, type CrmGap, type CrmIdPage, type CrmLiveKind, type CrmLiveQuery, type CrmOpenableFile, type CrmPage, type CrmSource, type CrmSourceTraits, } from "./source.js";
|
package/dist/crm/index.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export { fetchCrmFile } from "./file-fetch.js";
|
|
2
2
|
export { crmFileId, LINK_REMOVED, parseCrmFileId, withoutFileLinks } from "./files.js";
|
|
3
3
|
export { DAILY_FOREIGN_CONTACTS, foreignContacts, foreignContactsPathFor, refuseForeignClientReads, } from "./foreign-contacts.js";
|
|
4
|
+
export { parseCrmManifest, } from "./manifest/manifest.js";
|
|
5
|
+
export { crmSourceFromManifest } from "./manifest/source.js";
|
|
4
6
|
export { providerCall } from "./provider-call.js";
|
|
5
7
|
export { conditionsOf, customConditions, customNames, filterableFields, selectedCodes, wantedCodes, withCustomFields, } from "./query.js";
|
|
6
8
|
export { CRM_FILE_SOURCES, } from "./source.js";
|