@openclaw/crabline 0.1.8 → 0.1.10
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/README.md +52 -22
- package/assets/crabline-banner.svg +20 -0
- package/dist/src/bin/crabline.js.map +1 -1
- package/dist/src/cli/program.d.ts +25 -1
- package/dist/src/cli/program.js +579 -82
- package/dist/src/cli/program.js.map +1 -1
- package/dist/src/config/load.js +59 -6
- package/dist/src/config/load.js.map +1 -1
- package/dist/src/config/schema.d.ts +116 -92
- package/dist/src/config/schema.js +179 -73
- package/dist/src/config/schema.js.map +1 -1
- package/dist/src/core/errors.js +9 -2
- package/dist/src/core/errors.js.map +1 -1
- package/dist/src/core/exit-codes.js.map +1 -1
- package/dist/src/core/matcher.js +7 -6
- package/dist/src/core/matcher.js.map +1 -1
- package/dist/src/core/message-template.js.map +1 -1
- package/dist/src/core/nonces.d.ts +1 -0
- package/dist/src/core/nonces.js +4 -2
- package/dist/src/core/nonces.js.map +1 -1
- package/dist/src/core/reporters.d.ts +1 -0
- package/dist/src/core/reporters.js +42 -4
- package/dist/src/core/reporters.js.map +1 -1
- package/dist/src/core/run.d.ts +3 -0
- package/dist/src/core/run.js +415 -107
- package/dist/src/core/run.js.map +1 -1
- package/dist/src/core/safe-regex.d.ts +3 -0
- package/dist/src/core/safe-regex.js +21 -0
- package/dist/src/core/safe-regex.js.map +1 -0
- package/dist/src/index.d.ts +4 -2
- package/dist/src/index.js +1 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/openclaw/artifact-generation.d.ts +38 -0
- package/dist/src/openclaw/artifact-generation.js +314 -0
- package/dist/src/openclaw/artifact-generation.js.map +1 -0
- package/dist/src/openclaw/bridges/matrix.js +97 -12
- package/dist/src/openclaw/bridges/matrix.js.map +1 -1
- package/dist/src/openclaw/bridges/mattermost.js +32 -10
- package/dist/src/openclaw/bridges/mattermost.js.map +1 -1
- package/dist/src/openclaw/bridges/signal.js +55 -18
- package/dist/src/openclaw/bridges/signal.js.map +1 -1
- package/dist/src/openclaw/bridges/slack.js +85 -7
- package/dist/src/openclaw/bridges/slack.js.map +1 -1
- package/dist/src/openclaw/bridges/telegram.js +124 -30
- package/dist/src/openclaw/bridges/telegram.js.map +1 -1
- package/dist/src/openclaw/bridges/whatsapp.js +78 -17
- package/dist/src/openclaw/bridges/whatsapp.js.map +1 -1
- package/dist/src/openclaw/bridges/zalo.js +14 -5
- package/dist/src/openclaw/bridges/zalo.js.map +1 -1
- package/dist/src/openclaw/outbound-contract.d.ts +5 -0
- package/dist/src/openclaw/outbound-contract.js +40 -0
- package/dist/src/openclaw/outbound-contract.js.map +1 -0
- package/dist/src/openclaw/private-file.d.ts +26 -0
- package/dist/src/openclaw/private-file.js +411 -0
- package/dist/src/openclaw/private-file.js.map +1 -0
- package/dist/src/openclaw/shared.d.ts +23 -2
- package/dist/src/openclaw/shared.js +115 -18
- package/dist/src/openclaw/shared.js.map +1 -1
- package/dist/src/openclaw/smoke-lock.d.ts +63 -0
- package/dist/src/openclaw/smoke-lock.js +949 -0
- package/dist/src/openclaw/smoke-lock.js.map +1 -0
- package/dist/src/openclaw.d.ts +16 -8
- package/dist/src/openclaw.js +195 -52
- package/dist/src/openclaw.js.map +1 -1
- package/dist/src/providers/builtin/discord.d.ts +10 -1
- package/dist/src/providers/builtin/discord.js +144 -18
- package/dist/src/providers/builtin/discord.js.map +1 -1
- package/dist/src/providers/builtin/external-webhook-auth.d.ts +11 -0
- package/dist/src/providers/builtin/external-webhook-auth.js +10 -0
- package/dist/src/providers/builtin/external-webhook-auth.js.map +1 -0
- package/dist/src/providers/builtin/feishu.d.ts +19 -2
- package/dist/src/providers/builtin/feishu.js +307 -25
- package/dist/src/providers/builtin/feishu.js.map +1 -1
- package/dist/src/providers/builtin/googlechat.d.ts +20 -1
- package/dist/src/providers/builtin/googlechat.js +178 -19
- package/dist/src/providers/builtin/googlechat.js.map +1 -1
- package/dist/src/providers/builtin/imessage.d.ts +4 -0
- package/dist/src/providers/builtin/imessage.js +26 -11
- package/dist/src/providers/builtin/imessage.js.map +1 -1
- package/dist/src/providers/builtin/loopback.js +92 -30
- package/dist/src/providers/builtin/loopback.js.map +1 -1
- package/dist/src/providers/builtin/matrix.d.ts +11 -1
- package/dist/src/providers/builtin/matrix.js +53 -29
- package/dist/src/providers/builtin/matrix.js.map +1 -1
- package/dist/src/providers/builtin/mattermost.d.ts +10 -0
- package/dist/src/providers/builtin/mattermost.js +38 -15
- package/dist/src/providers/builtin/mattermost.js.map +1 -1
- package/dist/src/providers/builtin/msteams.d.ts +17 -1
- package/dist/src/providers/builtin/msteams.js +113 -14
- package/dist/src/providers/builtin/msteams.js.map +1 -1
- package/dist/src/providers/builtin/native-local-mock.d.ts +2 -9
- package/dist/src/providers/builtin/native-local-mock.js +12 -35
- package/dist/src/providers/builtin/native-local-mock.js.map +1 -1
- package/dist/src/providers/builtin/script.d.ts +11 -15
- package/dist/src/providers/builtin/script.js +566 -104
- package/dist/src/providers/builtin/script.js.map +1 -1
- package/dist/src/providers/builtin/slack.d.ts +6 -0
- package/dist/src/providers/builtin/slack.js +99 -40
- package/dist/src/providers/builtin/slack.js.map +1 -1
- package/dist/src/providers/builtin/telegram.d.ts +6 -0
- package/dist/src/providers/builtin/telegram.js +64 -43
- package/dist/src/providers/builtin/telegram.js.map +1 -1
- package/dist/src/providers/builtin/whatsapp.d.ts +28 -8
- package/dist/src/providers/builtin/whatsapp.js +567 -30
- package/dist/src/providers/builtin/whatsapp.js.map +1 -1
- package/dist/src/providers/builtin/zalo.js +30 -19
- package/dist/src/providers/builtin/zalo.js.map +1 -1
- package/dist/src/providers/catalog.d.ts +3 -3
- package/dist/src/providers/catalog.js +3 -3
- package/dist/src/providers/catalog.js.map +1 -1
- package/dist/src/providers/local-mock.d.ts +11 -2
- package/dist/src/providers/local-mock.js +322 -96
- package/dist/src/providers/local-mock.js.map +1 -1
- package/dist/src/providers/native-ids.d.ts +1 -0
- package/dist/src/providers/native-ids.js +6 -1
- package/dist/src/providers/native-ids.js.map +1 -1
- package/dist/src/providers/recorder.d.ts +30 -2
- package/dist/src/providers/recorder.js +539 -70
- package/dist/src/providers/recorder.js.map +1 -1
- package/dist/src/providers/registry.d.ts +25 -1
- package/dist/src/providers/registry.js +280 -40
- package/dist/src/providers/registry.js.map +1 -1
- package/dist/src/providers/signed-jwt.d.ts +29 -0
- package/dist/src/providers/signed-jwt.js +202 -0
- package/dist/src/providers/signed-jwt.js.map +1 -0
- package/dist/src/providers/slack-ids.js.map +1 -1
- package/dist/src/providers/target-normalizers.d.ts +26 -0
- package/dist/src/providers/target-normalizers.js +276 -0
- package/dist/src/providers/target-normalizers.js.map +1 -0
- package/dist/src/providers/types.d.ts +5 -0
- package/dist/src/providers/types.js.map +1 -1
- package/dist/src/providers/webhook-server.d.ts +2 -0
- package/dist/src/providers/webhook-server.js +72 -25
- package/dist/src/providers/webhook-server.js.map +1 -1
- package/dist/src/servers/http.d.ts +23 -3
- package/dist/src/servers/http.js +213 -20
- package/dist/src/servers/http.js.map +1 -1
- package/dist/src/servers/index.js +20 -21
- package/dist/src/servers/index.js.map +1 -1
- package/dist/src/servers/matrix.d.ts +2 -0
- package/dist/src/servers/matrix.js +466 -52
- package/dist/src/servers/matrix.js.map +1 -1
- package/dist/src/servers/mattermost.d.ts +7 -0
- package/dist/src/servers/mattermost.js +307 -59
- package/dist/src/servers/mattermost.js.map +1 -1
- package/dist/src/servers/pending-events.d.ts +2 -0
- package/dist/src/servers/pending-events.js +11 -0
- package/dist/src/servers/pending-events.js.map +1 -0
- package/dist/src/servers/recorder.d.ts +12 -0
- package/dist/src/servers/recorder.js +51 -0
- package/dist/src/servers/recorder.js.map +1 -0
- package/dist/src/servers/signal.d.ts +4 -0
- package/dist/src/servers/signal.js +445 -57
- package/dist/src/servers/signal.js.map +1 -1
- package/dist/src/servers/slack.d.ts +7 -0
- package/dist/src/servers/slack.js +516 -50
- package/dist/src/servers/slack.js.map +1 -1
- package/dist/src/servers/telegram.d.ts +113 -0
- package/dist/src/servers/telegram.js +814 -155
- package/dist/src/servers/telegram.js.map +1 -1
- package/dist/src/servers/webhook-target.d.ts +40 -0
- package/dist/src/servers/webhook-target.js +349 -0
- package/dist/src/servers/webhook-target.js.map +1 -0
- package/dist/src/servers/websocket.d.ts +2 -0
- package/dist/src/servers/websocket.js +29 -0
- package/dist/src/servers/websocket.js.map +1 -0
- package/dist/src/servers/whatsapp-baileys-websocket.d.ts +65 -1
- package/dist/src/servers/whatsapp-baileys-websocket.js +723 -99
- package/dist/src/servers/whatsapp-baileys-websocket.js.map +1 -1
- package/dist/src/servers/whatsapp-jid.d.ts +5 -0
- package/dist/src/servers/whatsapp-jid.js +32 -0
- package/dist/src/servers/whatsapp-jid.js.map +1 -0
- package/dist/src/servers/whatsapp-wire/binary-node.d.ts +5 -0
- package/dist/src/servers/whatsapp-wire/binary-node.js +87 -20
- package/dist/src/servers/whatsapp-wire/binary-node.js.map +1 -1
- package/dist/src/servers/whatsapp-wire/crypto.d.ts +6 -1
- package/dist/src/servers/whatsapp-wire/crypto.js +99 -45
- package/dist/src/servers/whatsapp-wire/crypto.js.map +1 -1
- package/dist/src/servers/whatsapp-wire/handshake.js +39 -4
- package/dist/src/servers/whatsapp-wire/handshake.js.map +1 -1
- package/dist/src/servers/whatsapp-wire/signal.js.map +1 -1
- package/dist/src/servers/whatsapp.d.ts +14 -7
- package/dist/src/servers/whatsapp.js +272 -110
- package/dist/src/servers/whatsapp.js.map +1 -1
- package/dist/src/servers/zalo.d.ts +16 -0
- package/dist/src/servers/zalo.js +524 -91
- package/dist/src/servers/zalo.js.map +1 -1
- package/docs/channel-setup.md +197 -19
- package/fixtures/examples/crabline.example.yaml +10 -0
- package/package.json +20 -15
package/README.md
CHANGED
|
@@ -86,10 +86,18 @@ Provider ids are local profile names. Fixtures reference them through
|
|
|
86
86
|
`provider`. Built-in adapters infer their platform from `adapter`; `platform` is
|
|
87
87
|
required only for `adapter: script`.
|
|
88
88
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
89
|
+
Most built-in provider credentials are optional mock metadata. The WhatsApp
|
|
90
|
+
webhook requires `appSecret` and `verifyToken` because every verification or
|
|
91
|
+
delivery request is authenticated. `doctor` checks explicit `env` declarations,
|
|
92
|
+
script command availability, and config shape without requiring live platform
|
|
93
|
+
credentials.
|
|
94
|
+
|
|
95
|
+
When configured, Discord `publicKey`, Feishu `encryptKey`, Google Chat endpoint
|
|
96
|
+
or Pub/Sub identity settings, Microsoft Teams `appId`, Slack `signingSecret`,
|
|
97
|
+
Telegram `secretToken`, and Zalo `webhookSecret` enforce provider-native
|
|
98
|
+
webhook authentication. Feishu `verificationToken` remains an additional or
|
|
99
|
+
loopback-only callback check. Microsoft Teams also requires `appId` for
|
|
100
|
+
non-loopback or explicitly public webhook endpoints.
|
|
93
101
|
|
|
94
102
|
## Built-In Mock Channels
|
|
95
103
|
|
|
@@ -116,8 +124,13 @@ The built-in providers are:
|
|
|
116
124
|
- `whatsapp`
|
|
117
125
|
- `zalo`
|
|
118
126
|
|
|
119
|
-
The `script` adapter can bridge any
|
|
120
|
-
commands for `probe`, `send`,
|
|
127
|
+
The `script` adapter can bridge any OpenClaw channel represented by the
|
|
128
|
+
configured `platform` enum by running local commands for `probe`, `send`,
|
|
129
|
+
`waitForInbound`, or `watch`.
|
|
130
|
+
|
|
131
|
+
Treat manifests that configure `adapter: script` as executable, trusted code:
|
|
132
|
+
Crabline runs their declared commands with the configured environment. Load
|
|
133
|
+
them only from sources you trust and review changes before use.
|
|
121
134
|
|
|
122
135
|
## Local Provider Servers
|
|
123
136
|
|
|
@@ -125,6 +138,11 @@ commands for `probe`, `send`, `waitForInbound`, or `watch`.
|
|
|
125
138
|
preferred Smoke CI path because OpenClaw still uses its normal channel adapter,
|
|
126
139
|
but the provider endpoint is local and deterministic.
|
|
127
140
|
|
|
141
|
+
Library callers can pass `onEvent` to `startCrablineServer`, an individual
|
|
142
|
+
provider server, or `startOpenClawCrablineAdapter`. Crabline awaits the callback
|
|
143
|
+
after appending each API/admin event to `recorderPath`, so callers can react in
|
|
144
|
+
process while retaining the JSONL artifact as durable evidence.
|
|
145
|
+
|
|
128
146
|
Mattermost:
|
|
129
147
|
|
|
130
148
|
```bash
|
|
@@ -238,7 +256,7 @@ provided. The inbound endpoint rejects requests without the matching admin
|
|
|
238
256
|
header (or `Authorization: Bearer <token>`).
|
|
239
257
|
|
|
240
258
|
Implemented Telegram Bot API endpoints include `getMe`, `sendMessage`,
|
|
241
|
-
`sendPhoto`, `sendDocument`, `sendVideo`, `sendAnimation`, `editMessageText`,
|
|
259
|
+
`sendPhoto`, `sendDocument`, `sendVideo`, `sendAudio`, `sendAnimation`, `editMessageText`,
|
|
242
260
|
`deleteMessage`, `setMessageReaction`, `createForumTopic`, `editForumTopic`,
|
|
243
261
|
`pinChatMessage`, `unpinChatMessage`, `getUpdates`, `deleteWebhook`,
|
|
244
262
|
`setWebhook`, `setMyCommands`, `deleteMyCommands`, `sendChatAction`, and
|
|
@@ -252,31 +270,36 @@ crabline --json serve whatsapp --ready-file .crabline/whatsapp-server.json
|
|
|
252
270
|
|
|
253
271
|
The JSON manifest contains:
|
|
254
272
|
|
|
255
|
-
- `endpoints.apiRoot`:
|
|
273
|
+
- `endpoints.apiRoot`: versioned WhatsApp Graph API root
|
|
274
|
+
- `endpoints.phoneNumberUrl`: provider-native phone-number resource
|
|
256
275
|
- `endpoints.baileysWebSocketUrl`: Baileys-compatible WebSocket URL for
|
|
257
276
|
`waWebSocketUrl`, including the local provider access token query parameter
|
|
258
277
|
- `accessToken`: bearer token for local provider requests
|
|
259
278
|
- `adminToken`: send this as the `X-Crabline-Admin-Token` header when posting
|
|
260
279
|
test user messages
|
|
261
|
-
- `selfJid`: local authenticated WhatsApp user JID
|
|
262
|
-
|
|
263
|
-
- `env.
|
|
264
|
-
- `env.
|
|
265
|
-
|
|
266
|
-
- `env.
|
|
267
|
-
Baileys WebSocket stanzas
|
|
268
|
-
- `env.CRABLINE_WHATSAPP_SELF_JID`: local authenticated WhatsApp user JID
|
|
280
|
+
- `selfJid`: canonical local authenticated WhatsApp user JID; legacy `@c.us`
|
|
281
|
+
input is normalized to `@s.whatsapp.net`
|
|
282
|
+
- `env.CLOUD_API_ACCESS_TOKEN`: same value as `accessToken`
|
|
283
|
+
- `env.CLOUD_API_VERSION`: Graph API version used by the local server
|
|
284
|
+
- `env.WA_BASE_URL`: local Graph API origin
|
|
285
|
+
- `env.WA_PHONE_NUMBER_ID`: local sender phone-number resource ID
|
|
269
286
|
- `endpoints.adminInboundUrl`: authenticated POST endpoint for test user
|
|
270
287
|
messages using the WhatsApp Business webhook payload shape
|
|
271
|
-
- `endpoints.messagesUrl`:
|
|
272
|
-
- `endpoints.
|
|
288
|
+
- `endpoints.messagesUrl`: provider-native Cloud API message and status endpoint
|
|
289
|
+
- `endpoints.statusUrl`: alias for the same provider-native status endpoint
|
|
273
290
|
- `recorderPath`: JSONL file of local provider API/admin traffic and Baileys
|
|
274
291
|
WebSocket stanzas
|
|
275
292
|
|
|
276
293
|
Pass `endpoints.baileysWebSocketUrl` to Baileys as `waWebSocketUrl` when a
|
|
277
|
-
runtime needs to connect through the local provider.
|
|
294
|
+
runtime needs to connect through the local provider. Cloud API-compatible
|
|
295
|
+
clients can send text messages through
|
|
296
|
+
`POST /v25.0/<phone-number-id>/messages` with a bearer token. The local server completes
|
|
278
297
|
the Baileys Noise handshake, serves bootstrap/device/prekey queries, and records
|
|
279
|
-
encrypted outbound WebSocket stanzas.
|
|
298
|
+
encrypted outbound WebSocket stanzas. Direct `msg` and `pkmsg` text sends are
|
|
299
|
+
also recorded as normalized accepted-send evidence for the OpenClaw bridge.
|
|
300
|
+
Group outbound uses sender-key `skmsg` encryption and is outside this supported
|
|
301
|
+
subset, so OpenClaw Crabline outbound targets are direct users only. Group
|
|
302
|
+
inbound injection remains supported. The WebSocket endpoint rejects clients
|
|
280
303
|
that do not present the access token embedded in the manifest URL. The admin
|
|
281
304
|
token is generated randomly unless `--admin-token <token>` is provided.
|
|
282
305
|
|
|
@@ -306,7 +329,8 @@ single-update long polling through `getUpdates`, `sendMessage`, `sendPhoto`,
|
|
|
306
329
|
`sendChatAction`, and webhook registration, inspection, and deletion. These Bot
|
|
307
330
|
API methods accept GET query parameters or POST requests. Admin
|
|
308
331
|
ingress injects a native Zalo update into the active polling or webhook
|
|
309
|
-
transport.
|
|
332
|
+
transport. Webhook delivery posts the native `{ event_name, message }` update
|
|
333
|
+
directly. OpenClaw-specific endpoint, config, and target mapping remain in the
|
|
310
334
|
isolated bridge.
|
|
311
335
|
|
|
312
336
|
The admin ingress accepts JSON like:
|
|
@@ -335,6 +359,7 @@ Thread targets use the platform's native thread identifier:
|
|
|
335
359
|
|
|
336
360
|
```yaml
|
|
337
361
|
target:
|
|
362
|
+
id: "C1234567890"
|
|
338
363
|
channelId: "C1234567890"
|
|
339
364
|
threadId: "1700000000.000100"
|
|
340
365
|
```
|
|
@@ -345,7 +370,7 @@ Examples:
|
|
|
345
370
|
- Slack threads: `1700000000.000100`
|
|
346
371
|
- Telegram chats: `-1001234567890` or `@channelusername`
|
|
347
372
|
- Telegram topics: `42`
|
|
348
|
-
- WhatsApp users: `15551234567
|
|
373
|
+
- WhatsApp Cloud API users: digits-only `wa_id` values such as `15551234567`
|
|
349
374
|
- WhatsApp groups: `120363001234567890@g.us`
|
|
350
375
|
- Discord channels and threads: Discord snowflake ids such as
|
|
351
376
|
`123456789012345678`
|
|
@@ -393,6 +418,11 @@ and `agent` modes, the local mock also records a deterministic assistant reply:
|
|
|
393
418
|
live service latency, external credentials, webhooks exposed to the internet, or
|
|
394
419
|
provider SDK state.
|
|
395
420
|
|
|
421
|
+
Recorder files remain JSONL. Individual events use one object per line; an
|
|
422
|
+
accepted multi-message webhook is committed as one versioned batch object so
|
|
423
|
+
readers never observe a partial batch. Crabline's recorder APIs flatten those
|
|
424
|
+
batch objects back into their individual events.
|
|
425
|
+
|
|
396
426
|
## More Setup Detail
|
|
397
427
|
|
|
398
428
|
See [Channel Setup](docs/channel-setup.md) for the provider matrix, webhook
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 420" role="img" aria-labelledby="title desc">
|
|
2
|
+
<title id="title">Crabline deterministic channel QA</title>
|
|
3
|
+
<desc id="desc">A coral crab crossing a cyan test waveform over a dark navy background.</desc>
|
|
4
|
+
<defs>
|
|
5
|
+
<linearGradient id="bg" x1="0" x2="1" y1="0" y2="1"><stop stop-color="#07192c"/><stop offset="1" stop-color="#102f43"/></linearGradient>
|
|
6
|
+
<linearGradient id="wave" x1="0" x2="1"><stop stop-color="#00e5cc"/><stop offset="1" stop-color="#ffb347"/></linearGradient>
|
|
7
|
+
</defs>
|
|
8
|
+
<rect width="1200" height="420" rx="28" fill="url(#bg)"/>
|
|
9
|
+
<path d="M40 300h140l35-100 45 155 48-120 44 65h160l38-88 46 118 46-75 38 45h300" fill="none" stroke="url(#wave)" stroke-linecap="round" stroke-linejoin="round" stroke-width="10" opacity=".85"/>
|
|
10
|
+
<g transform="translate(120 88)" fill="none" stroke="#ff6f4d" stroke-linecap="round" stroke-linejoin="round" stroke-width="12">
|
|
11
|
+
<path d="M85 102c-42-32-71-36-102-16m102 30c-46 0-76 15-104 48m230-62c42-32 71-36 102-16m-102 30c46 0 76 15 104 48"/>
|
|
12
|
+
<path d="M78 150c-32 30-44 61-35 92m192-92c32 30 44 61 35 92"/>
|
|
13
|
+
<ellipse cx="160" cy="122" rx="88" ry="68" fill="#ff6f4d"/>
|
|
14
|
+
<circle cx="126" cy="95" r="9" fill="#07192c" stroke="none"/><circle cx="194" cy="95" r="9" fill="#07192c" stroke="none"/>
|
|
15
|
+
<path d="M131 134c18 15 40 15 58 0"/>
|
|
16
|
+
</g>
|
|
17
|
+
<text x="470" y="145" fill="#fff" font-family="ui-monospace, SFMono-Regular, Menlo, monospace" font-size="64" font-weight="700">crabline</text>
|
|
18
|
+
<text x="474" y="205" fill="#9ddbd5" font-family="ui-sans-serif, system-ui, sans-serif" font-size="26">deterministic messaging-channel QA</text>
|
|
19
|
+
<text x="474" y="255" fill="#ffcf86" font-family="ui-sans-serif, system-ui, sans-serif" font-size="22">local mocks · provider APIs · reproducible evidence</text>
|
|
20
|
+
</svg>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"crabline.js","sourceRoot":"","sources":["../../../src/bin/crabline.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE3C,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AAC5C,IAAI,QAAQ,KAAK,CAAC,EAAE,CAAC;IACnB,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC;AAC9B,CAAC"}
|
|
1
|
+
{"version":3,"file":"crabline.js","sourceRoot":"","sources":["../../../src/bin/crabline.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE3C,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AAC5C,IAAI,QAAQ,KAAK,CAAC,EAAE,CAAC;IACnB,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC;AAC9B,CAAC","sourcesContent":["#!/usr/bin/env node\n\nimport { runCli } from \"../cli/program.js\";\n\nconst exitCode = await runCli(process.argv);\nif (exitCode !== 0) {\n process.exitCode = exitCode;\n}\n"]}
|
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
import { Command } from "commander";
|
|
2
|
+
import { createRegistry } from "../providers/registry.js";
|
|
3
|
+
import { type StartCrablineServerParams, type StartedCrablineServer } from "../servers/index.js";
|
|
2
4
|
type SetExitCode = (code: number) => void;
|
|
3
|
-
export
|
|
5
|
+
export type ReadyFileIdentity = {
|
|
6
|
+
birthtimeNs: bigint;
|
|
7
|
+
ctimeNs: bigint;
|
|
8
|
+
dev: bigint;
|
|
9
|
+
ino: bigint;
|
|
10
|
+
size: bigint;
|
|
11
|
+
};
|
|
12
|
+
type ProgramDependencies = {
|
|
13
|
+
acquireReadyFileLease?: (filePath: string) => Promise<() => Promise<void>>;
|
|
14
|
+
createRegistry?: typeof createRegistry;
|
|
15
|
+
publishReadyFile?: (filePath: string, contents: string) => Promise<ReadyFileIdentity>;
|
|
16
|
+
removeReadyFile?: (filePath: string, expectedContents: string, expectedIdentity: ReadyFileIdentity) => Promise<void>;
|
|
17
|
+
startServer?: (params: StartCrablineServerParams) => Promise<StartedCrablineServer>;
|
|
18
|
+
};
|
|
19
|
+
export declare function createProgram(setExitCode?: SetExitCode, dependencies?: ProgramDependencies): Command;
|
|
20
|
+
type ShutdownSignal = "SIGINT" | "SIGTERM";
|
|
21
|
+
type SignalTarget = {
|
|
22
|
+
on(event: ShutdownSignal, listener: () => void): unknown;
|
|
23
|
+
removeListener(event: ShutdownSignal, listener: () => void): unknown;
|
|
24
|
+
};
|
|
25
|
+
export declare function publishReadyFile(filePath: string, contents: string): Promise<ReadyFileIdentity>;
|
|
26
|
+
export declare function removeReadyFile(filePath: string, expectedContents: string, expectedIdentity: ReadyFileIdentity): Promise<void>;
|
|
27
|
+
export declare function waitForShutdown(close: () => Promise<void>, signalTarget?: SignalTarget): Promise<void>;
|
|
4
28
|
export declare function runCli(argv: string[]): Promise<number>;
|
|
5
29
|
export {};
|