Skip to content

feat: agent-native Connectors + integration marketplace (0196) - #160

Merged
crs48 merged 8 commits into
mainfrom
feat/agent-native-connectors-0196
Jun 17, 2026
Merged

feat: agent-native Connectors + integration marketplace (0196)#160
crs48 merged 8 commits into
mainfrom
feat/agent-native-connectors-0196

Conversation

@crs48

@crs48 crs48 commented Jun 17, 2026

Copy link
Copy Markdown
Owner

Agent-Native Connectors (exploration 0196)

xNet's answer to the OpenClaw / Printing Press "agent-native CLI" pattern — but instead of giving an agent a credentialed shell, a Connector syncs an external service into governed XNet nodes and exposes agent-callable tools over them. The agent operates on a policy-evaluated data plane; the service credential never leaves the hub. Implements docs/explorations/0196.

What shipped (package-layer vertical slice, all tested)

  • agentTools contribution point (@xnetjs/plugins) — first-class model-facing tools, not tied to a UI command. AiSurfaceService gains extraTools as the single merge point, so one registration surfaces a tool in the in-app AI and xnet mcp serve (deferred, per progressive disclosure). Built-in xnet_* names always win over collisions.
  • Connector primitivedefineConnector produces a FeatureModule (hub feature wired at <id>.sync) bundling capabilities + a sync adapter + agentTools.
  • Governed sync runnerrunConnectorSync composes the guards so an author writes plain store/fetch calls while the framework guarantees: egress containment (guardedFetch), schema-write containment (guardStore), required target space + space-stamp (no cross-space leak), and a write budget on a new dedicated connector AbuseSurface.
  • Hub sync feature (@xnetjs/hub) — connectorSyncFeature, generic over an injected runner (no @xnetjs/plugins edge); mountFeatures scopes env to the connector's declared secrets, so the token never escapes the hub.
  • Authoring DX — a connector scaffold template + xnet connector scaffold <id>.
  • InteropemitConnectorArtifacts (tool descriptors + a SKILL.md fragment + a connectors-category marketplace entry), connectorAsImporter (generalizes the dormant 0189 importers point), evaluateConnectorInstall (hard-blocks secret-holding AI-generated connectors from auto-install), and wrapCliConnector (turns an existing Printing Press CLI into a governed Connector).

Tests

New: agent-tools.test.ts (7), connectors.test.ts (12 governance), connectors-artifacts.test.ts (7), hub connectors.test.ts (3), scaffold + CLI connector tests. Full suites green locally: integration 921, plus cli/abuse unit. Workspace typecheck 83/83, prettier --check clean, eslint 0 errors.

