Add communication account plugin scaffolds

This commit is contained in:
Anthony Ettinger 2026-06-09 10:02:07 +00:00
parent 5cfeea6b57
commit c23ce42948
48 changed files with 1949 additions and 13 deletions

View file

@ -8,7 +8,13 @@
"./agent": "./schemas/logicsrc-agent.schema.json",
"./run": "./schemas/logicsrc-run.schema.json",
"./event": "./schemas/logicsrc-event.schema.json",
"./plugin": "./schemas/logicsrc-plugin.schema.json"
"./plugin": "./schemas/logicsrc-plugin.schema.json",
"./connected-account": "./schemas/logicsrc-connected-account.schema.json",
"./account-provider": "./schemas/logicsrc-account-provider.schema.json",
"./account-grant": "./schemas/logicsrc-account-grant.schema.json",
"./account-audit-event": "./schemas/logicsrc-account-audit-event.schema.json",
"./email-message": "./schemas/logicsrc-email-message.schema.json",
"./social-post": "./schemas/logicsrc-social-post.schema.json"
},
"files": [
"schemas"

View file

@ -0,0 +1,31 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.logicsrc.com/logicsrc-account-audit-event.schema.json",
"title": "LogicSRC Account Audit Event",
"type": "object",
"required": ["id", "provider", "kind", "principal", "action", "decision", "riskScore", "requestPreview", "resultPreview", "createdAt"],
"additionalProperties": false,
"properties": {
"id": { "type": "string", "minLength": 1 },
"accountId": { "type": "string", "minLength": 1 },
"provider": { "type": "string", "pattern": "^[a-z][a-z0-9-]*$" },
"kind": { "enum": ["social", "email"] },
"principal": {
"type": "object",
"required": ["type", "id"],
"additionalProperties": false,
"properties": {
"type": { "enum": ["user", "agent", "workflow", "plugin"] },
"id": { "type": "string", "minLength": 1 },
"trusted": { "type": "boolean" }
}
},
"action": { "type": "string", "pattern": "^[a-z][a-z0-9_-]*(:[a-z][a-z0-9_-]*)+$" },
"decision": { "enum": ["allow", "approval_required", "deny"] },
"riskScore": { "type": "number", "minimum": 0, "maximum": 1 },
"requestPreview": { "type": "object" },
"resultPreview": { "type": "object" },
"correlationId": { "type": "string", "minLength": 1 },
"createdAt": { "type": "string", "format": "date-time" }
}
}

View file

@ -0,0 +1,48 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.logicsrc.com/logicsrc-account-grant.schema.json",
"title": "LogicSRC Account Permission Grant",
"type": "object",
"required": ["id", "accountId", "principal", "permissions", "policy", "createdAt"],
"additionalProperties": false,
"properties": {
"id": { "type": "string", "minLength": 1 },
"accountId": { "type": "string", "minLength": 1 },
"principal": {
"type": "object",
"required": ["type", "id"],
"additionalProperties": false,
"properties": {
"type": { "enum": ["user", "agent", "workflow", "plugin"] },
"id": { "type": "string", "minLength": 1 },
"trusted": { "type": "boolean" }
}
},
"permissions": {
"type": "array",
"items": { "type": "string", "pattern": "^[a-z][a-z0-9_-]*(:[a-z][a-z0-9_-]*)+$" },
"uniqueItems": true
},
"policy": {
"type": "array",
"items": {
"type": "object",
"required": ["id", "resource", "action", "default"],
"additionalProperties": false,
"properties": {
"id": { "type": "string", "minLength": 1 },
"resource": { "type": "string", "minLength": 1 },
"action": { "type": "string", "pattern": "^[a-z][a-z0-9_-]*(:[a-z][a-z0-9_-]*)+$" },
"default": {
"enum": ["allow", "approval_required", "deny", "allow_if_dry_run", "allow_if_trusted_agent", "allow_if_below_risk_score"]
},
"conditions": { "type": "object" }
}
}
},
"expiresAt": { "type": "string", "format": "date-time" },
"createdBy": { "type": "string", "minLength": 1 },
"createdAt": { "type": "string", "format": "date-time" },
"revokedAt": { "type": "string", "format": "date-time" }
}
}

View file

