Files
nanoclaw/scripts
gavrielc 2f26d4ebc1 feat(skills): programmatic wiring via ncl — no nc:wire directive
Wiring a channel is just "collect input + call ncl", so it needs no new
directive — only that nc:run interpolates prompted {{vars}} and that the ncl
wiring verbs are idempotent + natural-key addressable.

Engine:
- nc:run now substitutes prompted {{vars}} into commands (same VAR_REF as
  env-set), so a run can `ncl … {{owner_email}}`. The journal records the
  ORIGINAL command (placeholders intact) so a substituted secret never lands in
  the journal/remove replay. An unanswered prompt → unresolved → deferred
  (degrade), never a crash. New documented effect:wire (no undo — the rows it
  creates are user runtime data, not reversed on remove).

ncl:
- crud gains optional `naturalKey`: generic create returns an existing row
  instead of a UNIQUE violation, making re-applied wiring idempotent (users).
- `messaging-groups create` → custom op: defaults the NOT NULL `instance` to
  channel_type and is idempotent on (channel_type, platform_id, instance).
- `messaging-groups send` → new op: injects an inbound (the cli admin-transport
  InboundEvent) to wake the wired agent — the welcome, as a plain ncl call.
- `wirings create` → custom op: resolves natural keys (channel_type+platform_id
  → messaging group; agent-group folder → agent group) and is idempotent on the
  pair. Direct --messaging-group-id / --agent-group-id still work.

Skills (proof, one per archetype):
- add-resend: owner-bootstrap wiring is now nc:prompt + nc:run effect:wire
  (users create → roles grant → messaging-groups create → wirings create →
  messaging-groups send welcome), replacing the init-first-agent shell block.
- add-linear: pre-wire is now nc:prompt + nc:run effect:wire, reusing the
  {{linear_team_key}} collected in Credentials — also retires the raw-SQL
  INSERTs (anti-pattern #4, and they referenced a stale column set).

Tests: nc:run substitution (interpolate / journal-original / defer-on-unanswered);
ncl verb idempotency + natural-key resolution via host-caller dispatch. Full
suite 594 passed | 1 skipped.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-27 15:46:12 +03:00
..
2026-05-08 15:56:09 +03:00