module.social-media
Governed multi-provider social drafting, scheduling, publication, and reconciliation Hub.
@lssm-tech/module.social-mediabun add @lssm-tech/module.social-mediaManifest declarations describe the current workspace; they do not verify registry publication or runtime execution.
Package guide
Installable Social Media Feature Hub for Instagram, LinkedIn, TikTok, X, and YouTube. It intentionally does not widen the legacy four-provider SocialPlatform union.
The runtime defaults to draft-only. Publication requires injected atomic intent, provider, grant-verification, content-digest, policy, and audit ports. It creates one durable local intent per platform/revision, never blindly retries an ambiguous provider response, and reports partial results per platform.
Intent reads, compare-and-set transitions, recovery claims, and recovery scans are tenant-bound. Reconciliation derives platform/account authority from the stored intent and rejects caller substitution. A crash that leaves a pending intent is failed closed without provider dispatch; ambiguous dispatches are reconciled under a tenant-scoped fenced lease.
Use the root or ./hub export for turnkey installation, or the ./manifest, ./ports, ./runtime, ./view-model, and ./ui subpaths for granular composition.
./runtime now exports SocialSchedulingRuntime, its operation registrar and lifecycle worker registration. LinkedIn/X schedules preserve immutable revision/digest, explicit UTC publication/deadline instants, display timezone, grant reference and account targets. Cancellation is limited to unclaimed schedules. Due workers use CAS claims and call the existing publisher; unknown outcomes retain canonical intents for read reconciliation. Stale workers resume only with current authority and the same publication keys.
A content revision/account has one canonical publication. Reusing it replays the existing receipt; a deliberate repost needs a new reviewed content revision. Scheduling does not silently change this existing idempotency contract.
registerSocialScheduleWorker reuses the injected lifecycle scheduler. Batches first recover stale schedules and then process due work within the requested limit; the host must persist batch results. Use the existing Hub publication recovery for orphaned pending intents. No provider SDKs, credentials or permitting authority are installed by default.
Use optional providersV2 (Hub port social-media.providers-v2) for tenant-bound native adapters. The required legacy providers map can be empty. V2 takes precedence for its configured platform and always receives tenant/account identity plus the canonical local key. There is no fallback after an ambiguous V2 result. Resolve or explicitly bridge old ambiguous receipts before changing provider implementations. Legacy typing/defaults stay unchanged.
V2 adapters may implement resume for durable multi-part content. The scheduler calls it only through a freshly authorized canonical continuation claim. Active recovery leases prevent the claim; legacy providers retain replay behavior. V2 publish/resume requests include the named publishing grant so adapters can stop later parts after revocation. Reconciliation remains read-only at the native provider boundary.
Owner-only member-approved scheduling (TS-01-SOC)
Scheduling is owner-only: a schedule records its owner, and any other caller (including a non-member, or a refused authorization) receives SOCIAL_SCHEDULE_NOT_FOUND; due reads return only the caller's own schedules. SocialMediaHighRiskGrant is the agent_autonomy | member_approval union. Owners submit acknowledgements (unattended_publication for unattended runs, temporary_public_images for Instagram), an exact publication kind and the reviewed bindingHash per target; the runtime mints one member approval per target bound to owner, account, connection version, revision/digest, kind, acknowledgements and expiry. Create-time refusals run in source order (capacity, binding, duplicates, mentions, publisher reservation, similar content), re-run at dispatch, and move a schedule to held (finding) or waiting (disconnect or credential bump); resume needs fresh acknowledgements. The operations cover schedule create, publish-now, cancel, resume, dispatch, continue, reconcile, get, due, run-due and account disconnect (version 2.0.0). Claims are fenced leases with <tenantId>:-prefixed ids. registerSocialScopedScheduleWorker runs one scope-bound runtime per discoverGrowthDueScopes tuple. Bindings, per-kind qualification and the content reader are host ports.
Relationships
Arrows point from a package to its direct dependency. Counts are derived from captured workspace manifests.
5 declarations
@lssm-tech/lib.contracts-runtime-coreworkspace:^
Read the package manual ↗@lssm-tech/lib.contracts-spec-coreworkspace:^
Read the package manual ↗@lssm-tech/lib.growth-specworkspace:^
Read the package manual ↗@lssm-tech/lib.orchestration-specworkspace:^
Read the package manual ↗@lssm-tech/lib.surface-runtimeworkspace:^
Read the package manual ↗
Declared capabilities
Governed multi-provider social drafting, scheduling, publication, and reconciliation Hub.
Scripts
publish:pkgbun publish --tolerate-republish --ignore-scripts --verbosepublish:pkg:canarybun publish:pkg --tag canarybuildcontractspec-bun-build buildbuild:bundlecontractspec-bun-build transpilebuild:typescontractspec-bun-build typesdevcontractspec-bun-build devcleanrimraf dist .turbolintbun lint:fixlint:fixnode ../../../../scripts/biome.cjs check --write .lint:checknode ../../../../scripts/biome.cjs check .testbun testprebuildcontractspec-bun-build prebuildtypechecktsgo --noEmit