pearcord-automation-export
Guild automation manifest export/import and per-guild hook persistence. P2P-safe bundles contain no secrets.
v0.8.661 (Phase 686): Registry modal UX in automation-ui.js; platform automation-mixin.js gossip dedupe + partition heal; deep link ?automation=1. Bundle: test:ci-phase686 (app repo). See AUTOMATION_EXPORT.md.
v0.8.541 (Phase 578): Automation hub live panel + platform guildCount on automation spans; agentctl dry-run/export refreshView. Bundle: test:phase578-automation (app repo).
v0.8.503 (Phase 540): Split automation panel compositor; automation.dispatch span; agentctl upsertGuildAutomationHook/dryRunGuildAutomationHook/exportGuildAutomationManifest. Bundle: test:phase540-automation (app repo).
v0.8.454 (Phase 491): App automation compositor + platform span metadata on hook/manifest/dry-run. Bundle: test:phase491-automation (app repo). See AUTOMATION_EXPORT.md.
Mission
Let moderators snapshot automod settings, slash commands, bot metadata, and automation hooks into a portable pearcord-automation-manifest, validate imports, and store up to 32 hooks per guild in JSON collections synced via mesh slices.
When to use / not
Use when:
- Exporting/importing server automation configuration.
- CRUD on automation hooks (
AutomationManifestStore). - Building manifest JSON for backup or migration.
Do not use when:
- You need runtime hook dispatch — use
pearcord-delivery-receipts. - You need live event streaming — use
pearcord-app-events.
Public API
| Export | Role |
|---|---|
AutomationManifestStore |
listHooks, upsertHook, deleteHook, replaceHooks, exportSyncSlice, ingestSyncSlice |
buildAutomationManifest({...}) |
Versioned manifest object |
validateAutomationManifest(manifest, opts?) |
{ ok, errors[] } |
normalizeHook(partial, guildId) |
Sanitized hook row |
MANIFEST_VERSION |
1 |
MAX_HOOKS |
32 |
ACTION_TYPES / ACTION_TYPE_LIST |
log, notify, fanout-local, digest-relay |
CATEGORY_OPTIONS |
UI flags from APP_EVENT_CATEGORIES |
HOOKS_COLLECTION |
@pearcord/automation-hooks |
Hook shape
{
id, guildId, name, enabled, categories, // bitmask
filter: { eventTypes: [] }, // optional subset
action: { type: 'log' },
note
}
Manifest kind
kind: 'pearcord-automation-manifest', includes sanitized automod, slashCommands, bots, hooks—no tokens or webhook secrets.
P2P surface
Hook rows gossip through platform automation sync (mesh slice { hooks: [...] }). Manifest import is a local file/IPC operation; re-gossip happens after importAutomationManifest.
Storage
JsonStore at {storagePath}/automation-export.
Requires setGuild(guildId) before mutations.
Platform integration
const {
AutomationManifestStore,
buildAutomationManifest,
validateAutomationManifest
} = require('pearcord-automation-export')
this.automationStore = new AutomationManifestStore({ storagePath })
await this.automationStore.ready()
this.automationStore.setGuild(guildId)
const manifest = buildAutomationManifest({
guildId,
guildName,
exportedBy: userId,
automodConfig: await automod.getConfig(),
slashCommands: await slashRegistry.list(),
bots: installedBots,
hooks: await this.automationStore.listHooks()
})
UI / IPC
export-automation-manifest→{ type: 'automation-manifest', manifest }import-automation-manifest—mergeoptionupsert-automation-hook/delete-automation-hook
Code example
const { AutomationManifestStore, validateAutomationManifest } = require('pearcord-automation-export')
const store = new AutomationManifestStore({ storagePath: './pearcord-storage' })
await store.ready()
store.setGuild('g1')
await store.upsertHook({
name: 'Log joins',
categories: 1 << 1, // MEMBERS
action: { type: 'log' },
filter: { eventTypes: ['memberJoin'] }
})
const check = validateAutomationManifest(manifest, { expectedGuildId: 'g1' })
Related docs
- Platform automation settings UI
pearcord-delivery-receiptsfor hook actions
Tests
v0.8.391 (Phase 428): Audit JSON/JSON export uses formatAuditExport in pearcord-delivery-receipts; see test:audit-export and docs/AUDIT_EXPORT.md.
- IPC import/export smokes
- Hook merge on mesh ingest