nextclaw 0.19.24 → 0.19.27

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.
Files changed (54) hide show
  1. package/dist/cli/app/index.js +2 -0
  2. package/dist/cli/app/index.js.map +1 -0
  3. package/dist/cli/launcher/index.js +2 -0
  4. package/dist/cli/launcher/index.js.map +1 -0
  5. package/dist/nextclaw-distribution.utils-BJZhAnGk.js +2 -0
  6. package/dist/nextclaw-distribution.utils-BJZhAnGk.js.map +1 -0
  7. package/package.json +20 -20
  8. package/resources/USAGE.md +54 -3
  9. package/resources/usage/http-webhook-ingress.md +145 -0
  10. package/ui-dist/assets/{api-CKKNxbsy.js → api-rASx2-N4.js} +1 -1
  11. package/ui-dist/assets/{app-manager-provider-BM1hziPv.js → app-manager-provider-CUkcbdWk.js} +1 -1
  12. package/ui-dist/assets/{channels-list-page-GD_IBCbY.js → channels-list-page-ZWYqfcCe.js} +1 -1
  13. package/ui-dist/assets/{chat-page-Ty6QH2Tc.js → chat-page-ACm58eUO.js} +1 -1
  14. package/ui-dist/assets/cpu-DKc3bQic.js +3 -0
  15. package/ui-dist/assets/desktop-C-cDRCBY.js +3 -0
  16. package/ui-dist/assets/{desktop-update-config-jWt63bXG.js → desktop-update-config-DAD9JN9Q.js} +1 -1
  17. package/ui-dist/assets/{dialog-DWZeMf9V.js → dialog-CR80q3Rm.js} +1 -1
  18. package/ui-dist/assets/{dist-DN-YM_0Y.js → dist-NBjcwlsw.js} +1 -1
  19. package/ui-dist/assets/doc-browser-D2pq4IHR.js +1 -0
  20. package/ui-dist/assets/doc-browser-DhIkcy0-.js +1 -0
  21. package/ui-dist/assets/{doc-browser-context-FukQHvyo.js → doc-browser-context-BPeeiNJ_.js} +1 -1
  22. package/ui-dist/assets/{doc-browser-CAhfnm0D.js → doc-browser-fLs0TcdS.js} +1 -1
  23. package/ui-dist/assets/{es2015-ZJ-nWL4L.js → es2015-CVAuMqlM.js} +1 -1
  24. package/ui-dist/assets/index-DV57tBmg.css +1 -0
  25. package/ui-dist/assets/index-Db9Cufsy.js +100 -0
  26. package/ui-dist/assets/{marketplace-page-DzwJTbAg.js → marketplace-page-CAp_gpNe.js} +2 -2
  27. package/ui-dist/assets/marketplace-page-PPY5uMHK.js +1 -0
  28. package/ui-dist/assets/mcp-marketplace-page-87__92b1.js +1 -0
  29. package/ui-dist/assets/{mcp-marketplace-page-BUMkGb6q.js → mcp-marketplace-page-C6HENB6V.js} +1 -1
  30. package/ui-dist/assets/{model-config-Cgiw7ejv.js → model-config-CK3a8DWH.js} +1 -1
  31. package/ui-dist/assets/{notice-card-BM2_YNoc.js → notice-card-CF4AJPM3.js} +1 -1
  32. package/ui-dist/assets/{popover-2H9DS7Cv.js → popover-DeAliE_4.js} +1 -1
  33. package/ui-dist/assets/{provider-scoped-model-input-DsZJ44ZV.js → provider-scoped-model-input-B8LJ6RCt.js} +1 -1
  34. package/ui-dist/assets/{providers-list-BrViWRyR.js → providers-list-BTPjqNdK.js} +1 -1
  35. package/ui-dist/assets/remote-DiPWGRZc.js +1 -0
  36. package/ui-dist/assets/runtime-config-page-Bb9he7t8.js +1 -0
  37. package/ui-dist/assets/{search-config-Deb56TtE.js → search-config-BkbSXa9d.js} +1 -1
  38. package/ui-dist/assets/{secrets-config-JJkgNCnO.js → secrets-config-DFbHCb9n.js} +1 -1
  39. package/ui-dist/assets/{select-C2c10F3e.js → select-HI5kiwX_.js} +1 -1
  40. package/ui-dist/assets/{setting-row-CB_ZFbIZ.js → setting-row-B4QnghjV.js} +1 -1
  41. package/ui-dist/assets/{tag-chip-CrQfVN3A.js → tag-chip-BPgMfp9l.js} +1 -1
  42. package/ui-dist/assets/{use-config-jAYudJxy.js → use-config-BFqzVF8Y.js} +1 -1
  43. package/ui-dist/assets/{use-infinite-scroll-loader-B97V1Ywd.js → use-infinite-scroll-loader-DXhw9W4l.js} +1 -1
  44. package/ui-dist/index.html +16 -16
  45. package/ui-dist/assets/cpu-DPPwMzoC.js +0 -3
  46. package/ui-dist/assets/desktop-BwONApN9.js +0 -3
  47. package/ui-dist/assets/doc-browser-p9DDNPWB.js +0 -1
  48. package/ui-dist/assets/doc-browser-rZIQIjuw.js +0 -1
  49. package/ui-dist/assets/index-B7CVI2ys.css +0 -1
  50. package/ui-dist/assets/index-SS1xPoWD.js +0 -100
  51. package/ui-dist/assets/marketplace-page-DZEljaFz.js +0 -1
  52. package/ui-dist/assets/mcp-marketplace-page-NfOsALIL.js +0 -1
  53. package/ui-dist/assets/remote-Dm6hKGew.js +0 -1
  54. package/ui-dist/assets/runtime-config-page-CvvW9VBj.js +0 -1
