mirror of
https://github.com/profullstack/logicsrc.git
synced 2026-08-13 14:37:26 +00:00
Add communication account plugin scaffolds
This commit is contained in:
parent
5cfeea6b57
commit
c23ce42948
48 changed files with 1949 additions and 13 deletions
16
docs/cli.md
16
docs/cli.md
|
|
@ -31,6 +31,9 @@ task
|
|||
wallet
|
||||
events
|
||||
agentswarm
|
||||
accounts
|
||||
social
|
||||
email
|
||||
credentials
|
||||
openspec
|
||||
plugins
|
||||
|
|
@ -66,6 +69,19 @@ logicsrc credentials plan --from doppler --to github-secrets
|
|||
|
||||
Credential sharing is provider-neutral. External tools can consume LogicSRC credential contracts, but LogicSRC commands do not call proprietary product CLIs.
|
||||
|
||||
Communication account commands:
|
||||
|
||||
```bash
|
||||
logicsrc accounts providers
|
||||
logicsrc accounts list
|
||||
logicsrc social providers
|
||||
logicsrc email providers
|
||||
logicsrc social post <account-id> --text "Launching today" --dry-run
|
||||
logicsrc email send <draft-id> --dry-run
|
||||
```
|
||||
|
||||
Communication account commands must redact credentials, support dry-run for write-capable actions, and require approval policies for outbound email and social publishing.
|
||||
|
||||
When `--openspec` is enabled, AgentSwarm writes OpenSpec.dev-style files under `openspec/changes/<change-id>/`.
|
||||
|
||||
Machine-readable output should be available anywhere data is returned:
|
||||
|
|
|
|||
139
docs/communication-accounts.md
Normal file
139
docs/communication-accounts.md
Normal file
|
|
@ -0,0 +1,139 @@
|
|||
# Communication Accounts
|
||||
|
||||
Status: draft implementation scaffold
|
||||
|
||||
Slug: `communication-accounts`
|
||||
|
||||
Communication Accounts is the LogicSRC standard for connecting external social and email identities, delegating scoped access to humans, agents, workflows, and plugins, and auditing every read/write action without exposing raw credentials.
|
||||
|
||||
## First-Party Plugins
|
||||
|
||||
```txt
|
||||
social-accounts
|
||||
email-accounts
|
||||
```
|
||||
|
||||
- `@logicsrc/plugin-social-accounts` manages social/network accounts such as Mastodon, Bluesky, GitHub, X/Twitter, Reddit, LinkedIn, YouTube, Discord, Telegram, and future ActivityPub/RSS-style adapters.
|
||||
- `@logicsrc/plugin-email-accounts` manages email inboxes and outbound sending identities through IMAP/SMTP, Gmail, Microsoft Graph, ForwardEmail.net, local bridges, and custom providers.
|
||||
|
||||
Both plugins share contracts from `@logicsrc/account-core`.
|
||||
|
||||
## Core Objects
|
||||
|
||||
```txt
|
||||
connected_account
|
||||
account_provider
|
||||
account_permission_grant
|
||||
account_policy
|
||||
account_audit_event
|
||||
credential_broker_call
|
||||
email_message_cache
|
||||
social_post_cache
|
||||
```
|
||||
|
||||
The shared account model records account kind, provider, account display metadata, granted scopes, declared capabilities, status, credential reference, ownership scope, and sync timestamps.
|
||||
|
||||
## Provider Boundary
|
||||
|
||||
Provider adapters implement the shared account provider contract:
|
||||
|
||||
```txt
|
||||
provider.id
|
||||
provider.kind
|
||||
provider.authMethods
|
||||
provider.capabilities
|
||||
provider.getAuthUrl()
|
||||
provider.completeAuth()
|
||||
provider.refreshCredential()
|
||||
provider.testConnection()
|
||||
provider.revoke()
|
||||
```
|
||||
|
||||
Social providers extend this with profile, draft, publish, media, mentions, comments, and analytics operations.
|
||||
|
||||
Email providers extend this with search, read, draft, send, reply, forward, archive, label, and delete operations.
|
||||
|
||||
## Permissions
|
||||
|
||||
Shared permissions:
|
||||
|
||||
```txt
|
||||
accounts:connect
|
||||
accounts:list
|
||||
accounts:read_metadata
|
||||
accounts:test
|
||||
accounts:revoke
|
||||
accounts:sync
|
||||
accounts:audit:read
|
||||
```
|
||||
|
||||
Social and email permissions use colon-style grant scopes such as `social:post:publish`, `social:mentions:read`, `email:headers:read`, `email:send`, and `email:attachments:read`.
|
||||
|
||||
Plugin manifest capabilities use the existing LogicSRC dotted capability convention such as `social.post.publish` and `email.headers.read`.
|
||||
|
||||
## Policy Gates
|
||||
|
||||
These actions require policy evaluation by default:
|
||||
|
||||
```txt
|
||||
social:post:publish
|
||||
social:post:delete
|
||||
social:dm:read
|
||||
social:dm:send
|
||||
email:attachments:read
|
||||
email:send
|
||||
email:delete
|
||||
```
|
||||
|
||||
Default write behavior is dry-run first, approval required for public publishing and outbound email, and deny for critical risk unless an admin override exists.
|
||||
|
||||
## Credential Rules
|
||||
|
||||
- Raw secrets must never be printed or exposed to agents by default.
|
||||
- OAuth refresh tokens and app passwords must be stored through a credential broker.
|
||||
- Provider calls should execute through a trusted runtime boundary.
|
||||
- Credential access must create audit events.
|
||||
- CLI, API, MCP, TUI, and PWA previews must redact secret-like fields.
|
||||
|
||||
## CLI Namespaces
|
||||
|
||||
```bash
|
||||
logicsrc accounts providers
|
||||
logicsrc accounts list
|
||||
logicsrc accounts audit <account-id>
|
||||
logicsrc social providers
|
||||
logicsrc social accounts
|
||||
logicsrc social post <account-id> --text "Launching today" --dry-run
|
||||
logicsrc email providers
|
||||
logicsrc email accounts
|
||||
logicsrc email send <draft-id> --dry-run
|
||||
```
|
||||
|
||||
The initial scaffold exposes provider listings and dry-run placeholders. Live connect, sync, send, and publish flows require durable credential broker, approval queue, and audit persistence.
|
||||
|
||||
## Storage
|
||||
|
||||
Deployable database migrations live under `supabase/migrations/`.
|
||||
|
||||
The communication account scaffold adds:
|
||||
|
||||
```txt
|
||||
connected_accounts
|
||||
account_permission_grants
|
||||
account_audit_events
|
||||
email_message_cache
|
||||
social_post_cache
|
||||
```
|
||||
|
||||
## MVP Order
|
||||
|
||||
1. Stabilize `packages/account-core`.
|
||||
2. Validate account schemas through `packages/validators`.
|
||||
3. Apply Supabase account migrations.
|
||||
4. Wire provider and account list commands.
|
||||
5. Add API read/list/dry-run endpoints and contract tests.
|
||||
6. Add MCP read-only resources.
|
||||
7. Add TUI/PWA account status panels.
|
||||
8. Implement IMAP/SMTP provider behind approval and audit gates.
|
||||
9. Implement Mastodon, Bluesky, or GitHub social provider behind approval and audit gates.
|
||||
10. Add Gmail OAuth after credential broker storage and restricted-scope handling are complete.
|
||||
|
|
@ -6,6 +6,9 @@ Core tables:
|
|||
users
|
||||
dids
|
||||
oauth_accounts
|
||||
connected_accounts
|
||||
account_permission_grants
|
||||
account_audit_events
|
||||
profiles
|
||||
organizations
|
||||
organization_members
|
||||
|
|
@ -34,6 +37,8 @@ notifications
|
|||
schemas
|
||||
schema_versions
|
||||
plugin_audit_logs
|
||||
email_message_cache
|
||||
social_post_cache
|
||||
```
|
||||
|
||||
Important relationships:
|
||||
|
|
@ -50,3 +55,4 @@ Important relationships:
|
|||
- API keys belong to users, agents, or service accounts.
|
||||
- Permissions are scoped to resources.
|
||||
- LogicSRC-compatible objects record their schema version.
|
||||
- Connected social and email accounts reference credentials through a broker and use account permission grants plus account audit events for agent-safe delegation.
|
||||
|
|
|
|||
|
|
@ -43,6 +43,30 @@ paths:
|
|||
responses:
|
||||
"201":
|
||||
description: Credential sync plan created
|
||||
/api/accounts/providers:
|
||||
get:
|
||||
summary: List social and email account providers
|
||||
responses:
|
||||
"200":
|
||||
description: Account providers returned
|
||||
/api/accounts:
|
||||
get:
|
||||
summary: List connected social and email accounts
|
||||
responses:
|
||||
"200":
|
||||
description: Connected accounts returned
|
||||
/api/social/providers:
|
||||
get:
|
||||
summary: List social account providers
|
||||
responses:
|
||||
"200":
|
||||
description: Social account providers returned
|
||||
/api/email/providers:
|
||||
get:
|
||||
summary: List email account providers
|
||||
responses:
|
||||
"200":
|
||||
description: Email account providers returned
|
||||
/api/schemas:
|
||||
get:
|
||||
summary: List supported LogicSRC schema kinds
|
||||
|
|
|
|||
|
|
@ -40,3 +40,39 @@ payment:spend_limited
|
|||
```
|
||||
|
||||
Spend controls must include per-run, per-day, and per-task limits. Agents must never receive wallet private keys.
|
||||
|
||||
Communication account scopes:
|
||||
|
||||
```txt
|
||||
accounts:connect
|
||||
accounts:list
|
||||
accounts:read_metadata
|
||||
accounts:test
|
||||
accounts:revoke
|
||||
accounts:sync
|
||||
accounts:audit:read
|
||||
social:profile:read
|
||||
social:post:draft
|
||||
social:post:publish
|
||||
social:post:delete
|
||||
social:media:upload
|
||||
social:mentions:read
|
||||
social:comments:read
|
||||
social:dm:read
|
||||
social:dm:send
|
||||
social:analytics:read
|
||||
email:headers:read
|
||||
email:body:read
|
||||
email:attachments:read
|
||||
email:search
|
||||
email:draft
|
||||
email:send
|
||||
email:reply
|
||||
email:forward
|
||||
email:archive
|
||||
email:labels:modify
|
||||
email:delete
|
||||
email:sync
|
||||
```
|
||||
|
||||
Outbound email, social publishing, private-message access, attachment reads, and destructive actions require policy gates and audit records by default.
|
||||
|
|
|
|||
|
|
@ -8,11 +8,14 @@ Default plugins:
|
|||
- uGig: job import, gig publishing, candidate/agent linking, bid sync, marketplace publishing, and reputation sync.
|
||||
- c0mpute: compute job dispatch, worker pool sync, usage reporting, quote creation, settlement status, and compute reputation events.
|
||||
- Credential Sharing: provider-neutral secret sync plans, approvals, rollbacks, and audit events.
|
||||
- Social Accounts: provider-neutral social profile, drafting, publishing, sync, policy, and audit flows.
|
||||
- Email Accounts: provider-neutral inbox, sending identity, search, draft, send, sync, policy, and audit flows.
|
||||
|
||||
Coming soon plugin specs:
|
||||
|
||||
- AgentByte: candidate, contractor, and agent capability screening for AI-era workflows. See `docs/agent-screening.md`.
|
||||
- Credential Sharing: replacement architecture for .env, Doppler, Railway variables, GitHub Secrets, and future providers. See `docs/credential-sharing.md`.
|
||||
- Communication Accounts: shared social and email account management contracts. See `docs/communication-accounts.md`.
|
||||
|
||||
Runtime requirements:
|
||||
|
||||
|
|
|
|||
|
|
@ -27,5 +27,6 @@
|
|||
25. Add SDK contracts for Rust, Bun, Node, Python, and curl.
|
||||
26. Add MCP server contracts.
|
||||
27. Add credential sync audit exports.
|
||||
28. Add docs.
|
||||
29. Tag v1.0.0.
|
||||
28. Add communication account contracts, plugins, schemas, and account audit events.
|
||||
29. Add docs.
|
||||
30. Tag v1.0.0.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue