@lobu/cli 6.0.1 → 7.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -27
- package/dist/bundled-skills/lobu/SKILL.md +11 -11
- package/dist/commands/_lib/apply/apply-cmd.d.ts +38 -0
- package/dist/commands/_lib/apply/apply-cmd.d.ts.map +1 -1
- package/dist/commands/_lib/apply/apply-cmd.js +574 -40
- package/dist/commands/_lib/apply/apply-cmd.js.map +1 -1
- package/dist/commands/_lib/apply/client.d.ts +180 -1
- package/dist/commands/_lib/apply/client.d.ts.map +1 -1
- package/dist/commands/_lib/apply/client.js +308 -28
- package/dist/commands/_lib/apply/client.js.map +1 -1
- package/dist/commands/_lib/apply/desired-state.d.ts +134 -3
- package/dist/commands/_lib/apply/desired-state.d.ts.map +1 -1
- package/dist/commands/_lib/apply/desired-state.js +703 -89
- package/dist/commands/_lib/apply/desired-state.js.map +1 -1
- package/dist/commands/_lib/apply/diff.d.ts +61 -3
- package/dist/commands/_lib/apply/diff.d.ts.map +1 -1
- package/dist/commands/_lib/apply/diff.js +382 -92
- package/dist/commands/_lib/apply/diff.js.map +1 -1
- package/dist/commands/_lib/apply/prompt.d.ts +6 -0
- package/dist/commands/_lib/apply/prompt.d.ts.map +1 -1
- package/dist/commands/_lib/apply/prompt.js +16 -0
- package/dist/commands/_lib/apply/prompt.js.map +1 -1
- package/dist/commands/_lib/apply/render.d.ts +9 -0
- package/dist/commands/_lib/apply/render.d.ts.map +1 -1
- package/dist/commands/_lib/apply/render.js +80 -3
- package/dist/commands/_lib/apply/render.js.map +1 -1
- package/dist/commands/agent.d.ts +7 -0
- package/dist/commands/agent.d.ts.map +1 -1
- package/dist/commands/agent.js +65 -1
- package/dist/commands/agent.js.map +1 -1
- package/dist/commands/chat.d.ts +12 -9
- package/dist/commands/chat.d.ts.map +1 -1
- package/dist/commands/chat.js +125 -57
- package/dist/commands/chat.js.map +1 -1
- package/dist/commands/dev.d.ts +23 -7
- package/dist/commands/dev.d.ts.map +1 -1
- package/dist/commands/dev.js +197 -49
- package/dist/commands/dev.js.map +1 -1
- package/dist/commands/doctor.d.ts +1 -0
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +136 -0
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/eval.d.ts +8 -0
- package/dist/commands/eval.d.ts.map +1 -1
- package/dist/commands/eval.js +72 -6
- package/dist/commands/eval.js.map +1 -1
- package/dist/commands/init.d.ts +22 -5
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +355 -182
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/link.d.ts +11 -0
- package/dist/commands/link.d.ts.map +1 -0
- package/dist/commands/link.js +28 -0
- package/dist/commands/link.js.map +1 -0
- package/dist/commands/login.d.ts.map +1 -1
- package/dist/commands/login.js +14 -2
- package/dist/commands/login.js.map +1 -1
- package/dist/commands/memory/_lib/browser-auth-cmd.d.ts.map +1 -1
- package/dist/commands/memory/_lib/browser-auth-cmd.js +3 -3
- package/dist/commands/memory/_lib/browser-auth-cmd.js.map +1 -1
- package/dist/commands/memory/_lib/mcp.d.ts +2 -2
- package/dist/commands/memory/_lib/mcp.d.ts.map +1 -1
- package/dist/commands/memory/_lib/mcp.js +24 -12
- package/dist/commands/memory/_lib/mcp.js.map +1 -1
- package/dist/commands/memory/_lib/openclaw-auth.d.ts +1 -0
- package/dist/commands/memory/_lib/openclaw-auth.d.ts.map +1 -1
- package/dist/commands/memory/_lib/openclaw-auth.js +14 -3
- package/dist/commands/memory/_lib/openclaw-auth.js.map +1 -1
- package/dist/commands/memory/_lib/openclaw-cmd.js +1 -1
- package/dist/commands/memory/_lib/openclaw-cmd.js.map +1 -1
- package/dist/commands/memory/_lib/schema.d.ts +29 -2
- package/dist/commands/memory/_lib/schema.d.ts.map +1 -1
- package/dist/commands/memory/_lib/schema.js +121 -5
- package/dist/commands/memory/_lib/schema.js.map +1 -1
- package/dist/commands/memory/_lib/seed-cmd.d.ts.map +1 -1
- package/dist/commands/memory/_lib/seed-cmd.js +46 -24
- package/dist/commands/memory/_lib/seed-cmd.js.map +1 -1
- package/dist/commands/memory/run.d.ts.map +1 -1
- package/dist/commands/memory/run.js +2 -2
- package/dist/commands/memory/run.js.map +1 -1
- package/dist/commands/org.d.ts +4 -0
- package/dist/commands/org.d.ts.map +1 -1
- package/dist/commands/org.js +10 -0
- package/dist/commands/org.js.map +1 -1
- package/dist/commands/platforms/platform-prompts.d.ts +0 -1
- package/dist/commands/platforms/platform-prompts.d.ts.map +1 -1
- package/dist/commands/platforms/platform-prompts.js +54 -8
- package/dist/commands/platforms/platform-prompts.js.map +1 -1
- package/dist/commands/telemetry.d.ts +10 -0
- package/dist/commands/telemetry.d.ts.map +1 -0
- package/dist/commands/telemetry.js +68 -0
- package/dist/commands/telemetry.js.map +1 -0
- package/dist/commands/token.d.ts +9 -0
- package/dist/commands/token.d.ts.map +1 -1
- package/dist/commands/token.js +54 -0
- package/dist/commands/token.js.map +1 -1
- package/dist/commands/whoami.d.ts.map +1 -1
- package/dist/commands/whoami.js +1 -1
- package/dist/commands/whoami.js.map +1 -1
- package/dist/connectors/README.md +534 -0
- package/dist/connectors/__tests__/browser-scraper-utils.test.ts +186 -0
- package/dist/connectors/apple_health.ts +138 -0
- package/dist/connectors/apple_screen_time.ts +82 -0
- package/dist/connectors/browser-scraper-utils.ts +246 -0
- package/dist/connectors/capterra.ts +277 -0
- package/dist/connectors/g2.ts +290 -0
- package/dist/connectors/github.ts +1530 -0
- package/dist/connectors/glassdoor.ts +295 -0
- package/dist/connectors/gmaps.ts +197 -0
- package/dist/connectors/google_calendar.ts +641 -0
- package/dist/connectors/google_gmail.ts +754 -0
- package/dist/connectors/google_photos.ts +776 -0
- package/dist/connectors/google_play.ts +349 -0
- package/dist/connectors/hackernews.ts +471 -0
- package/dist/connectors/index.ts +28 -0
- package/dist/connectors/ios_appstore.ts +226 -0
- package/dist/connectors/linkedin.ts +494 -0
- package/dist/connectors/local_directory.ts +91 -0
- package/dist/connectors/microsoft_outlook.ts +410 -0
- package/dist/connectors/producthunt.ts +471 -0
- package/dist/connectors/reddit.ts +600 -0
- package/dist/connectors/revolut.ts +572 -0
- package/dist/connectors/rss.ts +448 -0
- package/dist/connectors/spotify.ts +590 -0
- package/dist/connectors/trustpilot.ts +203 -0
- package/dist/connectors/website.ts +629 -0
- package/dist/connectors/whatsapp.ts +1081 -0
- package/dist/connectors/whatsapp_local.ts +125 -0
- package/dist/connectors/x.ts +536 -0
- package/dist/connectors/youtube.ts +666 -0
- package/dist/db/migrations/00000000000000_baseline.sql +4867 -0
- package/dist/db/migrations/20260405193000_add_mcp_sessions.sql +33 -0
- package/dist/db/migrations/20260408120000_remove_system_connectors.sql +48 -0
- package/dist/db/migrations/20260408120001_optional_compiled_code.sql +6 -0
- package/dist/db/migrations/20260409110000_add_active_watcher_run_index.sql +9 -0
- package/dist/db/migrations/20260409130000_connector_default_config.sql +5 -0
- package/dist/db/migrations/20260410120000_add_agent_secrets.sql +25 -0
- package/dist/db/migrations/20260413170000_add_watcher_group_id.sql +67 -0
- package/dist/db/migrations/20260416120000_add_entity_wa_jid_index.sql +14 -0
- package/dist/db/migrations/20260417100000_add_entity_identities.sql +77 -0
- package/dist/db/migrations/20260418100000_add_auth_runs.sql +83 -0
- package/dist/db/migrations/20260418110000_add_runs_created_by_user.sql +18 -0
- package/dist/db/migrations/20260419120000_add_event_identity_indexes.sql +56 -0
- package/dist/db/migrations/20260420120000_extend_reserved_org_slugs.sql +56 -0
- package/dist/db/migrations/20260424030000_add_watcher_run_correlation.sql +52 -0
- package/dist/db/migrations/20260424130000_relax_events_client_id_fk.sql +47 -0
- package/dist/db/migrations/20260425100000_normalize_watcher_feedback.sql +91 -0
- package/dist/db/migrations/20260425120000_add_run_diagnostics.sql +20 -0
- package/dist/db/migrations/20260425130000_add_repair_agent_plumbing.sql +46 -0
- package/dist/db/migrations/20260426120000_entities_entity_type_fk.sql +101 -0
- package/dist/db/migrations/20260426130000_db_integrity_cleanup.sql +104 -0
- package/dist/db/migrations/20260426130001_db_integrity_cleanup_concurrent.sql +187 -0
- package/dist/db/migrations/20260427133000_events_created_by_nullable.sql +74 -0
- package/dist/db/migrations/20260427140000_identity_engine_indexes.sql +140 -0
- package/dist/db/migrations/20260427150000_drop_events_source_id.sql +177 -0
- package/dist/db/migrations/20260427160000_drop_dead_schema.sql +76 -0
- package/dist/db/migrations/20260427170000_market_founder_to_member.sql +364 -0
- package/dist/db/migrations/20260428040000_cascade_events_watchers_org_fk.sql +66 -0
- package/dist/db/migrations/20260428050000_add_runs_approved_input.sql +9 -0
- package/dist/db/migrations/20260429010000_auth_profile_tenant_scoped_fk.sql +79 -0
- package/dist/db/migrations/20260429060000_extend_runs_for_lobu_queue.sql +108 -0
- package/dist/db/migrations/20260429120000_agent_changed_notify.sql +97 -0
- package/dist/db/migrations/20260429120100_user_auth_profiles_and_model_prefs.sql +36 -0
- package/dist/db/migrations/20260429120200_fix_notify_old_keys.sql +130 -0
- package/dist/db/migrations/20260429130000_oauth_states_cli_sessions_rate_limits.sql +83 -0
- package/dist/db/migrations/20260429140000_phase8_grants_chat_connections_mcp_sessions.sql +84 -0
- package/dist/db/migrations/20260429140100_runs_priority_expires_at_retry_delay.sql +44 -0
- package/dist/db/migrations/20260429180000_drop_invalidatable_cache_triggers.sql +25 -0
- package/dist/db/migrations/20260430005614_agents_apply_fields.sql +21 -0
- package/dist/db/migrations/20260430022231_fix_connection_config_encryption.sql +69 -0
- package/dist/db/migrations/20260430151215_add_task_run_type.sql +77 -0
- package/dist/db/migrations/20260501000000_drop_cli_sessions.sql +27 -0
- package/dist/db/migrations/20260501133000_lobu_memory_mcp_id.sql +117 -0
- package/dist/db/migrations/20260502000000_drop_chat_connections.sql +60 -0
- package/dist/db/migrations/20260503000000_agent_secrets_org_scope.sql +56 -0
- package/dist/db/migrations/20260504000000_flatten_agents_drop_sandbox_model.sql +48 -0
- package/dist/db/migrations/20260510220000_connector_required_capability.sql +47 -0
- package/dist/db/migrations/20260512000000_device_worker_connection_binding.sql +113 -0
- package/dist/db/migrations/20260512131703_connections_slug.sql +131 -0
- package/dist/db/migrations/20260513000000_chat_user_identities.sql +24 -0
- package/dist/db/migrations/20260513120000_auth_profiles_device_binding.sql +50 -0
- package/dist/db/migrations/20260513150000_auth_profiles_cdp_url.sql +43 -0
- package/dist/db/migrations/20260513200000_notifications_as_events.sql +86 -0
- package/dist/db/migrations/20260514000000_scheduled_jobs.sql +97 -0
- package/dist/db/migrations/20260514120000_auth_profiles_connector_key_nullable.sql +42 -0
- package/dist/eval/types.d.ts +2 -0
- package/dist/eval/types.d.ts.map +1 -1
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +210 -132
- package/dist/index.js.map +1 -1
- package/dist/internal/api-client.d.ts +4 -8
- package/dist/internal/api-client.d.ts.map +1 -1
- package/dist/internal/api-client.js +1 -1
- package/dist/internal/api-client.js.map +1 -1
- package/dist/internal/context.js +2 -2
- package/dist/internal/context.js.map +1 -1
- package/dist/internal/credentials.d.ts.map +1 -1
- package/dist/internal/credentials.js +6 -1
- package/dist/internal/credentials.js.map +1 -1
- package/dist/internal/gateway-url.d.ts +14 -0
- package/dist/internal/gateway-url.d.ts.map +1 -1
- package/dist/internal/gateway-url.js +19 -0
- package/dist/internal/gateway-url.js.map +1 -1
- package/dist/internal/index.d.ts +3 -4
- package/dist/internal/index.d.ts.map +1 -1
- package/dist/internal/index.js +3 -3
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/oauth.d.ts +6 -5
- package/dist/internal/oauth.d.ts.map +1 -1
- package/dist/internal/oauth.js +2 -2
- package/dist/internal/project-link.d.ts +10 -0
- package/dist/internal/project-link.d.ts.map +1 -0
- package/dist/internal/project-link.js +48 -0
- package/dist/internal/project-link.js.map +1 -0
- package/dist/providers.json +2 -2
- package/dist/server.bundle.mjs +31654 -30866
- package/dist/start-local.bundle.mjs +74409 -0
- package/dist/templates/README.md.tmpl +10 -11
- package/dist/templates/TESTING.md.tmpl +9 -9
- package/package.json +15 -13
- package/dist/__tests__/chat.integration.test.d.ts +0 -2
- package/dist/__tests__/chat.integration.test.d.ts.map +0 -1
- package/dist/__tests__/chat.integration.test.js +0 -337
- package/dist/__tests__/chat.integration.test.js.map +0 -1
- package/dist/__tests__/dev.test.d.ts +0 -2
- package/dist/__tests__/dev.test.d.ts.map +0 -1
- package/dist/__tests__/dev.test.js +0 -25
- package/dist/__tests__/dev.test.js.map +0 -1
- package/dist/__tests__/init-memory.test.d.ts +0 -2
- package/dist/__tests__/init-memory.test.d.ts.map +0 -1
- package/dist/__tests__/init-memory.test.js +0 -45
- package/dist/__tests__/init-memory.test.js.map +0 -1
- package/dist/__tests__/token.test.d.ts +0 -2
- package/dist/__tests__/token.test.d.ts.map +0 -1
- package/dist/__tests__/token.test.js +0 -52
- package/dist/__tests__/token.test.js.map +0 -1
- package/dist/commands/_lib/apply/__tests__/client.test.d.ts +0 -2
- package/dist/commands/_lib/apply/__tests__/client.test.d.ts.map +0 -1
- package/dist/commands/_lib/apply/__tests__/client.test.js +0 -23
- package/dist/commands/_lib/apply/__tests__/client.test.js.map +0 -1
- package/dist/commands/_lib/apply/__tests__/desired-state.test.d.ts +0 -2
- package/dist/commands/_lib/apply/__tests__/desired-state.test.d.ts.map +0 -1
- package/dist/commands/_lib/apply/__tests__/desired-state.test.js +0 -140
- package/dist/commands/_lib/apply/__tests__/desired-state.test.js.map +0 -1
- package/dist/commands/_lib/apply/__tests__/diff.test.d.ts +0 -2
- package/dist/commands/_lib/apply/__tests__/diff.test.d.ts.map +0 -1
- package/dist/commands/_lib/apply/__tests__/diff.test.js +0 -378
- package/dist/commands/_lib/apply/__tests__/diff.test.js.map +0 -1
- package/dist/commands/apply.d.ts +0 -3
- package/dist/commands/apply.d.ts.map +0 -1
- package/dist/commands/apply.js +0 -5
- package/dist/commands/apply.js.map +0 -1
- package/dist/commands/memory/_lib/openclaw-auth.test.d.ts +0 -2
- package/dist/commands/memory/_lib/openclaw-auth.test.d.ts.map +0 -1
- package/dist/commands/memory/_lib/openclaw-auth.test.js +0 -9
- package/dist/commands/memory/_lib/openclaw-auth.test.js.map +0 -1
- package/dist/internal/__tests__/api-client.test.d.ts +0 -2
- package/dist/internal/__tests__/api-client.test.d.ts.map +0 -1
- package/dist/internal/__tests__/api-client.test.js +0 -95
- package/dist/internal/__tests__/api-client.test.js.map +0 -1
- package/dist/internal/__tests__/context.test.d.ts +0 -2
- package/dist/internal/__tests__/context.test.d.ts.map +0 -1
- package/dist/internal/__tests__/context.test.js +0 -77
- package/dist/internal/__tests__/context.test.js.map +0 -1
|
@@ -4,15 +4,13 @@ Lobu instance created with `@lobu/cli` v{{CLI_VERSION}}
|
|
|
4
4
|
|
|
5
5
|
## Quick Start
|
|
6
6
|
|
|
7
|
-
Lobu boots as a single Node process.
|
|
7
|
+
Lobu boots as a single Node process. By default `lobu run` uses local PGlite with pgvector enabled and stores data under `~/.lobu/data` (override with `LOBU_DATA_DIR`). Set `DATABASE_URL` in `.env` only when you want to use an external Postgres instead.
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
|
-
# 1.
|
|
10
|
+
# 1. Boot Lobu (gateway + workers + memory backend in one Node process)
|
|
11
|
+
lobu run # or: lobu dev / lobu start
|
|
11
12
|
|
|
12
|
-
# 2.
|
|
13
|
-
npx @lobu/cli@latest run
|
|
14
|
-
|
|
15
|
-
# 3. Stop with Ctrl+C
|
|
13
|
+
# 2. Stop with Ctrl+C
|
|
16
14
|
```
|
|
17
15
|
|
|
18
16
|
Logs go to stdout — pipe to your supervisor of choice (`pm2`, `systemd`, etc.) for production.
|
|
@@ -24,7 +22,7 @@ Pull the latest CLI to pick up gateway + worker improvements:
|
|
|
24
22
|
```bash
|
|
25
23
|
# The CLI ships the embedded backend it boots, so updating the CLI
|
|
26
24
|
# updates Lobu itself. No image pull, no compose restart.
|
|
27
|
-
|
|
25
|
+
npm i -g @lobu/cli@latest && lobu run
|
|
28
26
|
```
|
|
29
27
|
|
|
30
28
|
Compare your `.env` with the latest `.env.example` in the [Lobu repo](https://github.com/lobu-ai/lobu) when upgrading and add any new required variables.
|
|
@@ -35,20 +33,21 @@ Compare your `.env` with the latest `.env.example` in the [Lobu repo](https://gi
|
|
|
35
33
|
|
|
36
34
|
Edit `.env` to configure:
|
|
37
35
|
|
|
38
|
-
- `DATABASE_URL` — Postgres connection string (with pgvector)
|
|
36
|
+
- `DATABASE_URL` — optional external Postgres connection string (with pgvector). If unset, `lobu run` uses local PGlite.
|
|
39
37
|
- `PUBLIC_GATEWAY_URL` — Public URL for OAuth callbacks
|
|
40
38
|
- `WORKER_ALLOWED_DOMAINS` — Allowed domains for worker network access
|
|
41
39
|
|
|
42
40
|
### Platform Connections
|
|
43
41
|
|
|
44
|
-
|
|
42
|
+
If you selected a platform during `lobu init`, fill the generated platform variables in `.env` (for example `TELEGRAM_BOT_TOKEN` or `SLACK_BOT_TOKEN`) before starting Lobu. Otherwise, manage platform connections through the gateway APIs at `{PUBLIC_GATEWAY_URL}/api/v1/connections` and related auth/config endpoints.
|
|
45
43
|
|
|
46
44
|
### Worker Customization
|
|
47
45
|
|
|
48
46
|
Worker behavior is controlled by:
|
|
49
47
|
|
|
50
|
-
- `[agents.<id>.skills]` blocks in `lobu.toml` — declare MCP servers
|
|
51
|
-
- `
|
|
48
|
+
- `[agents.<id>.skills]` blocks in `lobu.toml` — declare custom MCP servers and OAuth.
|
|
49
|
+
- `[agents.<id>.tools]` blocks — configure tool visibility and MCP approval bypasses.
|
|
50
|
+
- `[agents.<id>.worker].nix_packages` — pulls binaries onto the worker's `PATH` via `nix-shell`. The worker uses [just-bash](https://github.com/nicholasgasior/just-bash) to wrap shell commands; interpreters and package managers are excluded from the allowlist by default. Set `LOBU_ALLOW_UNSANDBOXED_EXEC=1` per-agent to opt back in if you genuinely need them.
|
|
52
51
|
|
|
53
52
|
## Learn More
|
|
54
53
|
|
|
@@ -8,7 +8,7 @@ Send messages to your bot with optional file uploads.
|
|
|
8
8
|
|
|
9
9
|
### Endpoint
|
|
10
10
|
```
|
|
11
|
-
POST http://localhost:{{GATEWAY_PORT}}/api/v1/agents/{agentId}/messages
|
|
11
|
+
POST http://localhost:{{GATEWAY_PORT}}/lobu/api/v1/agents/{agentId}/messages
|
|
12
12
|
```
|
|
13
13
|
|
|
14
14
|
### Authentication
|
|
@@ -24,7 +24,7 @@ The bot token must be provided in the `Authorization` header, not in the request
|
|
|
24
24
|
|
|
25
25
|
#### JSON Request (Simple Message)
|
|
26
26
|
```bash
|
|
27
|
-
curl -X POST http://localhost:{{GATEWAY_PORT}}/api/v1/agents/{agentId}/messages \
|
|
27
|
+
curl -X POST http://localhost:{{GATEWAY_PORT}}/lobu/api/v1/agents/{agentId}/messages \
|
|
28
28
|
-H "Authorization: Bearer xoxb-your-bot-token" \
|
|
29
29
|
-H "Content-Type: application/json" \
|
|
30
30
|
-d '{
|
|
@@ -36,7 +36,7 @@ curl -X POST http://localhost:{{GATEWAY_PORT}}/api/v1/agents/{agentId}/messages
|
|
|
36
36
|
|
|
37
37
|
#### Multipart Request (With File Upload)
|
|
38
38
|
```bash
|
|
39
|
-
curl -X POST http://localhost:{{GATEWAY_PORT}}/api/v1/agents/{agentId}/messages \
|
|
39
|
+
curl -X POST http://localhost:{{GATEWAY_PORT}}/lobu/api/v1/agents/{agentId}/messages \
|
|
40
40
|
-H "Authorization: Bearer xoxb-your-bot-token" \
|
|
41
41
|
-F "platform=slack" \
|
|
42
42
|
-F "channel=C12345678" \
|
|
@@ -90,7 +90,7 @@ If you don't want to mention the bot, simply omit `@me` from your message.
|
|
|
90
90
|
### Example: Simple Text Message (with @me)
|
|
91
91
|
|
|
92
92
|
```bash
|
|
93
|
-
curl -X POST http://localhost:{{GATEWAY_PORT}}/api/v1/agents/{agentId}/messages \
|
|
93
|
+
curl -X POST http://localhost:{{GATEWAY_PORT}}/lobu/api/v1/agents/{agentId}/messages \
|
|
94
94
|
-H "Authorization: Bearer xoxb-your-bot-token" \
|
|
95
95
|
-H "Content-Type: application/json" \
|
|
96
96
|
-d '{
|
|
@@ -103,7 +103,7 @@ curl -X POST http://localhost:{{GATEWAY_PORT}}/api/v1/agents/{agentId}/messages
|
|
|
103
103
|
### Example: Without Bot Mention
|
|
104
104
|
|
|
105
105
|
```bash
|
|
106
|
-
curl -X POST http://localhost:{{GATEWAY_PORT}}/api/v1/agents/{agentId}/messages \
|
|
106
|
+
curl -X POST http://localhost:{{GATEWAY_PORT}}/lobu/api/v1/agents/{agentId}/messages \
|
|
107
107
|
-H "Authorization: Bearer xoxb-your-bot-token" \
|
|
108
108
|
-H "Content-Type: application/json" \
|
|
109
109
|
-d '{
|
|
@@ -116,7 +116,7 @@ curl -X POST http://localhost:{{GATEWAY_PORT}}/api/v1/agents/{agentId}/messages
|
|
|
116
116
|
### Example: Thread Reply
|
|
117
117
|
|
|
118
118
|
```bash
|
|
119
|
-
curl -X POST http://localhost:{{GATEWAY_PORT}}/api/v1/agents/{agentId}/messages \
|
|
119
|
+
curl -X POST http://localhost:{{GATEWAY_PORT}}/lobu/api/v1/agents/{agentId}/messages \
|
|
120
120
|
-H "Authorization: Bearer xoxb-your-bot-token" \
|
|
121
121
|
-H "Content-Type: application/json" \
|
|
122
122
|
-d '{
|
|
@@ -130,7 +130,7 @@ curl -X POST http://localhost:{{GATEWAY_PORT}}/api/v1/agents/{agentId}/messages
|
|
|
130
130
|
### Example: Single File Upload
|
|
131
131
|
|
|
132
132
|
```bash
|
|
133
|
-
curl -X POST http://localhost:{{GATEWAY_PORT}}/api/v1/agents/{agentId}/messages \
|
|
133
|
+
curl -X POST http://localhost:{{GATEWAY_PORT}}/lobu/api/v1/agents/{agentId}/messages \
|
|
134
134
|
-H "Authorization: Bearer xoxb-your-bot-token" \
|
|
135
135
|
-F "platform=slack" \
|
|
136
136
|
-F "channel=dev-channel" \
|
|
@@ -141,7 +141,7 @@ curl -X POST http://localhost:{{GATEWAY_PORT}}/api/v1/agents/{agentId}/messages
|
|
|
141
141
|
### Example: Multiple File Upload
|
|
142
142
|
|
|
143
143
|
```bash
|
|
144
|
-
curl -X POST http://localhost:{{GATEWAY_PORT}}/api/v1/agents/{agentId}/messages \
|
|
144
|
+
curl -X POST http://localhost:{{GATEWAY_PORT}}/lobu/api/v1/agents/{agentId}/messages \
|
|
145
145
|
-H "Authorization: Bearer xoxb-your-bot-token" \
|
|
146
146
|
-F "platform=slack" \
|
|
147
147
|
-F "channel=dev-channel" \
|
|
@@ -196,7 +196,7 @@ Testing a full conversation:
|
|
|
196
196
|
|
|
197
197
|
```bash
|
|
198
198
|
# Step 1: Send initial message
|
|
199
|
-
RESPONSE=$(curl -s -X POST http://localhost:{{GATEWAY_PORT}}/api/v1/agents/{agentId}/messages \
|
|
199
|
+
RESPONSE=$(curl -s -X POST http://localhost:{{GATEWAY_PORT}}/lobu/api/v1/agents/{agentId}/messages \
|
|
200
200
|
-H "Authorization: Bearer $SLACK_BOT_TOKEN" \
|
|
201
201
|
-H "Content-Type: application/json" \
|
|
202
202
|
-d '{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lobu/cli",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.0",
|
|
4
4
|
"description": "CLI for deploying and managing AI agents on Lobu",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -35,13 +35,16 @@
|
|
|
35
35
|
"@chat-adapter/teams": "4.26.0",
|
|
36
36
|
"@chat-adapter/telegram": "4.26.0",
|
|
37
37
|
"@chat-adapter/whatsapp": "4.26.0",
|
|
38
|
-
"@hono/node-server": "^1.19.9",
|
|
39
38
|
"@clack/prompts": "^1.2.0",
|
|
39
|
+
"@electric-sql/pglite": "^0.4.3",
|
|
40
|
+
"@electric-sql/pglite-socket": "^0.1.3",
|
|
41
|
+
"@hono/node-server": "^1.13.7",
|
|
40
42
|
"@hono/zod-openapi": "^1.2.1",
|
|
41
43
|
"@inquirer/prompts": "^7.10.1",
|
|
42
|
-
"@lobu/
|
|
43
|
-
"@lobu/
|
|
44
|
-
"@lobu/
|
|
44
|
+
"@lobu/connector-sdk": "7.0.0",
|
|
45
|
+
"@lobu/core": "7.0.0",
|
|
46
|
+
"@lobu/embeddings": "7.0.0",
|
|
47
|
+
"@lobu/worker": "7.0.0",
|
|
45
48
|
"@mariozechner/pi-ai": "^0.51.6",
|
|
46
49
|
"@modelcontextprotocol/sdk": "^1.27.1",
|
|
47
50
|
"@opentelemetry/api": "^1.9.0",
|
|
@@ -53,9 +56,8 @@
|
|
|
53
56
|
"@react-email/components": "^1.0.12",
|
|
54
57
|
"@react-email/render": "^2.0.7",
|
|
55
58
|
"@scalar/hono-api-reference": "^0.9.39",
|
|
56
|
-
"@sentry/node": "^
|
|
59
|
+
"@sentry/node": "^9.0.0",
|
|
57
60
|
"@sinclair/typebox": "^0.34.41",
|
|
58
|
-
"@slack/socket-mode": "^2.0.6",
|
|
59
61
|
"ajv": "^8.17.1",
|
|
60
62
|
"ajv-formats": "^3.0.1",
|
|
61
63
|
"better-auth": "^1.4.10",
|
|
@@ -63,11 +65,12 @@
|
|
|
63
65
|
"chat": "^4.26.0",
|
|
64
66
|
"commander": "^14.0.1",
|
|
65
67
|
"cron-parser": "^5.5.0",
|
|
66
|
-
"dotenv": "^
|
|
68
|
+
"dotenv": "^16.4.5",
|
|
67
69
|
"esbuild": "^0.27.0",
|
|
68
70
|
"handlebars": "^4.7.9",
|
|
69
|
-
"hono": "^4.
|
|
71
|
+
"hono": "^4.10.4",
|
|
70
72
|
"hono-pino": "^0.10.3",
|
|
73
|
+
"jimp": "^1.6.0",
|
|
71
74
|
"ky": "^1.14.0",
|
|
72
75
|
"kysely": "^0.28.0",
|
|
73
76
|
"kysely-postgres-js": "^2.0.0",
|
|
@@ -76,13 +79,12 @@
|
|
|
76
79
|
"node-sql-parser": "^5.4.0",
|
|
77
80
|
"open": "^10.1.0",
|
|
78
81
|
"ora": "^8.0.1",
|
|
79
|
-
"p-retry": "^7.1.0",
|
|
80
|
-
"pg": "^8.16.3",
|
|
81
82
|
"pino": "^10.1.0",
|
|
83
|
+
"playwright": "npm:patchright@^1.57.0",
|
|
82
84
|
"postgres": "^3.4.7",
|
|
83
85
|
"react": "^19.2.5",
|
|
84
86
|
"resend": "^6.6.0",
|
|
85
|
-
"
|
|
87
|
+
"sharp": "^0.34.4",
|
|
86
88
|
"smol-toml": "^1.3.1",
|
|
87
89
|
"vite": "^6.0.0",
|
|
88
90
|
"winston": "^3.17.0",
|
|
@@ -99,7 +101,7 @@
|
|
|
99
101
|
"README.md"
|
|
100
102
|
],
|
|
101
103
|
"engines": {
|
|
102
|
-
"node": ">=22
|
|
104
|
+
"node": ">=22 <25"
|
|
103
105
|
},
|
|
104
106
|
"optionalDependencies": {
|
|
105
107
|
"isolated-vm": "^6.1.2"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chat.integration.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/chat.integration.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,337 +0,0 @@
|
|
|
1
|
-
import { afterEach, beforeAll, describe, expect, mock, test } from "bun:test";
|
|
2
|
-
import { join } from "node:path";
|
|
3
|
-
const createInterfaceMock = mock(() => ({
|
|
4
|
-
question: (_prompt, callback) => callback("1"),
|
|
5
|
-
close: () => undefined,
|
|
6
|
-
}));
|
|
7
|
-
mock.module("node:readline", () => ({
|
|
8
|
-
createInterface: createInterfaceMock,
|
|
9
|
-
}));
|
|
10
|
-
let chatCommand;
|
|
11
|
-
const originalFetch = globalThis.fetch;
|
|
12
|
-
const originalStdoutWrite = process.stdout.write.bind(process.stdout);
|
|
13
|
-
const originalStderrWrite = process.stderr.write.bind(process.stderr);
|
|
14
|
-
const originalConsoleError = console.error;
|
|
15
|
-
const originalToken = process.env.LOBU_API_TOKEN;
|
|
16
|
-
const exampleDir = join(import.meta.dir, "../../../../examples/market");
|
|
17
|
-
function createSseResponse(events) {
|
|
18
|
-
const encoder = new TextEncoder();
|
|
19
|
-
const payload = events
|
|
20
|
-
.map(({ event, data }) => `event: ${event}\ndata: ${JSON.stringify(data)}\n\n`)
|
|
21
|
-
.join("");
|
|
22
|
-
return new Response(new ReadableStream({
|
|
23
|
-
start(controller) {
|
|
24
|
-
controller.enqueue(encoder.encode(payload));
|
|
25
|
-
controller.close();
|
|
26
|
-
},
|
|
27
|
-
}), {
|
|
28
|
-
status: 200,
|
|
29
|
-
headers: { "Content-Type": "text/event-stream" },
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
function captureTerminal(output) {
|
|
33
|
-
process.stdout.write = ((chunk, cb) => {
|
|
34
|
-
output.stdout.push(String(chunk));
|
|
35
|
-
if (typeof cb === "function") {
|
|
36
|
-
cb(null);
|
|
37
|
-
}
|
|
38
|
-
return true;
|
|
39
|
-
});
|
|
40
|
-
process.stderr.write = ((chunk, cb) => {
|
|
41
|
-
output.stderr.push(String(chunk));
|
|
42
|
-
if (typeof cb === "function") {
|
|
43
|
-
cb(null);
|
|
44
|
-
}
|
|
45
|
-
return true;
|
|
46
|
-
});
|
|
47
|
-
console.error = (...args) => {
|
|
48
|
-
output.stderr.push(args.map((arg) => String(arg)).join(" "));
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
beforeAll(async () => {
|
|
52
|
-
({ chatCommand } = await import("../commands/chat"));
|
|
53
|
-
});
|
|
54
|
-
afterEach(() => {
|
|
55
|
-
globalThis.fetch = originalFetch;
|
|
56
|
-
process.stdout.write = originalStdoutWrite;
|
|
57
|
-
process.stderr.write = originalStderrWrite;
|
|
58
|
-
console.error = originalConsoleError;
|
|
59
|
-
if (originalToken === undefined) {
|
|
60
|
-
delete process.env.LOBU_API_TOKEN;
|
|
61
|
-
}
|
|
62
|
-
else {
|
|
63
|
-
process.env.LOBU_API_TOKEN = originalToken;
|
|
64
|
-
}
|
|
65
|
-
mock.restore();
|
|
66
|
-
});
|
|
67
|
-
describe("chatCommand example integration", () => {
|
|
68
|
-
test("uses the hr example agent and completes approval plus login interaction flow", async () => {
|
|
69
|
-
process.env.LOBU_API_TOKEN = "test-token";
|
|
70
|
-
const stdout = [];
|
|
71
|
-
const stderr = [];
|
|
72
|
-
const createBodies = [];
|
|
73
|
-
const approvalBodies = [];
|
|
74
|
-
captureTerminal({ stdout, stderr });
|
|
75
|
-
globalThis.fetch = mock(async (input, init) => {
|
|
76
|
-
const url = String(input);
|
|
77
|
-
if (url === "http://gateway.test/api/v1/agents" &&
|
|
78
|
-
init?.method === "POST") {
|
|
79
|
-
const body = JSON.parse(String(init.body));
|
|
80
|
-
createBodies.push(body);
|
|
81
|
-
return Response.json({
|
|
82
|
-
agentId: "session-1",
|
|
83
|
-
token: "session-token",
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
if (url === "http://gateway.test/api/v1/agents/session-1/events" &&
|
|
87
|
-
!init?.method) {
|
|
88
|
-
return createSseResponse([
|
|
89
|
-
{
|
|
90
|
-
event: "output",
|
|
91
|
-
data: { content: "Starting request.\n" },
|
|
92
|
-
},
|
|
93
|
-
{
|
|
94
|
-
event: "tool-approval",
|
|
95
|
-
data: {
|
|
96
|
-
requestId: "approval-1",
|
|
97
|
-
mcpId: "github",
|
|
98
|
-
toolName: "delete_issue",
|
|
99
|
-
args: { issue_number: 42 },
|
|
100
|
-
},
|
|
101
|
-
},
|
|
102
|
-
{
|
|
103
|
-
event: "link-button",
|
|
104
|
-
data: {
|
|
105
|
-
label: "Connect GitHub",
|
|
106
|
-
url: "https://auth.example.com/device",
|
|
107
|
-
},
|
|
108
|
-
},
|
|
109
|
-
{
|
|
110
|
-
event: "question",
|
|
111
|
-
data: {
|
|
112
|
-
question: "Pick one",
|
|
113
|
-
options: ["A", "B"],
|
|
114
|
-
},
|
|
115
|
-
},
|
|
116
|
-
{
|
|
117
|
-
event: "suggestion",
|
|
118
|
-
data: {
|
|
119
|
-
prompts: ["retry", "show me the details"],
|
|
120
|
-
},
|
|
121
|
-
},
|
|
122
|
-
{
|
|
123
|
-
event: "complete",
|
|
124
|
-
data: {},
|
|
125
|
-
},
|
|
126
|
-
]);
|
|
127
|
-
}
|
|
128
|
-
if (url === "http://gateway.test/api/v1/agents/session-1/messages" &&
|
|
129
|
-
init?.method === "POST") {
|
|
130
|
-
return Response.json({ success: true });
|
|
131
|
-
}
|
|
132
|
-
if (url === "http://gateway.test/api/v1/agents/approve" &&
|
|
133
|
-
init?.method === "POST") {
|
|
134
|
-
const body = JSON.parse(String(init.body));
|
|
135
|
-
approvalBodies.push(body);
|
|
136
|
-
return Response.json({
|
|
137
|
-
result: {
|
|
138
|
-
content: [{ text: "Approved tool result." }],
|
|
139
|
-
},
|
|
140
|
-
});
|
|
141
|
-
}
|
|
142
|
-
throw new Error(`Unexpected fetch: ${url}`);
|
|
143
|
-
});
|
|
144
|
-
await chatCommand(exampleDir, "please run the workflow", {
|
|
145
|
-
gateway: "http://gateway.test",
|
|
146
|
-
new: true,
|
|
147
|
-
});
|
|
148
|
-
expect(createBodies).toEqual([
|
|
149
|
-
{
|
|
150
|
-
agentId: "vc-tracking",
|
|
151
|
-
forceNew: true,
|
|
152
|
-
},
|
|
153
|
-
]);
|
|
154
|
-
expect(approvalBodies).toEqual([
|
|
155
|
-
{
|
|
156
|
-
requestId: "approval-1",
|
|
157
|
-
decision: "1h",
|
|
158
|
-
},
|
|
159
|
-
]);
|
|
160
|
-
const stdoutText = stdout.join("");
|
|
161
|
-
const stderrText = stderr.join("");
|
|
162
|
-
expect(stdoutText).toContain("Starting request.");
|
|
163
|
-
expect(stdoutText).toContain("Approved tool result.");
|
|
164
|
-
expect(stderrText).toContain("Tool Approval Required");
|
|
165
|
-
expect(stderrText).toContain("github");
|
|
166
|
-
expect(stderrText).toContain('"event":"link-button"');
|
|
167
|
-
expect(stderrText).toContain("Connect GitHub");
|
|
168
|
-
expect(stderrText).toContain('"event":"question"');
|
|
169
|
-
expect(stderrText).toContain('"event":"suggestion"');
|
|
170
|
-
expect(createInterfaceMock).toHaveBeenCalledTimes(1);
|
|
171
|
-
});
|
|
172
|
-
test("prints structured file-uploaded events in platform mode", async () => {
|
|
173
|
-
process.env.LOBU_API_TOKEN = "test-token";
|
|
174
|
-
const stdout = [];
|
|
175
|
-
const stderr = [];
|
|
176
|
-
captureTerminal({ stdout, stderr });
|
|
177
|
-
globalThis.fetch = mock(async (input, init) => {
|
|
178
|
-
const url = String(input);
|
|
179
|
-
if (url === "http://gateway.test/api/v1/agents/vc-tracking/messages" &&
|
|
180
|
-
init?.method === "POST") {
|
|
181
|
-
return Response.json({
|
|
182
|
-
success: true,
|
|
183
|
-
eventsUrl: "/api/v1/agents/vc-tracking/events?platform=telegram",
|
|
184
|
-
});
|
|
185
|
-
}
|
|
186
|
-
if (url ===
|
|
187
|
-
"http://gateway.test/api/v1/agents/vc-tracking/events?platform=telegram" &&
|
|
188
|
-
!init?.method) {
|
|
189
|
-
return createSseResponse([
|
|
190
|
-
{
|
|
191
|
-
event: "file-uploaded",
|
|
192
|
-
data: {
|
|
193
|
-
tool: "UploadUserFile",
|
|
194
|
-
platform: "telegram",
|
|
195
|
-
fileId: "file-123",
|
|
196
|
-
name: "e2e.txt",
|
|
197
|
-
permalink: "https://files.example/e2e.txt",
|
|
198
|
-
size: 8,
|
|
199
|
-
},
|
|
200
|
-
},
|
|
201
|
-
{
|
|
202
|
-
event: "output",
|
|
203
|
-
data: {
|
|
204
|
-
content: "Uploaded e2e.txt successfully.\n",
|
|
205
|
-
},
|
|
206
|
-
},
|
|
207
|
-
{ event: "complete", data: {} },
|
|
208
|
-
]);
|
|
209
|
-
}
|
|
210
|
-
throw new Error(`Unexpected fetch: ${url}`);
|
|
211
|
-
});
|
|
212
|
-
await chatCommand(exampleDir, "send me e2e.txt as a file", {
|
|
213
|
-
gateway: "http://gateway.test",
|
|
214
|
-
user: "telegram:chat-123",
|
|
215
|
-
});
|
|
216
|
-
expect(stdout.join("")).toContain("Uploaded e2e.txt successfully");
|
|
217
|
-
expect(stderr.join("")).toContain('"event":"file-uploaded"');
|
|
218
|
-
expect(stderr.join("")).toContain('"name":"e2e.txt"');
|
|
219
|
-
expect(stderr.join("")).toContain('"tool":"UploadUserFile"');
|
|
220
|
-
});
|
|
221
|
-
test("warns when a sandbox link is streamed without a file-uploaded event", async () => {
|
|
222
|
-
process.env.LOBU_API_TOKEN = "test-token";
|
|
223
|
-
const stdout = [];
|
|
224
|
-
const stderr = [];
|
|
225
|
-
captureTerminal({ stdout, stderr });
|
|
226
|
-
globalThis.fetch = mock(async (input, init) => {
|
|
227
|
-
const url = String(input);
|
|
228
|
-
if (url === "http://gateway.test/api/v1/agents/vc-tracking/messages" &&
|
|
229
|
-
init?.method === "POST") {
|
|
230
|
-
return Response.json({
|
|
231
|
-
success: true,
|
|
232
|
-
eventsUrl: "/api/v1/agents/vc-tracking/events?platform=telegram",
|
|
233
|
-
});
|
|
234
|
-
}
|
|
235
|
-
if (url ===
|
|
236
|
-
"http://gateway.test/api/v1/agents/vc-tracking/events?platform=telegram" &&
|
|
237
|
-
!init?.method) {
|
|
238
|
-
return createSseResponse([
|
|
239
|
-
{
|
|
240
|
-
event: "output",
|
|
241
|
-
data: {
|
|
242
|
-
content: "[Download cli-proof.txt](sandbox:/workspace/cli-proof.txt)",
|
|
243
|
-
},
|
|
244
|
-
},
|
|
245
|
-
{ event: "complete", data: {} },
|
|
246
|
-
]);
|
|
247
|
-
}
|
|
248
|
-
throw new Error(`Unexpected fetch: ${url}`);
|
|
249
|
-
});
|
|
250
|
-
await chatCommand(exampleDir, "send me cli-proof.txt as a file", {
|
|
251
|
-
gateway: "http://gateway.test",
|
|
252
|
-
user: "telegram:chat-123",
|
|
253
|
-
});
|
|
254
|
-
expect(stdout.join("")).toContain("cli-proof.txt");
|
|
255
|
-
expect(stderr.join("")).toContain("no file-uploaded event was emitted");
|
|
256
|
-
});
|
|
257
|
-
test("streams raw output chunks without corrupting fragmented markdown", async () => {
|
|
258
|
-
process.env.LOBU_API_TOKEN = "test-token";
|
|
259
|
-
const stdout = [];
|
|
260
|
-
const stderr = [];
|
|
261
|
-
captureTerminal({ stdout, stderr });
|
|
262
|
-
globalThis.fetch = mock(async (input, init) => {
|
|
263
|
-
const url = String(input);
|
|
264
|
-
if (url === "http://gateway.test/api/v1/agents/vc-tracking/messages" &&
|
|
265
|
-
init?.method === "POST") {
|
|
266
|
-
return Response.json({
|
|
267
|
-
success: true,
|
|
268
|
-
eventsUrl: "/api/v1/agents/vc-tracking/events?platform=telegram",
|
|
269
|
-
});
|
|
270
|
-
}
|
|
271
|
-
if (url ===
|
|
272
|
-
"http://gateway.test/api/v1/agents/vc-tracking/events?platform=telegram" &&
|
|
273
|
-
!init?.method) {
|
|
274
|
-
return createSseResponse([
|
|
275
|
-
{ event: "output", data: { content: "**Hello" } },
|
|
276
|
-
{ event: "output", data: { content: " world**" } },
|
|
277
|
-
{ event: "complete", data: {} },
|
|
278
|
-
]);
|
|
279
|
-
}
|
|
280
|
-
throw new Error(`Unexpected fetch: ${url}`);
|
|
281
|
-
});
|
|
282
|
-
await chatCommand(exampleDir, "say hello", {
|
|
283
|
-
gateway: "http://gateway.test",
|
|
284
|
-
user: "telegram:chat-123",
|
|
285
|
-
});
|
|
286
|
-
expect(stdout.join("")).toContain("**Hello world**");
|
|
287
|
-
expect(stderr.join("")).not.toContain("file-uploaded");
|
|
288
|
-
});
|
|
289
|
-
test("streams platform-mode output for image and voice requests from the example agent", async () => {
|
|
290
|
-
process.env.LOBU_API_TOKEN = "test-token";
|
|
291
|
-
const stdout = [];
|
|
292
|
-
const stderr = [];
|
|
293
|
-
const messageBodies = [];
|
|
294
|
-
captureTerminal({ stdout, stderr });
|
|
295
|
-
globalThis.fetch = mock(async (input, init) => {
|
|
296
|
-
const url = String(input);
|
|
297
|
-
if (url === "http://gateway.test/api/v1/agents/vc-tracking/messages" &&
|
|
298
|
-
init?.method === "POST") {
|
|
299
|
-
const body = JSON.parse(String(init.body));
|
|
300
|
-
messageBodies.push(body);
|
|
301
|
-
return Response.json({
|
|
302
|
-
success: true,
|
|
303
|
-
eventsUrl: "/api/v1/agents/vc-tracking/events?platform=telegram",
|
|
304
|
-
});
|
|
305
|
-
}
|
|
306
|
-
if (url ===
|
|
307
|
-
"http://gateway.test/api/v1/agents/vc-tracking/events?platform=telegram" &&
|
|
308
|
-
!init?.method) {
|
|
309
|
-
return createSseResponse([
|
|
310
|
-
{
|
|
311
|
-
event: "output",
|
|
312
|
-
data: {
|
|
313
|
-
content: "Image sent successfully (generated with openai).\nVoice message sent successfully (generated with openai).\n",
|
|
314
|
-
},
|
|
315
|
-
},
|
|
316
|
-
{ event: "complete", data: {} },
|
|
317
|
-
]);
|
|
318
|
-
}
|
|
319
|
-
throw new Error(`Unexpected fetch: ${url}`);
|
|
320
|
-
});
|
|
321
|
-
await chatCommand(exampleDir, "send an image and a voice reply", {
|
|
322
|
-
gateway: "http://gateway.test",
|
|
323
|
-
user: "telegram:chat-123",
|
|
324
|
-
});
|
|
325
|
-
expect(messageBodies).toEqual([
|
|
326
|
-
{
|
|
327
|
-
platform: "telegram",
|
|
328
|
-
content: "send an image and a voice reply",
|
|
329
|
-
telegram: { chatId: "chat-123" },
|
|
330
|
-
},
|
|
331
|
-
]);
|
|
332
|
-
expect(stdout.join("")).toContain("Image sent successfully");
|
|
333
|
-
expect(stdout.join("")).toContain("Voice message sent successfully");
|
|
334
|
-
expect(stderr.join("")).not.toContain("Failed");
|
|
335
|
-
});
|
|
336
|
-
});
|
|
337
|
-
//# sourceMappingURL=chat.integration.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chat.integration.test.js","sourceRoot":"","sources":["../../src/__tests__/chat.integration.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAC9E,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,MAAM,mBAAmB,G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AAE,CAAC,CAAC,CAAC,SAAS,CAAC,yBAAyB,CAAC,CAAC;QAC7D,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,iCAAiC,CAAC,CAAC;QACrE,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;IAClD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dev.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/dev.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { afterEach, describe, expect, test } from "bun:test";
|
|
2
|
-
import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from "node:fs";
|
|
3
|
-
import { tmpdir } from "node:os";
|
|
4
|
-
import { join } from "node:path";
|
|
5
|
-
import { resolveBackendBundle } from "../commands/dev";
|
|
6
|
-
describe("lobu run backend bundle resolution", () => {
|
|
7
|
-
const tempDirs = [];
|
|
8
|
-
afterEach(() => {
|
|
9
|
-
while (tempDirs.length > 0) {
|
|
10
|
-
const dir = tempDirs.pop();
|
|
11
|
-
if (dir)
|
|
12
|
-
rmSync(dir, { recursive: true, force: true });
|
|
13
|
-
}
|
|
14
|
-
});
|
|
15
|
-
test("finds the backend bundle copied to the CLI dist root", () => {
|
|
16
|
-
const root = mkdtempSync(join(tmpdir(), "lobu-cli-dist-"));
|
|
17
|
-
tempDirs.push(root);
|
|
18
|
-
const commandsDir = join(root, "dist", "commands");
|
|
19
|
-
mkdirSync(commandsDir, { recursive: true });
|
|
20
|
-
const bundlePath = join(root, "dist", "server.bundle.mjs");
|
|
21
|
-
writeFileSync(bundlePath, "// bundle placeholder\n");
|
|
22
|
-
expect(resolveBackendBundle(commandsDir)).toBe(bundlePath);
|
|
23
|
-
});
|
|
24
|
-
});
|
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