package raisfast:plugin-wit; interface types { record post-input { title: string, content: string, slug: option, excerpt: option, category-id: option, tag-ids: option>, status: option, cover-image: option, } record post-output { id: string, title: string, slug: string, content: string, excerpt: option, status: string, created-by: string, updated-by: option, category-id: option, view-count: s64, created-at: string, updated-at: string, published-at: option, } record comment-input { content: string, nickname: option, email: option, parent-id: option, } record content-event { content-type: string, data: string, id: option, } } interface host-api { use types.{post-output}; log: func(level: string, msg: string); get-config: func(key: string) -> option; http-get: func(url: string) -> option; http-post: func(url: string, body: string) -> option; call-api: func(client-key: string, op: string, input: string) -> option; get-data: func(key: string) -> option; set-data: func(key: string, value: string) -> bool; get-post: func(slug: string) -> option; db-query: func(sql: string, params: option) -> string; db-execute: func(sql: string, params: option) -> string; db-begin: func() -> string; db-commit: func() -> string; db-rollback: func() -> string; // Content-type host API (group-aware: 'group/plural', plural, or table name). ct-find: func(ct: string, query: string) -> string; ct-get: func(ct: string, id: string) -> string; ct-create: func(ct: string, data: string) -> string; ct-update: func(ct: string, id: string, data: string) -> string; // Job / integration host API. job-enqueue: func(job-type: string, payload: string, opts: string) -> string; get-receipt: func(trace-id: string) -> string; // Session-token host API (short-session widget JWTs). issue-token: func(input: string) -> string; verify-token: func(token: string) -> string; // ID utility: base62 (ID_ENCODING) → plain digit snowflake id. decode-id: func(id: string) -> string; // Presence host API (business-agnostic "who is available", architecture §5.3). presence-available: func(tenant: string) -> string; presence-status: func(tenant: string, subject: string) -> string; presence-report: func(tenant: string, subject: string, status: string) -> string; // Integration channel host API (app-scoped; channel-app-ownership.md §4.2). channel-list: func() -> string; channel-create: func(data: string) -> string; channel-update: func(id: string, data: string) -> string; channel-delete: func(id: string) -> string; vfs-read: func(path: string) -> option; vfs-write: func(path: string, content: string) -> bool; vfs-delete: func(path: string) -> bool; vfs-exists: func(path: string) -> bool; vfs-list: func(path: string) -> option; vfs-stat: func(path: string) -> option; emit-event: func(event-type: string, data: string) -> string; } interface plugin-hooks { use types.{post-input, post-output, comment-input, content-event}; on-post-creating: func(input: post-input) -> option; on-post-updating: func(input: post-input) -> option; on-comment-creating: func(input: comment-input) -> option; on-content-creating: func(input: content-event) -> option; on-content-updating: func(input: content-event) -> option; render-markdown: func(input: string) -> option; filter-html: func(input: string) -> option; on-post-created: func(output: post-output); on-post-updated: func(output: post-output); on-post-deleted: func(id: string); on-comment-created: func(input: comment-input); on-content-created: func(input: content-event); on-content-updated: func(input: content-event); on-content-deleted: func(content-type: string, id: string); on-login: func(user-id: string); on-cron-tick: func(payload: option); } world plugin-world { import host-api; export plugin-hooks; }