@@ -6,3 +6,5 @@ NextclawDistributionService.configure(createNextclawDistribution(import.meta.url
6
6
  runNextclawNpmRuntimeLauncher(process.argv);
7
7
  //#endregion
8
8
  export {};
9
+
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../src/cli/launcher/index.ts"],"sourcesContent":["#!/usr/bin/env node\nimport { NextclawDistributionService, runNextclawNpmRuntimeLauncher } from \"@nextclaw/service\";\nimport { createNextclawDistribution } from \"@nextclaw-cli/cli/shared/lib/distribution/index.js\";\n\nNextclawDistributionService.configure(createNextclawDistribution(import.meta.url));\nrunNextclawNpmRuntimeLauncher(process.argv);\n"],"mappings":";;;;AAIA,4BAA4B,UAAU,2BAA2B,OAAO,KAAK,IAAI,CAAC;AAClF,8BAA8B,QAAQ,KAAK"}
@@ -15,3 +15,5 @@ function createNextclawDistribution(importMetaUrl) {
15
15
  }
16
16
  //#endregion
17
17
  export { createNextclawDistribution as t };
18
+
19
+ //# sourceMappingURL=nextclaw-distribution.utils-BJZhAnGk.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nextclaw-distribution.utils-BJZhAnGk.js","names":[],"sources":["../src/cli/shared/lib/distribution/nextclaw-distribution.utils.ts"],"sourcesContent":["import { readFileSync } from \"node:fs\";\nimport { dirname, resolve } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\nimport type { NextclawDistribution } from \"@nextclaw/service\";\n\nexport function createNextclawDistribution(importMetaUrl: string): NextclawDistribution {\n const packageRoot = resolve(dirname(fileURLToPath(importMetaUrl)), \"../../..\");\n const { version } = JSON.parse(readFileSync(resolve(packageRoot, \"package.json\"), \"utf-8\")) as { version?: string };\n return {\n version: typeof version === \"string\" ? version : \"0.0.0\",\n packageRoot,\n appEntrypoint: resolve(packageRoot, \"dist/cli/app/index.js\"),\n uiDistDir: resolve(packageRoot, \"ui-dist\"),\n runtimeUpdatePublicKeyPath: resolve(packageRoot, \"resources/update-bundle-public.pem\")\n };\n}\n"],"mappings":";;;;AAKA,SAAgB,2BAA2B,eAA6C;CACtF,MAAM,cAAc,QAAQ,QAAQ,cAAc,cAAc,CAAC,EAAE,WAAW;CAC9E,MAAM,EAAE,YAAY,KAAK,MAAM,aAAa,QAAQ,aAAa,eAAe,EAAE,QAAQ,CAAC;AAC3F,QAAO;EACL,SAAS,OAAO,YAAY,WAAW,UAAU;EACjD;EACA,eAAe,QAAQ,aAAa,wBAAwB;EAC5D,WAAW,QAAQ,aAAa,UAAU;EAC1C,4BAA4B,QAAQ,aAAa,qCAAqC;EACvF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nextclaw",
3
- "version": "0.19.24",
3
+ "version": "0.19.27",
4
4
  "description": "Lightweight personal AI assistant with CLI, multi-provider routing, and channel integrations.",
5
5
  "private": false,
6
6
  "type": "module",
@@ -41,21 +41,21 @@
41
41
  "commander": "^12.1.0",
42
42
  "jszip": "^3.10.1",
43
43
  "yaml": "^2.8.1",
44
- "@nextclaw/core": "0.12.21",
45
- "@nextclaw/kernel": "0.1.11",
46
- "@nextclaw/mcp": "0.1.86",
47
- "@nextclaw/ncp": "0.5.14",
48
- "@nextclaw/ncp-agent-runtime": "0.3.25",
49
- "@nextclaw/ncp-mcp": "0.1.88",
50
- "@nextclaw/ncp-toolkit": "0.5.19",
51
- "@nextclaw/nextclaw-hermes-acp-bridge": "0.1.13",
52
- "@nextclaw/nextclaw-ncp-runtime-http-client": "0.1.13",
53
- "@nextclaw/nextclaw-ncp-runtime-stdio-client": "0.1.14",
54
- "@nextclaw/openclaw-compat": "1.0.21",
55
- "@nextclaw/remote": "0.1.99",
56
- "@nextclaw/runtime": "0.2.53",
57
- "@nextclaw/service": "0.1.14",
58
- "@nextclaw/server": "0.12.22"
44
+ "@nextclaw/core": "0.12.23",
45
+ "@nextclaw/ncp-agent-runtime": "0.3.27",
46
+ "@nextclaw/ncp-mcp": "0.1.90",
47
+ "@nextclaw/ncp-toolkit": "0.5.21",
48
+ "@nextclaw/nextclaw-ncp-runtime-http-client": "0.1.15",
49
+ "@nextclaw/nextclaw-hermes-acp-bridge": "0.1.15",
50
+ "@nextclaw/openclaw-compat": "1.0.23",
51
+ "@nextclaw/nextclaw-ncp-runtime-stdio-client": "0.1.16",
52
+ "@nextclaw/ncp": "0.5.16",
53
+ "@nextclaw/service": "0.1.16",
54
+ "@nextclaw/server": "0.12.24",
55
+ "@nextclaw/runtime": "0.2.55",
56
+ "@nextclaw/kernel": "0.1.13",
57
+ "@nextclaw/mcp": "0.1.88",
58
+ "@nextclaw/remote": "0.1.101"
59
59
  },
60
60
  "devDependencies": {
61
61
  "@types/node": "^20.17.6",
@@ -63,12 +63,12 @@
63
63
  "tsx": "^4.19.2",
64
64
  "typescript": "^5.6.3",
65
65
  "vitest": "^4.1.2",
66
- "@nextclaw/ui": "0.12.31"
66
+ "@nextclaw/ui": "0.12.33"
67
67
  },
68
68
  "scripts": {
69
- "dev": "tsx watch --tsconfig tsconfig.json src/cli/app/index.ts",
70
- "dev:build": "tsx src/cli/app/index.ts",
71
- "build": "node scripts/sync-usage-resource.mjs && tsdown src/index.ts src/cli/app/index.ts src/cli/launcher/index.ts --dts --clean --target es2022 --no-fixedExtension && node scripts/copy-ui-dist.mjs",
69
+ "dev": "tsx watch --tsconfig ../../scripts/dev/dev-runtime.tsconfig.json src/cli/app/index.ts",
70
+ "dev:build": "tsx --tsconfig ../../scripts/dev/dev-runtime.tsconfig.json src/cli/app/index.ts",
71
+ "build": "node scripts/sync-usage-resource.mjs && tsdown src/index.ts src/cli/app/index.ts src/cli/launcher/index.ts --dts.sourcemap --clean --target es2022 --no-fixedExtension && node scripts/copy-ui-dist.mjs",
72
72
  "runtime-update:build": "node scripts/build-npm-runtime-update-channel.mjs",
73
73
  "smoke:npm-runtime-update": "node scripts/smoke-npm-runtime-update.mjs",
74
74
  "validation:npm-update": "node scripts/smoke-npm-runtime-update.mjs --manual",
@@ -13,9 +13,11 @@ When NextClaw AI needs to operate the product itself (version/status/doctor/serv
13
13
  1. **Read the built-in self-management guide first**. The packaged runtime copy lives at `packages/nextclaw/resources/USAGE.md`, and this repo page is kept aligned with it.
14
14
  2. **Use the exact command for the intent**: use `nextclaw --version` for version lookup; do not infer version from `status`.
15
15
  3. **Prefer machine-readable output** (`--json`) whenever available.
16
- 4. **Close the loop after changes** with `nextclaw status --json` (and `nextclaw doctor --json` when needed).
17
- 5. **Be explicit about restart semantics** (hot-apply, auto-restart, or manual restart required).
18
- 6. **Never invent commands**; use documented commands or `nextclaw --help` / `nextclaw <subcommand> --help`.
16
+ 4. **Discover runtime HTTP addresses from `nextclaw status --json`** before calling local APIs or `/webhook`; use `endpoints.uiUrl` and `endpoints.apiUrl` instead of guessing ports.
17
+ 5. **Close the loop after changes** with `nextclaw status --json` (and `nextclaw doctor --json` when needed).
18
+ 6. **Be explicit about restart semantics** (hot-apply, auto-restart, or manual restart required).
19
+ 7. **Never invent commands**; use documented commands or `nextclaw --help` / `nextclaw <subcommand> --help`.
20
+ 8. **Desktop-installed AI uses the same command names**. When NextClaw Desktop launches the runtime, it exposes a managed `nextclaw` command surface to AI command tools, so self-management commands keep using `nextclaw ...` without requiring a global NPM install.
19
21
 
20
22
  ---
21
23
 
@@ -24,6 +26,7 @@ When NextClaw AI needs to operate the product itself (version/status/doctor/serv
24
26
  - [AI Self-Management Contract](#ai-self-management-contract)
25
27
  - [Quick Start](#quick-start)
26
28
  - [Public Server Deployment](#public-server-deployment)
29
+ - [HTTP Webhook Ingress](#http-webhook-ingress)
27
30
  - [Configuration](#configuration)
28
31
  - [Input context budget](#input-context-budget)
29
32
  - [Multi-agent routing & session isolation](#multi-agent-routing--session-isolation-openclaw-aligned)
@@ -121,6 +124,53 @@ If `127.0.0.1:55667` is healthy but the public entry returns `502`, the problem
121
124
 
122
125
  ---
123
126
 
127
+ ## HTTP Webhook Ingress
128
+
129
+ NextClaw exposes a generic webhook ingress for external systems and small local tools that need to trigger NextClaw work:
130
+
131
+ ```text
132
+ POST /webhook
133
+ ```
134
+
135
+ This section is intentionally only an index. Read the focused guide only when you need to implement or debug a webhook caller:
136
+
137
+ - [HTTP webhook ingress guide](usage/http-webhook-ingress.md)
138
+
139
+ For AI or scripts, do not guess the port. Discover the running service first:
140
+
141
+ ```bash
142
+ nextclaw status --json
143
+ ```
144
+
145
+ Read these fields:
146
+
147
+ - `endpoints.uiUrl`: base URL for UI and `/webhook`, for example `http://127.0.0.1:55667`.
148
+ - `endpoints.apiUrl`: base URL for API routes, for example `http://127.0.0.1:55667/api`.
149
+ - `remote.runtime.localOrigin`: local origin used by the service-managed remote connector when remote access is enabled.
150
+
151
+ Then call:
152
+
153
+ ```text
154
+ <endpoints.uiUrl>/webhook
155
+ ```
156
+
157
+ Current third-party trigger entry:
158
+
159
+ ```json
160
+ {
161
+ "type": "agent-run.send",
162
+ "payload": {
163
+ "content": [
164
+ { "type": "text", "text": "Reply exactly: Webhook smoke received" }
165
+ ]
166
+ }
167
+ }
168
+ ```
169
+
170
+ Unknown ingress types are rejected instead of being turned into chat messages. Use the focused guide for full payload fields, existing-session calls, verification, and error semantics.
171
+
172
+ ---
173
+
124
174
  ## Configuration
125
175
 
126
176
  - **Config file:** `~/.nextclaw/config.json`
@@ -653,6 +703,7 @@ Status/diagnostics tips:
653
703
  - `nextclaw --version` is the only supported way to query the installed CLI version.
654
704
  - `nextclaw status` shows runtime truth (process + health + config summary).
655
705
  - `nextclaw status --json` outputs machine-readable status and exits `0` when the command itself succeeds; use the JSON `level` field (`healthy` / `degraded` / `stopped`) to interpret runtime state.
706
+ - Use `nextclaw status --json` as the source of truth for local HTTP addresses. `endpoints.uiUrl` is the base for `/webhook`; `endpoints.apiUrl` is the base for `/api/*` calls.
656
707
  - `nextclaw status --fix` safely clears stale service state if PID is dead.
657
708
  - `nextclaw doctor` runs additional checks (state coherence, health, port availability, provider readiness).
658
709
  - `nextclaw usage` shows the latest observed LLM usage snapshot from recent CLI agent runs or the local UI/NCP runtime.
@@ -0,0 +1,145 @@
1
+ <!-- Generated by packages/nextclaw/scripts/sync-usage-resource.mjs -->
2
+ <!-- Do not edit this file directly; edit docs/usage/http-webhook-ingress.md instead. -->
3
+ # HTTP Webhook Ingress
4
+
5
+ This focused guide is for developers, local scripts, and AI agents that need to call NextClaw's HTTP webhook ingress.
6
+
7
+ ## Endpoint
8
+
9
+ NextClaw exposes a generic webhook ingress at:
10
+
11
+ ```text
12
+ POST /webhook
13
+ ```
14
+
15
+ Use the same host and port as the running gateway/UI:
16
+
17
+ - packaged service default: `http://127.0.0.1:55667/webhook`
18
+ - local repo dev default: `http://127.0.0.1:18792/webhook`
19
+
20
+ For AI or scripts, do not guess the port. Discover the running service first:
21
+
22
+ ```bash
23
+ nextclaw status --json
24
+ ```
25
+
26
+ Read these fields:
27
+
28
+ - `endpoints.uiUrl`: base URL for UI and `/webhook`, for example `http://127.0.0.1:55667`.
29
+ - `endpoints.apiUrl`: base URL for API routes, for example `http://127.0.0.1:55667/api`.
30
+ - `remote.runtime.localOrigin`: local origin used by the service-managed remote connector when remote access is enabled.
31
+
32
+ Then call:
33
+
34
+ ```text
35
+ <endpoints.uiUrl>/webhook
36
+ <endpoints.apiUrl>/health
37
+ <endpoints.apiUrl>/ncp/sessions
38
+ ```
39
+
40
+ ## Envelope
41
+
42
+ The webhook body is an ingress envelope:
43
+
44
+ ```json
45
+ {
46
+ "type": "agent-run.send",
47
+ "payload": {}
48
+ }
49
+ ```
50
+
51
+ Contract:
52
+
53
+ - `type` must be a registered ingress type. Unknown types are rejected instead of being turned into chat messages.
54
+ - Third-party integrations should use `agent-run.send` when they want to trigger an Agent run.
55
+ - Extension ingress types are reserved for the extension SDK/internal extension runtime path unless that integration explicitly uses the SDK contract.
56
+ - `Authorization: Bearer <token>` may be sent. Current agent-run webhook usage does not require it, but the field is already part of the ingress context so stricter verification can be added per ingress type later.
57
+
58
+ ## Trigger a New Agent Session
59
+
60
+ For normal external tools, use the lightweight `content` shape. NextClaw creates the internal user message id, role, status, timestamp, and session id.
61
+
62
+ ```bash
63
+ curl -sS -X POST http://127.0.0.1:55667/webhook \
64
+ -H 'content-type: application/json' \
65
+ --data '{
66
+ "type": "agent-run.send",
67
+ "payload": {
68
+ "metadata": {
69
+ "title": "Webhook smoke",
70
+ "label": "Webhook smoke",
71
+ "session_type": "native",
72
+ "project_root": "/path/to/project"
73
+ },
74
+ "content": [
75
+ { "type": "text", "text": "Reply exactly: Webhook smoke received" }
76
+ ]
77
+ }
78
+ }'
79
+ ```
80
+
81
+ Successful response:
82
+
83
+ ```json
84
+ {
85
+ "ok": true,
86
+ "data": {
87
+ "sessionId": "ncp-...",
88
+ "userMessageId": "user-message-...",
89
+ "assistantMessageId": "...",
90
+ "runId": "ncp-run-..."
91
+ }
92
+ }
93
+ ```
94
+
95
+ After success, the new session appears in the UI session list. Use `metadata.title` or `metadata.label` to make webhook-created sessions easy to find.
96
+
97
+ ## Continue an Existing Session
98
+
99
+ Pass `sessionId` to append a new user turn to an existing NCP session:
100
+
101
+ ```json
102
+ {
103
+ "type": "agent-run.send",
104
+ "payload": {
105
+ "sessionId": "ncp-existing-session",
106
+ "content": [
107
+ { "type": "text", "text": "Continue this task from the webhook." }
108
+ ]
109
+ }
110
+ }
111
+ ```
112
+
113
+ ## Payload Fields
114
+
115
+ `agent-run.send` accepts exactly one of these input forms:
116
+
117
+ - `content`: recommended for third-party callers. It is an array of NCP message parts, for example `text`, `file`, `rich-text`, `card`, or `extension` parts.
118
+ - `message`: advanced/internal form. It must be a full NCP message with `id`, `role`, `status`, `timestamp`, and `parts`.
119
+
120
+ Common fields:
121
+
122
+ - `sessionId`: optional. Omit it to create a new session.
123
+ - `metadata.title` / `metadata.label`: optional human-readable session title.
124
+ - `metadata.agent_id` or `metadata.agentId`: optional target Agent id.
125
+ - `metadata.session_type` or `metadata.runtime`: optional runtime/session type such as `native`.
126
+ - `metadata.preferred_model` or `metadata.model`: optional model override for the created session.
127
+ - `metadata.project_root`: optional project path associated with the session.
128
+ - `metadata.preferred_thinking` or `metadata.thinking`: optional thinking level preference.
129
+
130
+ Validation rules:
131
+
132
+ - Provide `content` or `message`, not both.
133
+ - `content` must be an array.
134
+ - If `sessionId` is present, it must be a non-empty string.
135
+ - The gateway returns `400` when the envelope or payload is invalid.
136
+ - Unsupported ingress types return an error message that includes the unsupported type.
137
+
138
+ ## Quick Verification
139
+
140
+ ```bash
141
+ curl http://127.0.0.1:55667/api/health
142
+ curl http://127.0.0.1:55667/api/ncp/sessions
143
+ ```
144
+
145
+ Use `/api/ncp/sessions` after the webhook call to confirm the created `sessionId`, `metadata.label`, status, and latest activity preview.