@ -0,0 +1,31 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.logicsrc.com/logicsrc-account-provider.schema.json",
"title": "LogicSRC Account Provider",
"type": "object",
"required": ["id", "name", "kind", "authMethods", "capabilities"],
"additionalProperties": false,
"properties": {
"id": { "type": "string", "pattern": "^[a-z][a-z0-9-]*$" },
"name": { "type": "string", "minLength": 1 },
"kind": { "enum": ["social", "email"] },
"authMethods": {
"type": "array",
"items": { "enum": ["oauth2", "api_key", "imap_smtp", "local_bridge"] },
"minItems": 1,
"uniqueItems": true
},
"capabilities": {
"type": "array",
"items": { "type": "string", "pattern": "^[a-z][a-z0-9_-]*(\\.[a-z][a-z0-9_-]*)+$" },
"uniqueItems": true
},
"defaultScopes": {
"type": "array",
"items": { "type": "string", "minLength": 1 },
"uniqueItems": true
},
"status": { "enum": ["available", "planned", "disabled"] },
"docsUrl": { "type": "string", "format": "uri" }
}
}

View file

@ -0,0 +1,39 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.logicsrc.com/logicsrc-connected-account.schema.json",
"title": "LogicSRC Connected Account",
"type": "object",
"required": ["id", "ownerUserId", "kind", "provider", "displayName", "status", "scopes", "capabilities", "credentialRef", "metadata", "createdAt", "updatedAt"],
"additionalProperties": false,
"properties": {
"id": { "type": "string", "minLength": 1 },
"orgId": { "type": "string", "minLength": 1 },
"projectId": { "type": "string", "minLength": 1 },
"boardId": { "type": "string", "minLength": 1 },
"ownerUserId": { "type": "string", "minLength": 1 },
"kind": { "enum": ["social", "email"] },
"provider": { "type": "string", "pattern": "^[a-z][a-z0-9-]*$" },
"providerAccountId": { "type": "string", "minLength": 1 },
"displayName": { "type": "string", "minLength": 1 },
"handle": { "type": "string", "minLength": 1 },
"email": { "type": "string", "format": "email" },
"avatarUrl": { "type": "string", "format": "uri" },
"homepageUrl": { "type": "string", "format": "uri" },
"status": { "enum": ["connected", "expired", "revoked", "error", "disabled", "pending"] },
"scopes": {
"type": "array",
"items": { "type": "string", "minLength": 1 },
"uniqueItems": true
},
"capabilities": {
"type": "array",
"items": { "type": "string", "pattern": "^[a-z][a-z0-9_-]*(\\.[a-z][a-z0-9_-]*)+$" },
"uniqueItems": true
},
"credentialRef": { "type": "string", "minLength": 1 },
"metadata": { "type": "object" },
"createdAt": { "type": "string", "format": "date-time" },
"updatedAt": { "type": "string", "format": "date-time" },
"lastSyncedAt": { "type": "string", "format": "date-time" }
}
}

View file

@ -0,0 +1,22 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.logicsrc.com/logicsrc-email-message.schema.json",
"title": "LogicSRC Email Message Metadata",
"type": "object",
"required": ["id", "providerMessageId", "toAddresses", "ccAddresses", "labels", "hasAttachments"],
"additionalProperties": false,
"properties": {
"id": { "type": "string", "minLength": 1 },
"providerMessageId": { "type": "string", "minLength": 1 },
"threadId": { "type": "string", "minLength": 1 },
"subject": { "type": "string" },
"fromAddress": { "type": "string" },
"toAddresses": { "type": "array", "items": { "type": "string" } },
"ccAddresses": { "type": "array", "items": { "type": "string" } },
"snippet": { "type": "string" },
"labels": { "type": "array", "items": { "type": "string" } },
"hasAttachments": { "type": "boolean" },
"receivedAt": { "type": "string", "format": "date-time" },
"sentAt": { "type": "string", "format": "date-time" }
}
}

View file

@ -0,0 +1,26 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.logicsrc.com/logicsrc-social-post.schema.json",
"title": "LogicSRC Social Post",
"type": "object",
"required": ["id", "accountId", "status", "media", "metadata", "createdAt", "updatedAt"],
"additionalProperties": false,
"properties": {
"id": { "type": "string", "minLength": 1 },
"accountId": { "type": "string", "minLength": 1 },
"providerPostId": { "type": "string", "minLength": 1 },
"status": { "enum": ["draft", "pending_approval", "published", "deleted", "failed"] },
"text": { "type": "string" },
"media": {
"type": "array",
"items": { "type": "object" }
},
"url": { "type": "string", "format": "uri" },
"publishedAt": { "type": "string", "format": "date-time" },
"createdByPrincipalType": { "enum": ["user", "agent", "workflow", "plugin"] },
"createdByPrincipalId": { "type": "string", "minLength": 1 },
"metadata": { "type": "object" },
"createdAt": { "type": "string", "format": "date-time" },
"updatedAt": { "type": "string", "format": "date-time" }
}
}