Deferred / seams (documented in the doc's Implementation Status)

  • Agent-bridge "advertising" is satisfied via xnet mcp serve (the agentTools config) — the spawned harness gets tools from the MCP server, so no bridge-server change was needed.
  • A Connectors marketplace view (app-side) and per-user OAuth (multi-tenant secrets vs. the shipped single-bot-token model) are deferred.
  • wrapCliConnector governs the output mapping, not the wrapped CLI's own egress (honest caveat in code + doc).

🤖 Generated with Claude Code

xNet Test and others added 8 commits June 17, 2026 13:11
…rketplace

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The agent-native Connector framework's foundation: a first-class `agentTools`
contribution point (model-facing tools not tied to a UI command, unlike 0194's
contributionsAsAiTools). AiSurfaceService gains `extraTools` as the single merge
point — getTools() lists them and callTool() dispatches them — so a contributed
tool surfaces in the in-app AI AND the MCP server with one registration. MCP
server gains an `agentTools` config; contributed tools are deferred (not in
MCP_CORE_TOOL_NAMES). Built-in xnet_* names always win over colliding extras.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
defineConnector produces a FeatureModule (hub feature wired by convention at
<id>.sync) bundling capabilities + a sync adapter + agentTools. runConnectorSync
composes the guards so an author writes plain store/fetch calls while the
framework guarantees: egress containment (guardedFetch), schema-write containment
(guardStore), required-target-space + space-stamp (no cross-space leak), and a
write budget on a new dedicated `connector` AbuseSurface (separate from the
agent's localApi budget). 12 governance tests cover each guarantee.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The server-side half of a Connector, generic over an injected `run` so the hub
takes no @xnetjs/plugins edge. mountFeatures scopes env to the connector's
declared secrets before mount, so the token never escapes the hub; the authed
POST /x/<id>.sync/run runs one sync pass with the scoped env + the session DID +
a body-supplied target space. 3 tests: secret scoping, 401 unauth, error→400.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…fold` (0196)

Adds a `connector` scaffold template that emits a defineConnector(...) project
(capabilities + sync.pull + an agent tool, with schemaWrite/sync.schemas sharing
one SCHEMA const so the coherence check passes) and the `xnet connector scaffold
<id>` CLI command reusing the shared scaffold file-writer.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…-gate, CLI-wrap (0196)

One definition → every surface: emitConnectorArtifacts produces tool descriptors
+ a SKILL.md fragment + a `connectors`-category marketplace entry;
connectorAsImporter generalizes the dormant 0189 importers point;
evaluateConnectorInstall hard-blocks secret-holding AI-generated connectors from
auto-install (manual promotion required); wrapCliConnector turns an external
agent-native CLI (Printing Press et al.) into a governed Connector by mapping its
output into space-stamped nodes (egress caveat documented). 7 tests.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
All implementation-checklist items shipped on this branch; check off the inline
checklists, add an Implementation Status table (what shipped vs. seams), and mark
the filename [x]. Bridge-advertising is satisfied via `xnet mcp serve`; a
Connectors marketplace view and per-user OAuth are documented as deferred.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…nectors-0196

# Conflicts:
#	packages/cli/src/cli.ts
@crs48
crs48 temporarily deployed to pr-160 June 17, 2026 21:00 — with GitHub Actions Inactive
github-actions Bot added a commit that referenced this pull request Jun 17, 2026
@github-actions

github-actions Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Preview removed for PR #160.

@github-actions

Copy link
Copy Markdown
Contributor

🖼️ UI changes in this PR

No visual differences detected in the changed UI.

CI run

github-actions Bot added a commit that referenced this pull request Jun 17, 2026
@crs48
crs48 merged commit ec269d0 into main Jun 17, 2026
11 of 12 checks passed
@crs48
crs48 deleted the feat/agent-native-connectors-0196 branch June 17, 2026 21:07
github-actions Bot added a commit that referenced this pull request Jun 17, 2026
crs48 added a commit that referenced this pull request Jun 18, 2026
Backfills the notable user-facing PRs that merged before the changelog
automation existed (or were flagged `needs-changelog`):

| Entry | PR |
|---|---|
| A richer, interactive changelog | #151 |
| xNet adapts to your phone (mobile workbench) | #156 |
| See your local agent in the AI panel | #163 |
| Paid plugins | #157 |
| Agent-native Connectors | #160 |
| A new look — cosmic-web app icons | #153 |

Each fragment carries its **original** PR number, so `resolve-prs`
leaves it untouched and the gallery/link point at the right PR. The
**#156 entry auto-pulls its real mobile-vs-desktop before/after
sliders** from `visuals/pr/156/` — confirming the auto-gallery works on
a backfilled entry.

This PR also exercises the new flow itself: it **adds fragments**, so
the required `changelog-section` check passes via the fragment-present
path (no `skip-changelog` label).

Verified locally: `validate:changelog` → 19 fragments valid; `astro
build` clean; all 6 articles + the #156 before/after gallery render.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
crs48 added a commit that referenced this pull request Jun 18, 2026
## What

Backfills the changelog so it reflects what's live on `main`. The per-PR
fragment system (exploration 0197) was current through PR #163 (PR #178
backfilled #151/#153/#156/#157/#160/#163), but the recent **0198/0199
batch** and a couple of stragglers shipped without entries. This adds 7
fragments, with prose lifted from each PR's own `## Changelog` block
where present.

| PR | Entry | Tags |
|---|---|---|
| #143 | AI chat that knows your workspace | `ai` |
| #167 | Linear-grade Tasks | `tasks` `app` |
| #169 | Cleaner page editor typography | `editor` |
| #170 | Bring your Slack data into xNet | `plugins` `platform` |
| #171 | Smoother, more consistent motion | `app` |
| #173 | Airtable-grade database grids | `app` |
| #174 | A redesigned chat & channels experience | `app` |

## Deliberately excluded

- **In-editor AI (#154 / #158)** — shipped the transform engine +
diff/approval logic, but both PRs state the `/ai` UI wiring into the
running app is **deferred**, so it isn't user-visible yet. An entry
would overclaim.
- **Slack (#170)** — entry scoped to the migration connector +
compatibility layer (genuinely live); avoids claiming the
webhook/slash-command hub endpoints work, since they're
generic-over-an-injected-sink and not mounted in a running server yet.
- Pure infra/ops/docs PRs (cloud M1/M2, CI, runbooks) — not user-facing.

## Verification

- `validate-changelog.ts` → **26 fragments valid** (19 existing + 7 new)
- `prettier --check` on all new files → clean
- Newest-first ordering confirmed — the 7 entries slot in at the top

## Changelog

<!-- This PR only adds changelog fragments for already-merged work; it
ships no user-facing change of its own. -->

🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant