Skip to content

Commit da69dae

Browse files
authored
feat(onboarding): recommend plugins and skills from installed apps (#109668)
* feat(onboarding): recommend plugins and skills from installed apps Scan installed macOS apps during classic onboarding (TCC-free), gather candidates from official catalogs + ClawHub search, let the configured model pick genuine matches, and offer an opt-in multiselect install step. Adds a device.apps node-host command (default-off sharing, Android-parity envelope) so remote gateways can request a paired Mac's inventory, and a wizard.appRecommendations kill switch. Custom setup-inference completions no longer inherit the 32-token verification-probe output cap. * feat(onboarding): recommend apps in guided flow * fix(onboarding): harden app recommendations against ClawHub self-promotion Third-party ClawHub skills are never pre-selected regardless of model tier (publisher-controlled listing text reaches the matcher prompt and could promote itself); their labels now say they install third-party code. Installed-app scans follow symlinked .app bundles. Matcher output stays bounded by the resolved model's own maxTokens budget (documented invariant). * fix(onboarding): key official catalog candidates by resolved plugin id Real catalog entries are package manifests without a top-level id; keying the candidate map and channel/provider classification by entry.id collapsed the whole official catalog into one undefined-keyed entry, so no official plugin or channel was ever recommended. Regression test runs against the bundled catalogs. * fix(onboarding): satisfy lint, types, deadcode, and migration gates Split the guided-onboarding test into a self-contained custodian suite to stay under max-lines. Narrow app-recommendation exports (drop dead node-payload normalizer, unexport internal types/helpers, route candidate tests through the public API), replace map-spread with a helper, unexport device.apps result types, add installedAppsSharing to node-host migration expectations, cast the wizard multiselect mock, and regenerate the docs map. * test(onboarding): register new live test in the shard classifier
1 parent 8020dd3 commit da69dae

47 files changed

Lines changed: 2323 additions & 192 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎docs/cli/onboard.md‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,11 @@ wizard shows the same page after it prepares the workspace.
102102
After inference passes (and the memory-import offer), guided onboarding
103103
applies the standard setup automatically — workspace, Gateway, and sessions,
104104
the same plan the conversational `openclaw setup` chat would apply on "yes" —
105-
announces where to find OpenClaw later, and hatches your agent directly in the
106-
terminal chat. If applying setup fails, onboarding falls back to the
105+
then offers plugin and skill recommendations from installed apps; app names
106+
are matched through your configured model and ClawHub search, and the step can
107+
be disabled with [`wizard.appRecommendations`](/gateway/configuration-reference#wizard).
108+
It then announces where to find OpenClaw later and hatches your agent directly
109+
in the terminal chat. If applying setup fails, onboarding falls back to the
107110
conversational OpenClaw chat to finish interactively. Channels, agents,
108111
plugins, and other optional features remain OpenClaw chat territory: run
109112
`openclaw` and use `open channel wizard for <channel>` to hand channel

‎docs/docs_map.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9442,6 +9442,7 @@ Do not edit it by hand; run `pnpm docs:map:gen`.
94429442
- H2: Remote mode details
94439443
- H2: Auth and model options
94449444
- H2: Outputs and internals
9445+
- H3: Installed app recommendations
94459446
- H2: Non-interactive setup
94469447
- H2: Gateway wizard RPC
94479448
- H2: Signal setup behavior

‎docs/gateway/configuration-reference.md‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1441,12 +1441,13 @@ writer is best-effort, not a lossless compliance archive.
14411441

14421442
## Wizard
14431443

1444-
Metadata written by CLI guided setup flows (`onboard`, `configure`, `doctor`):
1444+
Behavior and metadata for CLI guided setup flows (`onboard`, `configure`, `doctor`):
14451445

14461446
```json5
14471447
{
14481448
wizard: {
14491449
accessMode: "full",
1450+
appRecommendations: true,
14501451
lastRunAt: "2026-01-01T00:00:00.000Z",
14511452
lastRunVersion: "2026.1.4",
14521453
lastRunCommit: "abc1234",
@@ -1459,6 +1460,8 @@ Metadata written by CLI guided setup flows (`onboard`, `configure`, `doctor`):
14591460

14601461
- `wizard.accessMode`: discovery consent chosen at the start of guided onboarding. `"full"` (recommended) lets setup look for AI apps, keys, and local runtimes automatically; `"guarded"` makes setup ask once before looking around and offers manual configuration instead.
14611462

1463+
- `wizard.appRecommendations` defaults to `true`. Set it to `false` to disable installed-application recommendations during guided or classic onboarding and block Gateway `device.apps` access. Node hosts still require their separate, default-off installed-app sharing flag before they advertise the command.
1464+
14621465
---
14631466

14641467
## Identity

‎docs/nodes/index.md‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ On the node machine:
9393
openclaw node run --host <gateway-host> --port 18789 --display-name "Build Node"
9494
```
9595

96-
`node run` also accepts `--context-path` (Gateway WS context path), `--tls`, `--tls-fingerprint <sha256>`, and `--node-id` (override the legacy client instance ID; this does not reset pairing).
96+
`node run` also accepts `--context-path` (Gateway WS context path), `--tls`, `--tls-fingerprint <sha256>`, and `--node-id` (override the legacy client instance ID; this does not reset pairing). On macOS, pass `--share-installed-apps` to advertise `device.apps`; sharing is off by default. Use `--no-share-installed-apps` to disable a previously saved opt-in.
9797

9898
### Remote gateway via SSH tunnel (loopback bind)
9999

@@ -128,7 +128,7 @@ openclaw node start
128128
openclaw node restart
129129
```
130130

131-
`node install` also accepts `--context-path`, `--tls`, `--tls-fingerprint`, `--node-id` (legacy client instance ID only), `--runtime <node>` (default: node), and `--force` to reinstall. `node status`, `node stop`, and `node uninstall` are also available.
131+
`node install` also accepts `--context-path`, `--tls`, `--tls-fingerprint`, `--node-id` (legacy client instance ID only), `--share-installed-apps` / `--no-share-installed-apps`, `--runtime <node>` (default: node), and `--force` to reinstall. `node status`, `node stop`, and `node uninstall` are also available.
132132

133133
### Pair + name
134134

@@ -449,7 +449,7 @@ Default allowlists by platform (before plugin defaults and `allowCommands`/`deny
449449
| iOS | `camera.list`, `location.get`, `device.info`, `device.status`, `contacts.search`, `calendar.events`, `reminders.list`, `photos.latest`, `motion.activity`, `motion.pedometer`, `system.notify` |
450450
| watchOS | `device.info`, `device.status`, `system.notify` |
451451
| Android | `camera.list`, `location.get`, `notifications.list`, `notifications.actions`, `system.notify`, `device.info`, `device.status`, `device.permissions`, `device.health`, `device.apps`, `contacts.search`, `calendar.events`, `callLog.search`, `reminders.list`, `photos.latest`, `motion.activity`, `motion.pedometer` |
452-
| macOS | `camera.list`, `location.get`, `device.info`, `device.status`, `contacts.search`, `calendar.events`, `reminders.list`, `photos.latest`, `motion.activity`, `motion.pedometer`, `system.notify` |
452+
| macOS | `camera.list`, `location.get`, `device.info`, `device.status`, `device.apps`, `contacts.search`, `calendar.events`, `reminders.list`, `photos.latest`, `motion.activity`, `motion.pedometer`, `system.notify` |
453453
| Windows | `camera.list`, `location.get`, `device.info`, `device.status`, `system.notify` |
454454
| Linux | `system.notify` (node host commands like `system.run` are approval-gated, see below) |
455455

@@ -655,12 +655,13 @@ Notes:
655655

656656
## Device and personal data commands
657657

658-
iOS and Android nodes advertise several read-only data commands by default (see the [Command policy](#command-policy) table); Android additionally exposes a larger family gated by its own in-app settings.
658+
iOS and Android nodes advertise several read-only data commands by default (see the [Command policy](#command-policy) table); Android additionally exposes a larger family gated by its own in-app settings. A macOS or headless-mac TypeScript node host advertises `device.apps` only after the operator enables installed-app sharing with `--share-installed-apps`.
659659

660660
Available families:
661661

662662
- `device.status`, `device.info` — iOS, Android, Windows.
663-
- `device.permissions`, `device.health`, `device.apps` — Android only; `device.apps` requires Installed Apps sharing enabled in Android Settings and returns launcher-visible apps by default.
663+
- `device.permissions`, `device.health` — Android only.
664+
- `device.apps` — Android, macOS, and headless-mac nodes. Android requires Installed Apps sharing in Settings and returns launcher-visible apps by default. TypeScript node hosts keep sharing off by default and accept `query`, `limit`, and `includeSystem`; macOS results contain `label`, `bundleId`, `path`, and `system`.
664665
- `notifications.list`, `notifications.actions` — Android only.
665666
- `photos.latest` — iOS, Android.
666667
- `contacts.search` — iOS, Android (read-only default); `contacts.add` is dangerous and needs `gateway.nodes.allowCommands`.

‎docs/start/onboarding-redesign.md‎

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,15 @@ Design principles (decided, do not relitigate casually):
4242

4343
## Phases
4444

45-
| # | Phase | Surface | Status |
46-
| --- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------ | -------------------------------------------------------------------------- |
47-
| 1 | Installed-app plugin recommendations (scan, candidates, AI matcher, wizard step, `device.apps` node command) | service + classic wizard | PR [#109668](https://github.com/openclaw/openclaw/pull/109668) — in review |
48-
| 2 | CLI custodian spine (question zero, discovery theater, auto-apply + hatch) | guided CLI | PR [#109841](https://github.com/openclaw/openclaw/pull/109841) — in review |
49-
| 3 | Browser-first handoff (GUI-session detection, wait-for-dashboard-connect, TUI as fallback) | CLI → web | planned |
50-
| 4 | Web custodian surface (option-card renderer shared with the question tool, scripted pre-AI states over `openclaw.chat`, post-wizard chat handoff) | Control UI | planned |
51-
| 5 | Hatch and bootstrap (blank-agent creation, self-naming, self-drawn avatar via image-gen when available, recommendations as the last bootstrap step, self-learning opt-in) | agent bootstrap | planned |
52-
| 6 | Custodian presence (pinned sidebar entry, Settings dock with event-reactive commentary, channel summon and agent-down recovery, weak-model script) | web + channels | planned |
53-
| 7 | Resilience (custodian reachable on broken config, partial-surface salvage, auto-doctor) | gateway | follow-up |
45+
| # | Phase | Surface | Status |
46+
| --- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------- | --------------------------------------------------------------------------------------------------------------- |
47+
| 1 | Installed-app plugin recommendations (scan, candidates, AI matcher, wizard step, `device.apps` node command) | classic + guided CLI | PR [#109668](https://github.com/openclaw/openclaw/pull/109668) — in review |
48+
| 2 | CLI custodian spine (question zero, discovery theater, auto-apply + hatch) | guided CLI | merged ([`a83ed13204f1`](https://github.com/openclaw/openclaw/commit/a83ed13204f118adf1009e5ac88d5afe1905b86c)) |
49+
| 3 | Browser-first handoff (GUI-session detection, wait-for-dashboard-connect, TUI as fallback) | CLI → web | planned |
50+
| 4 | Web custodian surface (option-card renderer shared with the question tool, scripted pre-AI states over `openclaw.chat`, post-wizard chat handoff) | Control UI | planned |
51+
| 5 | Hatch and bootstrap (blank-agent creation, self-naming, self-drawn avatar via image-gen when available, recommendations as the last bootstrap step, self-learning opt-in) | agent bootstrap | planned |
52+
| 6 | Custodian presence (pinned sidebar entry, Settings dock with event-reactive commentary, channel summon and agent-down recovery, weak-model script) | web + channels | planned |
53+
| 7 | Resilience (custodian reachable on broken config, partial-surface salvage, auto-doctor) | gateway | follow-up |
5454

5555
## Implementation notes per phase
5656

@@ -63,9 +63,9 @@ Design principles (decided, do not relitigate casually):
6363
the model rejects coincidental name overlaps.
6464
- Node command `device.apps` (TS node-host, Android envelope parity), sharing
6565
off by default; gateway kill switch `wizard.appRecommendations`.
66-
- Delivery currently lives in the classic wizard
67-
(`src/wizard/setup.app-recommendations.ts`); it re-targets to the bootstrap
68-
tail in phase 5 (the service already takes an injectable inventory source).
66+
- Delivery lives in the classic wizard and guided custodian flow
67+
(`src/wizard/setup.app-recommendations.ts`); re-targeting to the bootstrap
68+
tail remains phase 5 (the service already takes an injectable inventory source).
6969
- Also fixed: custom `completeSetupInference` prompts no longer inherit the
7070
32-token verification-probe output cap.
7171

‎docs/start/wizard-cli-reference.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,12 @@ Some channels are delivered as plugins. When selected during setup, the wizard
351351
prompts to install the plugin (npm or local path) before channel configuration.
352352
</Note>
353353

354+
### Installed app recommendations
355+
356+
After the model access check succeeds, classic interactive onboarding on macOS scans application names and bundle IDs without requesting macOS privacy permissions. It searches the official plugin catalogs and ClawHub, then asks the configured model to reject false name matches and recommend relevant plugins or skills. Recommended matches are selected by default; optional matches require an explicit selection.
357+
358+
The results screen lists the detected applications and shows: "App names were matched using your configured model and ClawHub search." Set `wizard.appRecommendations` to `false` to disable both this onboarding step and Gateway access to node app inventories. The scan is not used in quickstart or non-macOS onboarding.
359+
354360
## Non-interactive setup
355361

356362
`--non-interactive` requires `--accept-risk` (acknowledges that agents are

‎src/cli/node-cli/daemon.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ type NodeDaemonInstallOptions = {
4646
tlsFingerprint?: string;
4747
nodeId?: string;
4848
displayName?: string;
49+
shareInstalledApps?: boolean;
4950
runtime?: string;
5051
force?: boolean;
5152
json?: boolean;
@@ -162,6 +163,7 @@ export async function runNodeDaemonInstall(opts: NodeDaemonInstallOptions) {
162163
tlsFingerprint: tlsFingerprint || undefined,
163164
nodeId: opts.nodeId,
164165
displayName: opts.displayName,
166+
installedAppsSharing: opts.shareInstalledApps,
165167
runtime: runtimeRaw,
166168
warn: (message) => {
167169
if (json) {

‎src/cli/node-cli/register.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ export function registerNodeCli(program: Command) {
6565
.option("--tls-fingerprint <sha256>", "Expected TLS certificate fingerprint (sha256)")
6666
.option("--node-id <id>", "Override the generated node instance id")
6767
.option("--display-name <name>", "Override node display name")
68+
.option("--share-installed-apps", "Share installed macOS applications with the Gateway")
69+
.option("--no-share-installed-apps", "Disable installed application sharing")
6870
.action(async (opts) => {
6971
const existing = await loadNodeHostConfig();
7072
const host =
@@ -101,6 +103,7 @@ export function registerNodeCli(program: Command) {
101103
(explicitContextPath || retargetedGateway ? undefined : existing?.gateway?.contextPath),
102104
nodeId: opts.nodeId,
103105
displayName: opts.displayName,
106+
installedAppsSharing: opts.shareInstalledApps,
104107
});
105108
});
106109

@@ -130,6 +133,8 @@ export function registerNodeCli(program: Command) {
130133
.option("--tls-fingerprint <sha256>", "Expected TLS certificate fingerprint (sha256)")
131134
.option("--node-id <id>", "Override the generated node instance id")
132135
.option("--display-name <name>", "Override node display name")
136+
.option("--share-installed-apps", "Share installed macOS applications with the Gateway")
137+
.option("--no-share-installed-apps", "Disable installed application sharing")
133138
.option("--runtime <runtime>", "Service runtime (node). Default: node")
134139
.option("--force", "Reinstall/overwrite if already installed", false)
135140
.option("--json", "Output JSON", false)

‎src/commands/node-daemon-install-helpers.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ export async function buildNodeInstallPlan(params: {
3939
tlsFingerprint?: string;
4040
nodeId?: string;
4141
displayName?: string;
42+
installedAppsSharing?: boolean;
4243
runtime: GatewayDaemonRuntime;
4344
devMode?: boolean;
4445
nodePath?: string;
@@ -58,6 +59,7 @@ export async function buildNodeInstallPlan(params: {
5859
tlsFingerprint: params.tlsFingerprint,
5960
nodeId: params.nodeId,
6061
displayName: params.displayName,
62+
installedAppsSharing: params.installedAppsSharing,
6163
dev: devMode,
6264
runtime: params.runtime,
6365
nodePath,

0 commit comments

Comments
 (0)