zilmate 1.9.1 → 1.9.3

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 CHANGED
@@ -1,503 +1,358 @@
1
- # ZilMate
2
-
3
- ZilMate is a CLI-first general assistant with deep built-in ZiloShift expertise. It can chat, answer support questions, draft posts, research docs/web sources, generate image assets, and use Composio for external app tools such as GitHub, Gmail, Slack, Notion, Stripe, and Supabase.
4
-
5
- ZilMate can also work with local files inside safe configured roots: search files/folders, read text files, write approved files, create folders, move/copy/rename, summarize documents, compare folder snapshots for changes, and find duplicate or large files. Sensitive files such as `.env`, keys, credentials, and token-looking paths are blocked.
6
-
7
- It can also use approved desktop context: read/write clipboard text, take screenshots, open the laptop camera for a still photo, and analyze screenshots/photos with `google/gemini-3.1-flash-lite` by default. Screenshot analysis describes visible UI, extracts visible text when possible, identifies errors or unusual states, and can optionally search the web for troubleshooting context. Camera photo analysis describes visible objects, environments, documents, devices, or issues without identifying people or inferring sensitive traits.
8
-
9
- The GitHub project can remain `zilo-manager`, but the installable npm package and command are both `zilmate`.
10
-
11
- ## Install ZilMate
12
-
13
- ### Published npm package
14
-
15
- After the package is published to npm:
16
-
17
- ```powershell
18
- npm install -g zilmate
19
- zilmate setup
20
- zilmate --help
21
- ```
22
-
23
- Running `zilmate` with no arguments opens the status dashboard and then the guided launcher menu. If the AI Gateway key is missing, the launcher offers setup before starting chat.
24
-
25
- When a new CLI/SDK release is published, users can update without remembering npm commands:
26
-
27
- ```powershell
28
- zilmate update
29
- zilmate version
30
- ```
31
-
32
- ### GitHub/private install
33
-
34
- Before npm publishing, install directly from the GitHub repo:
35
-
36
- ```powershell
37
- npm install -g github:zester4/zilo-manager
38
- zilmate setup
39
- zilmate --help
40
- ```
41
-
42
- ### Windows installer helper
43
-
44
- From PowerShell, the helper can install from GitHub by default:
45
-
46
- ```powershell
47
- iwr https://raw.githubusercontent.com/zester4/zilo-manager/main/install.ps1 | iex
48
- ```
49
-
50
- The installer runs the full first-use flow:
51
-
52
- 1. Installs ZilMate globally.
53
- 2. Runs `zilmate setup` to collect `AI_GATEWAY_API_KEY`.
54
- 3. Lets users skip optional Composio, Tavily, Redis, background jobs, QStash, and trigger workflows.
55
- 4. Runs `zilmate ping` to verify the key.
56
- 5. Starts `zilmate talk`.
57
-
58
- To install without setup:
59
-
60
- ```powershell
61
- iex "& { $((iwr -UseBasicParsing https://raw.githubusercontent.com/zester4/zilo-manager/main/install.ps1).Content) } -NoSetup"
62
- ```
63
-
64
- To skip ping or chat startup:
65
-
66
- ```powershell
67
- iex "& { $((iwr -UseBasicParsing https://raw.githubusercontent.com/zester4/zilo-manager/main/install.ps1).Content) } -NoPing -NoTalk"
68
- ```
69
-
70
- To install from npm after publishing:
71
-
72
- ```powershell
73
- iex "& { $((iwr -UseBasicParsing https://raw.githubusercontent.com/zester4/zilo-manager/main/install.ps1).Content) } -Source npm"
74
- ```
75
-
76
- The helper checks for Node/npm, runs `npm install -g`, prints `zilmate --help`, starts setup unless `-NoSetup` is passed, verifies auth unless `-NoPing` is passed, and starts chat unless `-NoTalk` is passed.
77
-
78
- ## Setup
79
-
80
- 1. Install dependencies:
81
-
82
- ```powershell
83
- npm install
84
- ```
85
-
86
- 2. Create `.env` from `.env.example`:
87
-
88
- The easiest path is:
89
-
90
- ```powershell
91
- zilmate setup
92
- ```
93
-
94
- Before asking for secrets, setup shows what to have ready:
95
-
96
- - Required: AI Gateway key.
97
- - Optional app tools: Composio key.
98
- - Optional web research: Tavily key.
99
- - Optional cloud memory/jobs: Upstash Redis URL and token.
100
- - Optional hosted schedules: QStash token and public webhook URL.
101
- - Optional realtime voice: Deepgram key.
102
- - Optional camera capture: `ffmpeg` installed on PATH.
103
-
104
- Then it asks for `AI_GATEWAY_API_KEY` and guides users through optional features:
105
-
106
- - Composio external app tools.
107
- - Tavily web research.
108
- - Upstash Redis memory/job storage.
109
- - Local background jobs and schedules.
110
- - Upstash QStash hosted schedules.
111
- - Composio trigger-to-job workflows.
112
- - Deepgram realtime voice mode.
113
- - Local file tool roots.
114
- - Screenshot/photo vision model.
115
- - Camera dependency and device setup.
116
-
117
- Every optional feature can be skipped. If users only want chat, they only need the AI Gateway key.
118
-
119
- Voice can be managed without opening `.env`:
120
-
121
- ```powershell
122
- zilmate voice setup
123
- zilmate voice enable
124
- zilmate voice disable
125
- zilmate voice doctor
126
- zilmate voice devices
127
- zilmate voice live
128
- ```
129
-
130
- Inside `zilmate talk`, use `/voice` to start a live terminal voice session. Speak naturally, then press Enter to stop voice and return to typed chat:
131
-
132
- ```text
133
- /voice
134
- ```
135
-
136
- You can also create `.env` manually:
137
-
138
- ```env
139
- AI_GATEWAY_API_KEY=your_vercel_ai_gateway_key
140
- COMPOSIO_API_KEY=your_composio_key
141
- ZILMATE_USER_ID=zilmate-generated-local-user-id
142
- TAVILY_API_KEY=your_tavily_key
143
- UPSTASH_REDIS_REST_URL=
144
- UPSTASH_REDIS_REST_TOKEN=
145
- ZILMATE_JOBS_ENABLED=false
146
- UPSTASH_QSTASH_TOKEN=
147
- ZILMATE_PUBLIC_JOB_WEBHOOK_URL=
148
- ZILMATE_JOB_WEBHOOK_SECRET=
149
- ZILMATE_TRIGGER_WORKFLOWS_ENABLED=false
150
- DEEPGRAM_API_KEY=
151
- ZILMATE_VOICE_ENABLED=false
152
- ZILMATE_VOICE_MODE=agent
153
- ZILMATE_VOICE_LISTEN_MODEL=flux-general-en
154
- ZILMATE_VOICE_LISTEN_VERSION=v2
155
- ZILMATE_VOICE_TTS_MODEL=aura-2-thalia-en
156
- ZILMATE_VOICE_LANGUAGE=en
157
- ZILMATE_VOICE_LANGUAGE_HINTS=
158
- ZILMATE_VOICE_BARGE_IN=true
159
- ZILMATE_VOICE_INPUT_DEVICE=
160
- ZILMATE_SCREENSHOT_MODEL=google/gemini-3.1-flash-lite
161
- ZILMATE_CAMERA_DEVICE=
162
- ZILMATE_FILE_ROOTS=
163
- ZILO_MANAGER_MODEL=minimax/minimax-m3
164
- ZILO_HELP_MODEL=alibaba/qwen3.7-plus
165
- ZILO_POST_MODEL=alibaba/qwen3.7-plus
166
- ZILO_IMAGE_DEFAULT_PROVIDER=openai
167
- ZILO_IMAGE_OPENAI_MODEL=openai/gpt-image-2
168
- ZILO_IMAGE_GEMINI_MODEL=google/gemini-3-pro-image
169
- ZILO_IMAGE_MODEL=
170
- ```
171
-
172
- Composio is optional. If `COMPOSIO_API_KEY` is set, ZilMate creates a stable local `ZILMATE_USER_ID`, reuses Composio sessions per chat session, and lets Composio manage app auth links and connected accounts.
173
-
174
- Redis is optional. If `UPSTASH_REDIS_REST_URL` and `UPSTASH_REDIS_REST_TOKEN` are set, chat turns, scratchpads, and Composio session ids use Redis. If they are missing, ZilMate falls back to local files under `.zilo-manager/`.
175
-
176
- Background jobs are optional. Setup explains the difference between local jobs and hosted schedules. Local jobs and local schedules run while `zilmate jobs worker` is running. They do not keep running after a laptop sleeps, shuts down, or loses internet. For hosted schedules that can fire while the local machine is closed, configure QStash plus a public job webhook URL.
177
-
178
- Realtime voice is optional. If `DEEPGRAM_API_KEY` and `ZILMATE_VOICE_ENABLED=true` are set, ZilMate uses Deepgram Flux for listening/end-of-turn, routes transcripts through the ZilMate manager/tools/subagents, and speaks replies with Deepgram Aura-2 websocket TTS. The default listen model is `flux-general-en` with `v2`. The default spoken voice is `aura-2-thalia-en`. Terminal live voice uses `ffmpeg` for microphone capture and `ffplay` for spoken replies. If the default microphone is not detected, run `zilmate voice devices`, then set `ZILMATE_VOICE_INPUT_DEVICE`.
179
-
180
- Use `zilmate voice setup` for a focused voice-only wizard. Use `zilmate voice enable` and `zilmate voice disable` to toggle voice later without editing config files.
181
-
182
- Camera capture is optional. During `zilmate setup`, ZilMate checks for `ffmpeg`, asks before installing it, and then runs a camera readiness check. If the automatic installer is not available, setup keeps going and tells the user to run `zilmate camera doctor`.
183
-
184
- Local file tools are optional. During setup, users can keep the default current-folder access or add comma-separated roots through `ZILMATE_FILE_ROOTS`.
185
-
186
- For unattended setup or installers, pass the options directly:
187
-
188
- ```powershell
189
- zilmate setup --yes --ai-gateway-key <key> --jobs-enabled true
190
- zilmate setup --yes --ai-gateway-key <key> --composio-key <key> --trigger-workflows-enabled true
191
- zilmate setup --yes --ai-gateway-key <key> --qstash-token <token> --job-webhook-url https://example.com/api/zilmate/jobs
192
- zilmate setup --yes --ai-gateway-key <key> --voice-enabled true --deepgram-key <key>
193
- zilmate setup --yes --ai-gateway-key <key> --voice-input-device "audio=Microphone Array"
194
- zilmate setup --yes --ai-gateway-key <key> --install-camera-deps true
195
- zilmate setup --yes --ai-gateway-key <key> --camera-device "video=Integrated Camera"
196
- zilmate setup --yes --ai-gateway-key <key> --file-roots "C:\Users\me\Documents,C:\work"
197
- zilmate setup --yes --ai-gateway-key <key> --screenshot-model google/gemini-3.1-flash-lite
198
- ```
199
-
200
- ## Development Commands
201
-
202
- Use these while working inside the project folder:
203
-
204
- ```powershell
205
- npm run build
206
- npm run zilmate -- --help
207
- npm run zilmate -- setup
208
- npm run zilmate -- doctor
209
- npm run zilmate -- config
210
- npm run zilmate -- models
211
- npm run zilmate -- apps status
212
- npm run zilmate -- triggers listen
213
- npm run zilmate -- triggers types github
214
- npm run zilmate -- triggers list
215
- npm run zilmate -- jobs create "Research today's priority updates and summarize them"
216
- npm run zilmate -- jobs list
217
- npm run zilmate -- jobs worker --once
218
- npm run zilmate -- voice doctor
219
- npm run zilmate -- voice setup
220
- npm run zilmate -- voice disable
221
- npm run zilmate -- voice enable
222
- npm run zilmate -- voice turn "What should I focus on today?"
223
- npm run zilmate -- remember "Prefers concise support replies"
224
- npm run zilmate -- recall support
225
- npm run zilmate -- memory list
226
- npm run zilmate -- talk
227
- npm run zilmate -- talk --session launch
228
- npm run zilmate -- help "why can't a worker apply?"
229
- npm run zilmate -- post "WhatsApp status for workers in Accra"
230
- npm run zilmate -- research "Vercel AI SDK ToolLoopAgent"
231
- npm run zilmate -- image --model openai --size 1024x1024 "ZiloShift launch poster for Ghana workers"
232
- npm run zilmate -- image --model gemini "ZiloShift launch poster for Ghana workers"
233
- npm run zilmate -- manager "Create a plan for helping venues post shifts"
234
- ```
235
-
236
- Shortcut:
237
-
238
- ```powershell
239
- npm run talk
240
- npm run doctor
241
- ```
242
-
243
- ## Global CLI
244
-
245
- For local development, link the command from this folder:
246
-
247
- ```powershell
248
- npm run build
249
- npm link
250
- ```
251
-
252
- Then use ZilMate directly:
253
-
254
- ```powershell
255
- zilmate --help
256
- zilmate setup
257
- zilmate doctor
258
- zilmate update
259
- zilmate version
260
- zilmate env check
261
- zilmate config
262
- zilmate talk
263
- zilmate ping
264
- zilmate models
265
- zilmate apps status
266
- zilmate triggers listen
267
- zilmate triggers types github
268
- zilmate triggers create GITHUB_BRANCH_CREATED_TRIGGER --dry-run --owner zester4 --repo zilo-manager
269
- zilmate triggers create GITHUB_COMMIT_EVENT --owner zester4 --repo zilo-manager
270
- zilmate triggers list
271
- zilmate jobs create "Research today's priority updates and summarize them"
272
- zilmate jobs create "Prepare my weekday morning briefing" --schedule "daily"
273
- zilmate jobs list
274
- zilmate jobs status job_xxx
275
- zilmate jobs logs job_xxx
276
- zilmate jobs run job_xxx
277
- zilmate jobs worker
278
- zilmate jobs cancel job_xxx
279
- zilmate voice doctor
280
- zilmate voice config
281
- zilmate voice setup
282
- zilmate voice disable
283
- zilmate voice enable
284
- zilmate voice turn "Plan my next two hours"
285
- zilmate voice devices
286
- zilmate voice live
287
- zilmate voice agent-probe
288
- zilmate camera doctor
289
- zilmate camera list
290
- zilmate camera capture
291
- zilmate camera capture --device "video=Integrated Camera"
292
- zilmate remember "Use a warm but concise support tone"
293
- zilmate recall support
294
- zilmate memory list
295
- zilmate help "worker cannot see shifts"
296
- zilmate image --model openai --size 1024x1024 "ZiloShift launch poster"
297
- ```
298
-
299
- ## Server SDK
300
-
301
- ZilMate can also be used as a server-side SDK inside apps, dashboards, API routes, and background jobs. The SDK is server-only because it uses API keys, local/Redis memory, Tavily, Composio, and AI Gateway credentials.
302
-
303
- ```ts
304
- import { createZilMate } from 'zilmate/server';
305
-
306
- const zilmate = createZilMate({
307
- sessionId: 'support-ticket-123',
308
- });
309
-
310
- const result = await zilmate.chat({
311
- message: 'Plan my day, then help me draft a ZiloShift worker update.',
312
- });
313
-
314
- console.log(result.text);
315
- ```
316
-
317
- In Next.js, call ZilMate from an API route or server action, then connect your UI to that endpoint:
318
-
319
- ```ts
320
- // app/api/zilmate/route.ts
321
- import { createZilMate } from 'zilmate/server';
322
-
323
- export async function POST(req: Request) {
324
- const { message, sessionId } = await req.json();
325
- const zilmate = createZilMate({ sessionId });
326
- const result = await zilmate.chat({ message });
327
-
328
- return Response.json(result);
329
- }
330
- ```
331
-
332
- Available SDK methods:
333
-
334
- - `chat({ message })`: general personal assistant backed by the manager agent.
335
- - `manager({ message | prompt })`: explicit manager orchestration.
336
- - `help({ question | message })`: fast ZiloShift troubleshooting.
337
- - `guide({ message })`: ZiloShift workflow conversation.
338
- - `post({ prompt })`: WhatsApp/status/social copy.
339
- - `research({ query | message })`: local docs and web research.
340
- - `image({ prompt, provider, size, outputDir })`: image generation.
341
- - `remember({ text, tags })`, `recall({ query, limit })`, `listMemories()`, `forget(id)`, `clearMemories()`: durable memory helpers.
342
- - `createJob({ task, schedule, source, metadata })`, `listJobs({ status, limit })`, `getJob(id)`, `getJobLogs(id)`, `runJob(id)`, `runDueJobs()`, `handleJobWebhook({ jobId, secret }, expectedSecret)`, `cancelJob(id)`: background job and hosted webhook helpers.
343
- - `getVoiceConfig()`, `startVoiceSession({ audio, onEvent, sessionId })`: Deepgram realtime voice configuration and Agent API session helpers.
344
-
345
- For UI integrations, pass `onProgress` to render agent/tool progress and `confirm` to approve or block external write-like Composio actions.
346
-
347
- ## Command Shape
348
-
349
- - `talk`: persistent interactive chat with the main manager agent. This is the best mode for normal use and renders rich terminal Markdown.
350
- - `manager`: one-shot manager orchestration. It can delegate to subagents and use scratchpad tools.
351
- - `doctor`: check local setup, required/optional keys, Node version, memory folder, Redis completeness, and optional live Gateway/Composio status with `--live`.
352
- - `env check`: environment-readiness alias for `doctor`.
353
- - `config`: sanitized config summary without secrets.
354
- - `remember`: save durable long-term memory.
355
- - `recall`: search durable long-term memory.
356
- - `forget`: delete one memory by id, or use `--all`.
357
- - `memory list`: list saved durable memories.
358
- - `apps status`: show whether Composio is configured, the local `ZILMATE_USER_ID`, the current Composio session id, and connected/available toolkit status when the SDK can fetch it.
359
- - `triggers listen`: stream Composio trigger events into the terminal until Ctrl+C.
360
- - `triggers types [toolkit]`: list available trigger types, optionally for one toolkit.
361
- - `triggers info <trigger>`: show trigger config and payload schemas.
362
- - `triggers create <trigger> --flag value`: create a trigger instance; unknown flags become trigger config.
363
- - `triggers list`: list trigger instances.
364
- - `jobs create "<task>"`: queue a background job, optionally with `--schedule "daily"` or `--schedule "every 15 minutes"`.
365
- - `jobs list`: list queued/running/completed jobs.
366
- - `jobs status <id>`: inspect one job.
367
- - `jobs logs <id>`: inspect job progress, output, and errors.
368
- - `jobs run <id>`: run a queued job immediately.
369
- - `jobs worker`: run the local job processor and local scheduler.
370
- - `jobs cancel <id>`: cancel one job.
371
- - `camera doctor`: check OS, ffmpeg availability, detected camera devices, and fallback candidates.
372
- - `camera list`: list camera device names ZilMate can try.
373
- - `camera capture`: capture one still image, with retry across common device names unless `--device` is provided.
374
- - `help`: fast troubleshooting and app guidance.
375
- - `chat`: one-shot natural dialogue about ZiloShift workflows.
376
- - `post`: WhatsApp/status/social copy generation.
377
- - `research`: local docs, allowlisted docs, Tavily search/extract/map/crawl/deep research, and sourced summaries.
378
- - `image`: Gateway image generation that saves files under `outputs/images/`. Use `--model openai|chatgpt|gemini` and optionally `--size 1024x1024` for OpenAI.
379
- - `models`: selected models, Gateway availability warnings, and active memory backend.
380
- - `ping`: tiny Gateway text call to verify auth.
381
- - `setup`: interactive `.env` setup for the required AI Gateway key, optional Composio external app tools, optional Tavily search, optional Redis memory, and model defaults.
382
-
383
- ## Agent Architecture
384
-
385
- ZilMate uses a manager agent that delegates to focused subagents and external tools:
386
-
387
- - Quick Help: short troubleshooting and app usage guidance.
388
- - Chat: broader ZiloShift workflow conversation.
389
- - Post: launch messages, WhatsApp statuses, captions, and outreach copy.
390
- - Research: local Zilo docs first, then external docs/web research when needed.
391
- - Image: image generation through Gateway image models.
392
- - Automation Planner: background jobs, schedules, trigger workflows, QStash/webhook planning, monitoring, and follow-up automations.
393
- - Personal Assistant: daily planning, reminders, briefings, prioritization, follow-ups, summaries, and memory-aware organization.
394
- - Developer Helper: CLI/SDK usage, Next.js integration, publishing, QStash, Cloudflare tunnels, webhooks, Composio setup, and debugging.
395
- - Composio: external app discovery, auth links, schemas, and execution, attached only to the manager.
396
- - Memory: durable ZilMate facts and preferences saved locally or in Redis, available through CLI commands and manager tools.
397
- - Jobs: background task creation, schedule setup, status checks, logs, and cancellation available through CLI, SDK, and manager tools.
398
- - Files: local file search, safe reading, approved writes, folder creation, move/copy/rename, document summaries, folder-change snapshots, and duplicate/large-file audits.
399
- - Desktop: approved clipboard access, screenshot capture, laptop camera still capture, and Gemini-powered screenshot/photo understanding. Ask naturally inside `zilmate talk`, such as "look at my screen and explain the error", "look through my camera and describe this device", "search this folder for billing docs", or "copy that command to my clipboard".
400
-
401
- Camera capture requires `ffmpeg` on PATH. On Windows, install with `winget install Gyan.FFmpeg`; on macOS, use `brew install ffmpeg`; on Linux, install `ffmpeg` from your package manager. Run `zilmate camera doctor` to verify OS support and `zilmate camera list` to get exact device names. If Windows reports a custom camera name, set `ZILMATE_CAMERA_DEVICE=video=Your Camera Name` or pass `--device "video=Your Camera Name"`. Clipboard, screenshot, and camera access always ask for approval in agent mode, and can be approved for the current session with `s=session`.
402
-
403
- Local ZiloShift docs live under `src/doc/`. ZilMate reads them on demand through dedicated tools instead of dumping all docs into every prompt. The manager prefers these local docs for ZiloShift support, worker, venue, payment, verification, SMS, and dispute questions.
404
-
405
- ## External Apps With Composio
406
-
407
- Run setup and add a Composio key:
408
-
409
- ```powershell
410
- zilmate setup
411
- zilmate apps status
412
- ```
413
-
414
- In `zilmate talk`, ask for the external task naturally. If an account is not connected yet, ZilMate uses Composio connection tools and prints the connect link returned by Composio. ZilMate does not implement custom OAuth flows.
415
-
416
- Read/search/schema/auth-link tools can run without confirmation. Write-like external app actions such as create, update, delete, send, post, publish, invite, transfer, charge, refund, cancel, approve, revoke, workbench, or bash require `Proceed? (y/N)` in the terminal. In noninteractive mode, write-like actions are blocked.
417
-
418
- ## Trigger Events
419
-
420
- For live terminal events, use Composio trigger listening:
421
-
422
- ```powershell
423
- zilmate triggers types github
424
- zilmate triggers create GITHUB_COMMIT_EVENT --owner zester4 --repo zilo-manager
425
- zilmate triggers listen
426
- ```
427
-
428
- `listen` streams matching trigger events until Ctrl+C. Use filters when needed:
429
-
430
- ```powershell
431
- zilmate triggers listen --toolkit gmail
432
- zilmate triggers listen --trigger ti_abc123
433
- zilmate triggers listen --trigger-slug GMAIL_NEW_EMAIL_EVENT --once
434
- ```
435
-
436
- This is terminal-local. When `ZILMATE_TRIGGER_WORKFLOWS_ENABLED=true`, trigger events handled by `zilmate triggers listen` also create background jobs. ZilMate includes generic workflow prompts for Gmail, GitHub, Slack, and calendar-style events, and falls back to a general external-app summary task for other toolkits.
437
-
438
- The manager agent also has trigger tools. In `zilmate talk`, you can ask:
439
-
440
- ```text
441
- show me GitHub trigger types
442
- prepare a branch-created trigger for zester4/zilo-manager
443
- create that trigger
444
- ```
445
-
446
- ZilMate should discover current trigger slugs first, inspect the trigger schema, prefer a dry-run payload, and ask for confirmation before creating a real trigger.
447
-
448
- ## Background Jobs And Schedules
449
-
450
- Use jobs when ZilMate should keep working after a chat turn ends:
451
-
452
- ```powershell
453
- zilmate jobs create "Research AI assistant scheduling patterns and save a summary"
454
- zilmate jobs create "Prepare my morning briefing" --schedule daily
455
- zilmate jobs worker
456
- ```
457
-
458
- Local job storage uses `.zilo-manager/jobs.json` and `.zilo-manager/job-logs.json` unless Redis is configured. With Redis, jobs and logs use the same Upstash REST connection as memory.
459
-
460
- Schedules supported locally include `hourly`, `daily`, `every 15 minutes`, `every 2 hours`, `every 1 day`, and ISO date/time strings. QStash schedules can use `cron:<expression>` when `UPSTASH_QSTASH_TOKEN` and `ZILMATE_PUBLIC_JOB_WEBHOOK_URL` are configured.
461
-
462
- Hosted apps can expose a webhook route and call:
463
-
464
- ```ts
465
- import { createZilMate } from 'zilmate/server';
466
-
467
- export async function POST(req: Request) {
468
- const body = await req.json();
469
- const zilmate = createZilMate();
470
- const result = await zilmate.handleJobWebhook(
471
- { jobId: body.jobId, secret: req.headers.get('ZilMate-Webhook-Secret') ?? undefined },
472
- process.env.ZILMATE_JOB_WEBHOOK_SECRET,
473
- );
474
-
475
- return Response.json(result);
476
- }
477
- ```
478
-
479
- ## Model Notes
480
-
481
- - Manager/orchestration default: `minimax/minimax-m3`.
482
- - Recommended help/post override: `alibaba/qwen3.7-plus` in `.env`.
483
- - If help/post env vars are blank, ZilMate falls back to the internal cheap-model list in `src/config/models.ts`.
484
- - Default image provider: OpenAI GPT Image 2 via `openai/gpt-image-2` and AI SDK `generateImage`.
485
- - Alternate image provider: Gemini 3 Pro Image via `google/gemini-3-pro-image` and `generateText` file outputs.
486
- - GPT-2 is not used for images.
487
-
488
- ## Research And Memory
489
-
490
- - Zilo docs are searched/read locally first for product behavior.
491
- - Tavily powers web search, URL extraction, site mapping, small capped crawls, and deep research.
492
- - Web crawling and deep research are intentionally heavier tools and should be used only when local docs/search are not enough.
493
- - Scratchpads keep intermediate notes outside the main prompt context.
494
- - Long-term memory stores stable preferences and durable project facts. Use `zilmate remember`, `zilmate recall`, `zilmate forget`, and `zilmate memory list`.
495
- - `zilmate talk` automatically recalls relevant long-term memories for each message.
496
- - Redis is optional; local file memory is the fallback.
497
- - `zilmate setup` creates or updates the local `.env` used by the CLI.
498
-
499
- ## Safety Notes
500
-
501
- ZilMate can guide, research, draft, generate assets, and run approved external app actions through Composio. It should not claim that live external or ZiloShift data changed unless a tool result confirms it.
502
-
503
- Before adding real actions around payments, identity, SMS, users, or admin operations, add stronger permission levels, confirmation gates, audit logs, and behavioral evals.
1
+ # <p align="center">🤖 ZilMate</p>
2
+
3
+ <p align="center">
4
+ <b>Production-Grade Multi-Agent AI Swarm, Real-Time Voice Controller, and Webhook Job Scheduler</b>
5
+ </p>
6
+
7
+ <p align="center">
8
+ <img src="https://img.shields.io/badge/version-1.9.1-blue.svg?style=flat-square" alt="Version">
9
+ <img src="https://img.shields.io/badge/node-%3E%3D20.0.0-green.svg?style=flat-square" alt="Node Engine">
10
+ <img src="https://img.shields.io/badge/platform-windows%20%7C%20macos%20%7C%20linux-lightgrey.svg?style=flat-square" alt="Platform Support">
11
+ <img src="https://img.shields.io/badge/license-ISC-orange.svg?style=flat-square" alt="License">
12
+ </p>
13
+
14
+ ---
15
+
16
+ ZilMate is a CLI-first general assistant with deep built-in ZiloShift expertise. It can chat, answer support questions, draft posts, research docs/web sources, generate image assets, and use Composio for external app tools such as GitHub, Gmail, Slack, Notion, Stripe, and Supabase.
17
+
18
+ ZilMate can also work with local files inside safe configured roots: search files/folders, read text files, write approved files, create folders, move/copy/rename, summarize documents, compare folder snapshots for changes, and find duplicate or large files. Sensitive files such as `.env`, keys, credentials, and token-looking paths are blocked.
19
+
20
+ It can also use approved desktop context: read/write clipboard text, take screenshots, open the laptop camera for a still photo, and analyze screenshots/photos with `google/gemini-3.1-flash-lite` by default. Screenshot analysis describes visible UI, extracts visible text when possible, identifies errors or unusual states, and can optionally search the web for troubleshooting context. Camera photo analysis describes visible objects, environments, documents, devices, or issues without identifying people or inferring sensitive traits.
21
+
22
+ The GitHub project can remain `zilo-manager`, but the installable npm package and command are both `zilmate`.
23
+
24
+ ---
25
+
26
+ ## 🚀 Key Features & Capabilities
27
+
28
+ - **Hierarchical Swarm Architecture** — Powered by a Manager Agent (CEO) that delegates to a Digital Corporation (COO), coordinating 7 Departments and 30+ Specialized Subagents for precise, high-fidelity business planning.
29
+ - **Zero-Config Webhook Tunneling** — Automates background webhook listeners using **Upstash QStash**. Features a built-in automated **Cloudflare Tunnel** binary (`cloudflared`) downloader for platform-specific runtimes (`windows`, `macOS`, `linux`).
30
+ - **Interactive Safety Checklists** — Replaced basic text prompts with a premium interactive terminal UI (in TTY). Navigate via arrow keys and toggle checkboxes to filter and approve critical system and write-like app actions.
31
+ - **Bottom-Pinned Thinking Status Card** — High-feedback console loaders and elapsed timers remain perfectly pinned to the bottom of the console whileSpecialist logs scroll smoothly above them.
32
+ - **High-Fidelity Document Generation** — In-house layout engine producing styled corporate reports with hanging list indents, stable alternating row tables, and character boundaries spacing.
33
+
34
+ ---
35
+
36
+ ## 📦 Installation & Getting Started
37
+
38
+ ### 1. Published NPM Package
39
+
40
+ After the package is published to npm, install globally:
41
+
42
+ ```powershell
43
+ npm install -g zilmate
44
+ zilmate setup
45
+ zilmate --help
46
+ ```
47
+
48
+ > [!NOTE]
49
+ > Running `zilmate` with no arguments opens the status dashboard and then the guided launcher menu. If the AI Gateway key is missing, the launcher offers setup before starting chat.
50
+
51
+ When a new CLI/SDK release is published, update easily using:
52
+
53
+ ```powershell
54
+ zilmate update
55
+ zilmate version
56
+ ```
57
+
58
+ ### 2. Private GitHub Install
59
+
60
+ Before npm publishing, install directly from the GitHub repository:
61
+
62
+ ```powershell
63
+ npm install -g github:zester4/zilo-manager
64
+ zilmate setup
65
+ zilmate --help
66
+ ```
67
+
68
+ ### 3. Windows PowerShell Installer Wizard
69
+
70
+ From PowerShell, run the automatic installer helper to trigger the complete first-use pipeline:
71
+
72
+ ```powershell
73
+ iwr https://raw.githubusercontent.com/zester4/zilo-manager/main/install.ps1 | iex
74
+ ```
75
+
76
+ The installer performs the following flow:
77
+ 1. Installs ZilMate globally on your machine.
78
+ 2. Runs `zilmate setup` to collect `AI_GATEWAY_API_KEY`.
79
+ 3. Offers a guided workflow to configure Composio, Tavily, Redis, background jobs, QStash, and trigger workflows.
80
+ 4. Runs `zilmate ping` to verify the key.
81
+ 5. Automatically starts `zilmate talk`.
82
+
83
+ **Custom Installer Parameters:**
84
+
85
+ * Install without launching the guided setup:
86
+ ```powershell
87
+ iex "& { $((iwr -UseBasicParsing https://raw.githubusercontent.com/zester4/zilo-manager/main/install.ps1).Content) } -NoSetup"
88
+ ```
89
+ * Skip Gateway ping verification or instant chat launch:
90
+ ```powershell
91
+ iex "& { $((iwr -UseBasicParsing https://raw.githubusercontent.com/zester4/zilo-manager/main/install.ps1).Content) } -NoPing -NoTalk"
92
+ ```
93
+ * Force install from NPM instead of GitHub:
94
+ ```powershell
95
+ iex "& { $((iwr -UseBasicParsing https://raw.githubusercontent.com/zester4/zilo-manager/main/install.ps1).Content) } -Source npm"
96
+ ```
97
+
98
+ ---
99
+
100
+ ## 🛠️ Configuration & Setup
101
+
102
+ ### 1. Automated Setup Wizard
103
+
104
+ Install project workspace dependencies and run the guided installer:
105
+
106
+ ```powershell
107
+ npm install
108
+ zilmate setup
109
+ ```
110
+
111
+ The wizard prompts you for critical credentials. Have these keys ready:
112
+ * **Required**: AI Gateway API Key (`AI_GATEWAY_API_KEY`).
113
+ * **External Apps**: Composio API Key (`COMPOSIO_API_KEY`).
114
+ * **Web Research**: Tavily API Key (`TAVILY_API_KEY`).
115
+ * **Cloud Memory & Schedulers**: Upstash Redis REST URL and Token.
116
+ * **Hosted Background Webhooks**: Upstash QStash Token and Public Job Webhook URL.
117
+ * **Realtime Voice**: Deepgram API Key (`DEEPGRAM_API_KEY`).
118
+ * **Camera Capture**: `ffmpeg` installed on system path (setup can install this for you).
119
+
120
+ > [!TIP]
121
+ > Every optional feature can be skipped. If you only want basic chat, you only need the AI Gateway Key.
122
+
123
+ ### 2. Real-Time Voice Configuration
124
+
125
+ ZilMate supports hands-free natural voice dialog. Manage voice features directly:
126
+
127
+ ```powershell
128
+ zilmate voice setup
129
+ zilmate voice enable
130
+ zilmate voice disable
131
+ zilmate voice doctor
132
+ zilmate voice devices
133
+ zilmate voice live
134
+ ```
135
+
136
+ Inside typed chat (`zilmate talk`), enter `/voice` to launch a hands-free microphone cycle:
137
+ ```text
138
+ /voice
139
+ ```
140
+
141
+ ### 3. Manual `.env` Template
142
+
143
+ Create a `.env` file at your workspace root with the following configuration:
144
+
145
+ ```env
146
+ AI_GATEWAY_API_KEY=your_vercel_ai_gateway_key
147
+ COMPOSIO_API_KEY=your_composio_key
148
+ ZILMATE_USER_ID=zilmate-generated-local-user-id
149
+ TAVILY_API_KEY=your_tavily_key
150
+ UPSTASH_REDIS_REST_URL=
151
+ UPSTASH_REDIS_REST_TOKEN=
152
+ ZILMATE_JOBS_ENABLED=false
153
+ UPSTASH_QSTASH_TOKEN=
154
+ ZILMATE_PUBLIC_JOB_WEBHOOK_URL=
155
+ ZILMATE_JOB_WEBHOOK_SECRET=
156
+ ZILMATE_TRIGGER_WORKFLOWS_ENABLED=false
157
+ DEEPGRAM_API_KEY=
158
+ ZILMATE_VOICE_ENABLED=false
159
+ ZILMATE_VOICE_MODE=agent
160
+ ZILMATE_VOICE_LISTEN_MODEL=flux-general-en
161
+ ZILMATE_VOICE_LISTEN_VERSION=v2
162
+ ZILMATE_VOICE_TTS_MODEL=aura-2-thalia-en
163
+ ZILMATE_VOICE_LANGUAGE=en
164
+ ZILMATE_VOICE_LANGUAGE_HINTS=
165
+ ZILMATE_VOICE_BARGE_IN=true
166
+ ZILMATE_VOICE_INPUT_DEVICE=
167
+ ZILMATE_SCREENSHOT_MODEL=google/gemini-3.1-flash-lite
168
+ ZILMATE_CAMERA_DEVICE=
169
+ ZILMATE_FILE_ROOTS=
170
+ ZILO_MANAGER_MODEL=minimax/minimax-m3
171
+ ZILO_HELP_MODEL=alibaba/qwen3.7-plus
172
+ ZILO_POST_MODEL=alibaba/qwen3.7-plus
173
+ ZILO_IMAGE_DEFAULT_PROVIDER=openai
174
+ ZILO_IMAGE_OPENAI_MODEL=openai/gpt-image-2
175
+ ZILO_IMAGE_GEMINI_MODEL=google/gemini-3-pro-image
176
+ ZILO_IMAGE_MODEL=
177
+ ```
178
+
179
+ - **Composio** is optional. If set, ZilMate registers a stable local user session and generates app OAuth auth links automatically.
180
+ - **Redis** is optional. If configured, chat sessions, scratchpads, and Composio state use Upstash Redis. Otherwise, they fallback locally under `.zilo-manager/`.
181
+ - **Background Jobs** can run locally or via QStash. Local scheduler workers (`zilmate jobs worker`) run while your terminal is active. For serverless background triggers that execute even when your local machine is asleep, configure QStash plus a public job webhook.
182
+ - **Camera capture** requires `ffmpeg` on your `PATH`. On Windows, install using `winget install Gyan.FFmpeg`; on macOS, use `brew install ffmpeg`. Run `zilmate camera doctor` to verify system support.
183
+
184
+ ### 4. Non-Interactive CLI Setup Flags
185
+
186
+ For automation pipelines, pass arguments directly:
187
+
188
+ ```powershell
189
+ zilmate setup --yes --ai-gateway-key <key> --jobs-enabled true
190
+ zilmate setup --yes --ai-gateway-key <key> --composio-key <key> --trigger-workflows-enabled true
191
+ zilmate setup --yes --ai-gateway-key <key> --qstash-token <token> --job-webhook-url https://example.com/api/zilmate/jobs
192
+ zilmate setup --yes --ai-gateway-key <key> --voice-enabled true --deepgram-key <key>
193
+ zilmate setup --yes --ai-gateway-key <key> --voice-input-device "audio=Microphone Array"
194
+ zilmate setup --yes --ai-gateway-key <key> --install-camera-deps true
195
+ zilmate setup --yes --ai-gateway-key <key> --camera-device "video=Integrated Camera"
196
+ zilmate setup --yes --ai-gateway-key <key> --file-roots "C:\Users\me\Documents,C:\work"
197
+ zilmate setup --yes --ai-gateway-key <key> --screenshot-model google/gemini-3.1-flash-lite
198
+ ```
199
+
200
+ ---
201
+
202
+ ## 📂 Command Matrix & Reference
203
+
204
+ ### Local Development Commands
205
+
206
+ Use these scripts when working directly inside the cloned repository directory:
207
+
208
+ ```bash
209
+ npm run build # Compile TypeScript to dist/
210
+ npm run zilmate -- --help # Show global help usage
211
+ npm run zilmate -- setup # Launch interactive setup
212
+ npm run zilmate -- doctor # Run local environment check
213
+ npm run zilmate -- config # View active configs (sanitized)
214
+ npm run zilmate -- models # Query active AI model routing
215
+ npm run zilmate -- apps status # List connected Composio tools
216
+ npm run zilmate -- triggers listen # Start local event stream
217
+ npm run zilmate -- triggers types github # List webhook trigger events
218
+ npm run zilmate -- jobs create "Summary update" # Create background automation
219
+ npm run zilmate -- jobs list # Show active background jobs
220
+ npm run zilmate -- jobs worker --once # Execute outstanding schedules
221
+ npm run zilmate -- voice doctor # Check Deepgram and microphone audio
222
+ npm run zilmate -- voice setup # Setup voice parameters
223
+ npm run zilmate -- voice turn "What's my status?" # Run one-shot voice query
224
+ npm run zilmate -- remember "Prefers concise replies" # Add durable vector memory
225
+ npm run zilmate -- recall support # Search durable vector memories
226
+ npm run zilmate -- talk # Open the main interactive chat
227
+ ```
228
+
229
+ ### Global CLI Commands
230
+
231
+ If globally linked (`npm link`), execute the `zilmate` CLI directly:
232
+
233
+ ```powershell
234
+ zilmate --help
235
+ zilmate setup
236
+ zilmate doctor
237
+ zilmate update
238
+ zilmate version
239
+ zilmate config
240
+ zilmate talk
241
+ zilmate ping
242
+ zilmate models
243
+ zilmate apps status
244
+ zilmate triggers listen
245
+ zilmate triggers types github
246
+ zilmate triggers create GITHUB_BRANCH_CREATED_TRIGGER --dry-run --owner zester4 --repo zilo-manager
247
+ zilmate triggers create GITHUB_COMMIT_EVENT --owner zester4 --repo zilo-manager
248
+ zilmate triggers list
249
+ zilmate jobs create "Research today's priority updates and summarize them"
250
+ zilmate jobs create "Prepare my weekday morning briefing" --schedule "daily"
251
+ zilmate jobs list
252
+ zilmate jobs status job_xxx
253
+ zilmate jobs logs job_xxx
254
+ zilmate jobs run job_xxx
255
+ zilmate jobs worker
256
+ zilmate jobs cancel job_xxx
257
+ zilmate voice doctor
258
+ zilmate voice config
259
+ zilmate voice setup
260
+ zilmate voice disable
261
+ zilmate voice enable
262
+ zilmate voice turn "Plan my next two hours"
263
+ zilmate voice devices
264
+ zilmate voice live
265
+ zilmate voice agent-probe
266
+ zilmate camera doctor
267
+ zilmate camera list
268
+ zilmate camera capture
269
+ zilmate camera capture --device "video=Integrated Camera"
270
+ zilmate remember "Use a warm but concise support tone"
271
+ zilmate recall support
272
+ zilmate memory list
273
+ zilmate help "worker cannot see shifts"
274
+ zilmate image --model openai --size 1024x1024 "ZiloShift launch poster"
275
+ ```
276
+
277
+ ---
278
+
279
+ ## 💻 Server-Side SDK
280
+
281
+ ZilMate can be integrated as a backend SDK inside Next.js, Node servers, or dashboard API routes.
282
+
283
+ ```typescript
284
+ import { createZilMate } from 'zilmate/server';
285
+
286
+ const zilmate = createZilMate({
287
+ sessionId: 'user-session-123',
288
+ });
289
+
290
+ // Execute structured chat
291
+ const result = await zilmate.chat({
292
+ message: 'Draft a project roadmap based on the current workspace context.',
293
+ });
294
+
295
+ console.log(result.text);
296
+ ```
297
+
298
+ ### Next.js API Route Integration
299
+
300
+ ```typescript
301
+ // app/api/zilmate/route.ts
302
+ import { createZilMate } from 'zilmate/server';
303
+
304
+ export async function POST(req: Request) {
305
+ const { message, sessionId } = await req.json();
306
+ const zilmate = createZilMate({ sessionId });
307
+ const result = await zilmate.chat({ message });
308
+
309
+ return Response.json(result);
310
+ }
311
+ ```
312
+
313
+ ### SDK Public Methods Reference
314
+
315
+ - `chat({ message })` — Primary interactive assistant backed by the supervisor Manager agent.
316
+ - `manager({ message | prompt })` — Explicit manager-level swarming and planning execution.
317
+ - `help({ question | message })` High-speed product troubleshooting.
318
+ - `guide({ message })` — Interactive guided workflow tutorial.
319
+ - `post({ prompt })` — Generates optimized marketing status, caption, and social outreach copy.
320
+ - `research({ query | message })` — Double-tier search (local repository documents + Tavily deep-web research).
321
+ - `image({ prompt, provider, size, outputDir })` Generates image assets via Vercel AI SDK.
322
+ - `remember({ text, tags })`, `recall({ query, limit })` — Save and retrieve facts from Upstash Redis or local memory.
323
+ - `createJob({ task, schedule, source, metadata })`, `runDueJobs()` — Queue, schedule, and run background automation jobs.
324
+
325
+ ---
326
+
327
+ ## 🏛️ Swarm Departmental Architecture
328
+
329
+ ZilMate organizes complex business pipelines by splitting responsibilities among **7 Departments** and **30+ Specialists**:
330
+
331
+ ```text
332
+ 💼 Supervisor Manager (CEO)
333
+ └── ⚙️ Digital Corporation (COO)
334
+ ├── 📊 Strategy & Planning Department
335
+ ├── 💻 Software Engineering Department
336
+ ├── 📈 Growth & Marketing Department
337
+ ├── 📋 General Operations Department
338
+ ├── 🗄️ Data Analytics Department
339
+ ├── 🛡️ Security & Audits Department
340
+ └── 💰 Revenue & Finance Department
341
+ ```
342
+
343
+ * **Quick Help Agent** — High-speed, local-focused markdown troubleshooting and workflow assistance.
344
+ * **Developer Helper** — Assists with CLI setup, NPM packaging, serverless webhooks, and QStash connection tuning.
345
+ * **Composio Connector** Handles app discoveries, OAuth auth links, and action schemas.
346
+ * **Local Files Agent** — Performs safe directory audits, summarizes PDF docs, and generates git-style change snapshots within safe roots.
347
+ * **Desktop Agent** — Handshakes with OS APIs to grab clipboard contents, trigger screenshots, capture camera stills, and interpret UI using vision models.
348
+
349
+ ---
350
+
351
+ ## 🛡️ Security & Safety Guidelines
352
+
353
+ - **Sensitive File Blocklist** ZilMate automatically denies reading or exposing `.env`, API keys, private certificates, or local credentials to prevent unauthorized data exposure.
354
+ - **Granular Approvals** All write-like external app integrations (e.g. creating, updating, charging, deleting) require explicit approval via the interactive Safety Checklist.
355
+ - **Data Veracity** The AI swarm will never claim a live external state (such as payments, identity verification, or database columns) has changed unless a tool invocation returns a successful execution confirmation.
356
+
357
+ ---
358
+ *Developed as part of the ZiloShift operational intelligence ecosystem. For security reports, bug logs, and custom integration requests, please refer to [docs/README.md](docs/README.md) or open an issue.*
@@ -116,16 +116,16 @@ export declare function createAutomationPlannerAgent(): ToolLoopAgent<never, {
116
116
  limit?: number | undefined;
117
117
  }, {
118
118
  items: {
119
+ slug: string;
119
120
  name: string;
120
121
  description: string;
121
- slug: string;
122
122
  toolkit: {
123
- name: string;
124
123
  slug: string;
124
+ name: string;
125
125
  logo: string;
126
126
  };
127
- payload: Record<string, unknown>;
128
127
  config: Record<string, unknown>;
128
+ payload: Record<string, unknown>;
129
129
  version?: string | undefined;
130
130
  instructions?: string | undefined;
131
131
  }[];
@@ -135,16 +135,16 @@ export declare function createAutomationPlannerAgent(): ToolLoopAgent<never, {
135
135
  showTriggerType: import("ai").Tool<{
136
136
  triggerSlug: string;
137
137
  }, {
138
+ slug: string;
138
139
  name: string;
139
140
  description: string;
140
- slug: string;
141
141
  toolkit: {
142
- name: string;
143
142
  slug: string;
143
+ name: string;
144
144
  logo: string;
145
145
  };
146
- payload: Record<string, unknown>;
147
146
  config: Record<string, unknown>;
147
+ payload: Record<string, unknown>;
148
148
  version?: string | undefined;
149
149
  instructions?: string | undefined;
150
150
  }>;
@@ -1 +1 @@
1
- {"version":3,"file":"automation-planner.agent.d.ts","sourceRoot":"","sources":["../../src/agents/automation-planner.agent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,aAAa,EAAE,MAAM,IAAI,CAAC;AAUhD,wBAAgB,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBA2By8uG,CAAC;wBAAsC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBAAz2S,CAAC;uBAAqC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAD1t8F"}
1
+ {"version":3,"file":"automation-planner.agent.d.ts","sourceRoot":"","sources":["../../src/agents/automation-planner.agent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,aAAa,EAAE,MAAM,IAAI,CAAC;AAUhD,wBAAgB,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBA2B2ssG,CAAC;wBAAsC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBAArnS,CAAC;uBAAqC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UADht6F"}
@@ -655,16 +655,16 @@ export declare function createManagerAgent(runId?: string, options?: {
655
655
  limit?: number | undefined;
656
656
  }, {
657
657
  items: {
658
+ slug: string;
658
659
  name: string;
659
660
  description: string;
660
- slug: string;
661
661
  toolkit: {
662
- name: string;
663
662
  slug: string;
663
+ name: string;
664
664
  logo: string;
665
665
  };
666
- payload: Record<string, unknown>;
667
666
  config: Record<string, unknown>;
667
+ payload: Record<string, unknown>;
668
668
  version?: string | undefined;
669
669
  instructions?: string | undefined;
670
670
  }[];
@@ -674,16 +674,16 @@ export declare function createManagerAgent(runId?: string, options?: {
674
674
  showTriggerType: import("ai").Tool<{
675
675
  triggerSlug: string;
676
676
  }, {
677
+ slug: string;
677
678
  name: string;
678
679
  description: string;
679
- slug: string;
680
680
  toolkit: {
681
- name: string;
682
681
  slug: string;
682
+ name: string;
683
683
  logo: string;
684
684
  };
685
- payload: Record<string, unknown>;
686
685
  config: Record<string, unknown>;
686
+ payload: Record<string, unknown>;
687
687
  version?: string | undefined;
688
688
  instructions?: string | undefined;
689
689
  }>;
@@ -1 +1 @@
1
- {"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../../src/agents/manager.ts"],"names":[],"mappings":"AACA,OAAO,EAAqB,aAAa,EAAE,MAAM,IAAI,CAAC;AAiBtD,OAAO,EAAgB,KAAK,aAAa,EAAwB,MAAM,wBAAwB,CAAC;AAChG,OAAO,EAAE,KAAK,mBAAmB,EAA2B,MAAM,uBAAuB,CAAC;AA2B1F,OAAO,EAAkB,KAAK,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAqLpE,wBAAsB,kBAAkB,CAAC,KAAK,GAAE,MAAqB,EAAE,OAAO,GAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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MAAM,EAAE,CAAC;IACvB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB,CAAC;AAEF,wBAAsB,oBAAoB,IAAI,OAAO,CAAC,iBAAiB,CAAC,CAgCvE;AAED,wBAAgB,sBAAsB,CAAC,YAAY,EAAE,MAAM,EAAE,EAAE,SAAS,CAAC,EAAE,MAAM,UAGhF"}
@@ -1,17 +1,21 @@
1
1
  import { gateway, createGateway } from 'ai';
2
2
  import { fetch as undiciFetch, Agent } from 'undici';
3
3
  import { env } from './env.js';
4
+ // Program a single global agent dispatcher with 15-minute connection and payload timeouts.
5
+ // Reusing a single agent avoids connection pool leaks, socket exhaustion, and SSL handshake failures.
6
+ const globalDispatcher = new Agent({
7
+ headersTimeout: 15 * 60 * 1000,
8
+ bodyTimeout: 15 * 60 * 1000,
9
+ connect: {
10
+ timeout: 15 * 60 * 1000, // 15 minutes connection timeout
11
+ },
12
+ });
4
13
  // Set up global default provider with 15-minute connection and payload timeouts
5
14
  globalThis.AI_SDK_DEFAULT_PROVIDER = createGateway({
15
+ ...(env.aiGatewayApiKey ? { apiKey: env.aiGatewayApiKey } : {}),
6
16
  fetch: (url, init) => undiciFetch(url, {
7
17
  ...init,
8
- dispatcher: new Agent({
9
- headersTimeout: 15 * 60 * 1000,
10
- bodyTimeout: 15 * 60 * 1000,
11
- connect: {
12
- timeout: 15 * 60 * 1000, // 15 minutes connection timeout
13
- }
14
- }),
18
+ dispatcher: globalDispatcher,
15
19
  }),
16
20
  });
17
21
  const cheapModelCandidates = [
@@ -1 +1 @@
1
- {"version":3,"file":"models.js","sourceRoot":"","sources":["../../src/config/models.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC;AAC5C,OAAO,EAAE,KAAK,IAAI,WAAW,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AACrD,OAAO,EAAE,GAAG,EAAsB,MAAM,UAAU,C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CAAC,CAAC,CAAC;IAC7G,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,6CAA6C,EAAE,EAAE,CAAC,CAAC;IAExF,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC;AAC/D,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAC,YAAsB,EAAE,SAAkB;IAC/E,IAAI,SAAS,IAAI,YAAY,CAAC,QAAQ,CAAC,SAAS,CAAC;QAAE,OAAO,SAAS,CAAC;IACpE,OAAO,oBAAoB,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,YAAY,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,IAAI,SAAS,IAAI,MAAM,CAAC,IAAI,CAAC;AAClG,CAAC"}
package/dist/index.js CHANGED
@@ -56,7 +56,7 @@ const program = new Command();
56
56
  program
57
57
  .name('zilmate')
58
58
  .description('ZilMate Agent')
59
- .version('1.9.1');
59
+ .version('1.9.3');
60
60
  program
61
61
  .command('welcome')
62
62
  .description('Show the ZilMate welcome dashboard')
@@ -4,16 +4,16 @@ export declare const triggerTools: {
4
4
  limit?: number | undefined;
5
5
  }, {
6
6
  items: {
7
+ slug: string;
7
8
  name: string;
8
9
  description: string;
9
- slug: string;
10
10
  toolkit: {
11
- name: string;
12
11
  slug: string;
12
+ name: string;
13
13
  logo: string;
14
14
  };
15
- payload: Record<string, unknown>;
16
15
  config: Record<string, unknown>;
16
+ payload: Record<string, unknown>;
17
17
  version?: string | undefined;
18
18
  instructions?: string | undefined;
19
19
  }[];
@@ -23,16 +23,16 @@ export declare const triggerTools: {
23
23
  showTriggerType: import("ai").Tool<{
24
24
  triggerSlug: string;
25
25
  }, {
26
+ slug: string;
26
27
  name: string;
27
28
  description: string;
28
- slug: string;
29
29
  toolkit: {
30
- name: string;
31
30
  slug: string;
31
+ name: string;
32
32
  logo: string;
33
33
  };
34
- payload: Record<string, unknown>;
35
34
  config: Record<string, unknown>;
35
+ payload: Record<string, unknown>;
36
36
  version?: string | undefined;
37
37
  instructions?: string | undefined;
38
38
  }>;
@@ -1 +1 @@
1
- {"version":3,"file":"triggers.tool.d.ts","sourceRoot":"","sources":["../../src/tools/triggers.tool.ts"],"names":[],"mappings":"AAcA,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;mBAqGwtpG,CAAC;wBAAsC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBAAz2S,CAAC;uBAAqC,CAAC;;;;;;;;;;;;;;;;;;;CADt92F,CAAC"}
1
+ {"version":3,"file":"triggers.tool.d.ts","sourceRoot":"","sources":["../../src/tools/triggers.tool.ts"],"names":[],"mappings":"AAcA,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;mBAqG09mG,CAAC;wBAAsC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBAArnS,CAAC;uBAAqC,CAAC;;;;;;;;;;;;;;;;;;;CAD580F,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zilmate",
3
- "version": "1.9.1",
3
+ "version": "1.9.3",
4
4
  "description": "Production-grade CLI multi-agent AI assistant, real-time voice controller, and automated background job scheduler for local and cloud environments.",
5
5
  "type": "module",
6
6
  "main": "dist/server.js",
@@ -54,8 +54,8 @@
54
54
  "@chat-adapter/slack": "^4.31.0",
55
55
  "@chat-adapter/state-memory": "^4.31.0",
56
56
  "@chat-adapter/telegram": "^4.31.0",
57
- "@composio/core": "^0.11.0",
58
- "@composio/vercel": "^0.9.3",
57
+ "@composio/core": "^0.13.1",
58
+ "@composio/vercel": "^0.11.0",
59
59
  "@daytona/sdk": "^0.190.1",
60
60
  "@deepgram/sdk": "^4.11.2",
61
61
  "@mendable/firecrawl-js": "^4.28.2",
@@ -12,7 +12,7 @@ const title = `ZilMate ${tag}`;
12
12
 
13
13
  const notes = `# ${title}
14
14
 
15
- ZilMate ${tag} — Hotfix for Undici native dispatcher type conflict in global models fetcher, along with fully automated Cloudflare Tunnel installer, rich interactive safety checklists, persistent bottom-pinned thinking card UI, high-fidelity PDF layouts, and extended gateway HTTP timeouts.
15
+ ZilMate ${tag} — Critical hotfix for Vercel AI Gateway custom fetch client to resolve connection pool leaks, socket exhaustion, and SSL handshake errors that resulted in raw 'Gateway request failed' responses.
16
16
 
17
17
  ## Install
18
18
 
@@ -25,13 +25,12 @@ zilmate menu
25
25
 
26
26
  ## Highlights
27
27
 
28
- - **CRITICAL HOTFIX: Undici Request Dispatcher Conflict** — Fixed a crucial runtime conflict between Node's native built-in global \`fetch\` and the external \`undici\` package's \`Agent\` dispatcher. Sourcing both the \`Agent\` dispatcher and \`fetch\` (as \`undiciFetch\`) from the same package completely resolves the \`invalid onRequestStart method\` runtime crash during model invocations.
29
- - **Cloudflare Tunnel Auto-Setup** — Designed a zero-configuration downloader and manager for \`cloudflared\` binary blobs (platform-specific for Windows, macOS, Linux). Automatically fetches, places, and grants execute permissions to the tunnel binary so that running \`zilmate jobs listen --tunnel\` works instantly without manual downloads.
30
- - **Interactive Safety Checklists** — Replaced raw prompt confirmation text with a rich interactive terminal TUI containing arrow-key selections and toggleable checkboxes. Safely view, toggle, and approve specific multi-specialist tool executions inline.
31
- - **Persistent Thinking Status Card** — Created an anchored, rotating thinking status widget pinned cleanly to the bottom of the terminal during chat cycles. Shows active elapsed thinking time and shortcuts while logs/conversations scroll smoothly above it.
32
- - **High-Fidelity PDF Document Generation** — Solved layout drift and text alignment issues in \`pdfkit\` document generation. Rebuilt lists to use hanging indents with multi-line wrap-margins, stabilized alternating row backgrounds in tables, and preserved boundary word spacing.
33
- - **Optimized HTTP Gateway Handshakes** — Programmed a custom \`undici\` agent configuration that extends Vercel AI SDK client connections and payload downloads up to 15 minutes globally, completely defeating socket timeout failures.
34
- - **Clean Direct Dependencies** — Pruned \`prebuild-install\` from the direct package dependencies, resolving deprecated installation warnings for cleaner global installations of \`zilmate\`.
28
+ - **CRITICAL HOTFIX: Connection Pool & Socket Leak** — Fixed an architectural issue in our Vercel AI SDK gateway fetch wrapper that created a \`new Agent\` (separate connection pool) for every single HTTP request. We now instantiate a single, reused global Undici \`Agent\` dispatcher, completely resolving socket exhaustion, TCP reset drops, and SSL handshake failures (which previously caused intermittent raw \`Gateway request failed\` errors).
29
+ - **TypeScript Type-Safety Compliance** — Adjusted the gateway setup options to spread the \`apiKey\` conditionally only when defined, fully satisfying strict compilation checks under \`exactOptionalPropertyTypes: true\`.
30
+ - **SDK Upgrade: Composio Core & Vercel Integration** — Upgraded \`@composio/core\` to \`0.13.1\` and \`@composio/vercel\` to \`0.11.0\` globally to resolve CLI deprecation warnings and inherit upstream performance and tool registry fixes.
31
+ - **Cloudflare Tunnel Auto-Setup** — Automated downloader and manager for \`cloudflared\` binary blobs across Windows, macOS, and Linux to power \`zilmate jobs listen --tunnel\` with zero manual setup.
32
+ - **Interactive Safety Checklists** — Elegant terminal TUI using checkboxes and keyboard selection to toggle approval on specific multi-specialist tool parameters during execution prompts.
33
+ - **Persistent Thinking Status Card** — Smooth rotating status card widget pinned to the bottom of the chat terminal during model inference to display elapsed time and keyboard shortcuts.
35
34
 
36
35
  ## Quick Checks
37
36