40 Commits

Author SHA1 Message Date
Alex Dunmow
f232effe69 feat(cli): init prompts for kind and categories 2026-06-03 06:56:07 +08:00
Alex Dunmow
a79aa709c2 feat(core): mirror Plugin.kind + ListCategories proto regen 2026-06-03 01:44:26 +08:00
Alex Dunmow
08be22ec34 feat(sdk): add Kind and Categories to ModPlugin; writeMod emits them 2026-06-03 01:41:56 +08:00
Alex Dunmow
aafdc44f6f fix(cli): drop duplicated version in publish output (Coords already includes it) 2026-06-03 01:41:03 +08:00
Alex Dunmow
57a217f54d feat(cli): warn at publish when tracked files match .gitignore 2026-06-03 01:35:04 +08:00
Alex Dunmow
c825942c8d feat(cli): init auto-commits plugin.mod, drops ninja git remote 2026-06-03 01:34:42 +08:00
Alex Dunmow
e5b27f5a65 feat(cli): rewrite plugin publish to send tar.zst archive 2026-06-03 01:33:12 +08:00
Alex Dunmow
a827cda37a feat(core): mirror PublishVersionRequest archive bytes proto change 2026-06-03 01:27:16 +08:00
Alex Dunmow
31e7b72b49 feat(cli): add BuildSourceArchive for plugin publish tar.zst 2026-06-03 01:21:55 +08:00
Alex Dunmow
680cbe0160 chore(core): add klauspost/compress for plugin archive zstd 2026-06-03 01:19:51 +08:00
Alex Dunmow
e9bef5b065 docs: plan, UAT, and execution prompt for plugin tarball publish + categories 2026-06-03 01:18:13 +08:00
Alex Dunmow
2a76b30c51 feat(cli): scope subcommand, interactive scope prompt, bump+version helpers
Pre-existing CLI improvements ahead of the tarball-publish refactor:
- New top-level `ninja scope` command (create, list, set-default).
- `init` accepts no --scope: prompts from ListMyScopes or uses creds default.
- Plugin name prompted if not provided.
- `plugin bump <major|minor|patch>` writes the bumped version into plugin.mod.
- `plugin version` prints the current plugin.mod version.
- `login` prints a URL with ?user_code= so the link is one click.
- creds: HostCreds gains optional default_scope.
- plugin/version: ParseBaseSemver + BumpVersion helpers, with tests.
2026-06-03 01:18:11 +08:00
Alex Dunmow
1d9ca44f55 docs(spec): plugin publish (tarball) + categories design
Design for two coupled changes: drop git as the publish transport in
favour of tar.zst uploads, and add a first-class plugin kind plus a
configurable, validated category list.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-03 00:58:21 +08:00
Alex Dunmow
32c6528162 feat(templates): add HTMLComponent interface and first-class pongo2 engine
Decouple TemplateFunc from templ.Component by introducing a generic
HTMLComponent interface that both templ and pongo2 satisfy via Go
structural typing. Add a complete pongo2 rendering engine in
templates/pongo/ with page templates, block templates (with BlockContext
injection and icon processing), template overrides, and email wrappers.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
v0.10.0
2026-06-02 23:07:11 +08:00
Alex Dunmow
7f4bce79c9 feat(cli): ninja CLI with login, plugin init/publish/status
Cobra scaffold, credentials store, Connect client, device-flow login,
whoami/logout, plugin init (creates + adds git remote), publish (tag + push
+ registry RPC), and status (list scopes/plugins). Proto copied from
orchestrator with buf codegen for client stubs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-06-01 23:55:01 +08:00
Alex Dunmow
7ff326ef25 feat(sdk): ModFile struct, ParseModFull, and tests
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-06-01 22:45:26 +08:00
Alex Dunmow
a5caf2d9e7 chore(sdk): add deps for plugin.mod parser and ninja CLI
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-06-01 22:44:55 +08:00
Alex Dunmow
245e38dc95 feat(render): autolink https:// URLs in BlockNote inline text
Plain-text nodes inside paragraphs, headings, lists and table cells now
auto-wrap any https:// URL in <a href="..." rel="noopener">URL</a>.

- Bare domains, www. and http:// URLs are intentionally not linked
- Suppressed inside explicit `link` inline nodes (no nested anchors)
- Suppressed inside `code`-styled spans (URL stays literal)
- Trailing sentence punctuation (.,;:!?'") is excluded from the linked URL
- Closing parens/brackets/braces are kept inside the URL only when
  balanced with an opener (so Wikipedia-style _(bar) is preserved
  but `(see https://x.com)` doesn't eat the trailing paren)
- Bold/italic/color style wrappers compose around the anchor

`renderInlineContent` gains an `insideLink bool` parameter; all existing
call sites pass `false`, and the `link` branch recurses with `true`.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
v0.9.0
2026-05-21 02:01:41 +08:00
Alex Dunmow
7eb3e27053 feat: converge BlockNote renderer, add datasources bridge, rename ServiceDeps to CoreServices
SDK renderer now has full feature parity with the host: text alignment,
checkListItem, toggleListItem, video, audio, file, statement blocks,
and text/background color inline styles. New datasources.Datasources
interface lets plugins resolve buckets directly.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
v0.8.0
2026-05-03 10:18:32 +08:00
Alex Dunmow
9c62780246 feat: add context-aware BlockNote SDK bridge v0.7.0 2026-05-03 08:36:08 +08:00
Alex Dunmow
b2c968af41 feat: add SymposiumSeeder and MessengerSeeder bridge interfaces
Defines cross-plugin seeder interfaces in the SDK so template plugins
can seed Symposium/Messenger content via PluginBridge without importing
their database packages directly.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
v0.6.0
2026-05-03 00:16:46 +08:00
Alex Dunmow
601718a309 feat: add Load/Unload lifecycle hooks to PluginRegistration
Enables runtime plugin disable/enable without CMS restart.
Load is called after registration succeeds; Unload on disable
with a 30-second context deadline.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
v0.5.0
2026-05-02 22:28:49 +08:00
Alex Dunmow
334d79b4bf fix: EnsureSetting accepts any value type for JSON-serializable settings
Plugins store arrays and scalars as settings, not just maps.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
v0.4.1 v0.4.2
2026-05-02 12:13:39 +08:00
Alex Dunmow
a2a56f642c fix: UpdateDataTableRowField accepts any value type, not just maps
The provisioner just marshals the value to JSON regardless of type.
Restricting to map[string]any prevented plugins from setting scalar
field values (strings, numbers, booleans).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-02 12:10:36 +08:00
Alex Dunmow
62c25a7b3a feat: add settings.Updater interface to ServiceDeps v0.4.0 2026-05-02 11:03:40 +08:00
Alex Dunmow
2c89ce4d42 feat: add BadgeRefresher interface and badge types 2026-05-02 11:03:09 +08:00
Alex Dunmow
1ede7d50be feat: add ReviewSubmitter interface to ServiceDeps 2026-05-02 11:02:28 +08:00
Alex Dunmow
a174eb943d feat: add CoreServiceBindings interface to ServiceDeps 2026-05-02 11:02:08 +08:00
Alex Dunmow
d270bc8582 feat: extend EmbeddingService and RAGService interfaces for .so plugins
Add EmbedContent/IsAvailable to EmbeddingService and
RegisterContentFetcher/OnContentChanged to RAGService so .so plugins
can use embedding and RAG capabilities through SDK interfaces instead
of type-asserting CMS concrete types.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
v0.3.0
2026-05-02 09:25:44 +08:00
Alex Dunmow
3753210c2d feat: add ListTiers to subscriptions SDK interface
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
v0.2.1
2026-05-01 12:49:08 +08:00
Alex Dunmow
917eee13a2 feat: add menus, subscriptions, public users, and plugin bridge to SDK
New capability interfaces:
- menus.Menus: menu/nav access (GetMenuByName, GetMenuItems)
- subscriptions.Subscriptions: tier/plan access (GetUserTierLevel, GetTierBySlug, ListActivePlans)
- auth.PublicUsers: public user profiles (GetByUsername, GetByID)
- plugin.PluginBridge: inter-plugin service registry with typed GetServiceAs[T] helper

All added to ServiceDeps for plugin consumption.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
v0.2.0
2026-05-01 12:36:13 +08:00
Alex Dunmow
43deff21f7 feat: tighten types — MasterPageBlock JSON tags + *string, BlockNote []map[string]any
- Add JSON struct tags to MasterPageBlock and MasterPageDefinition
- Change MasterPageBlock.HtmlContent from string to *string (nullable)
- Change BlockNote renderer signatures from []any to []map[string]any
- Move type assertions to JSON boundary in blocksFromRaw/inlineContentFromRaw

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
v0.1.1
2026-05-01 11:37:41 +08:00
Alex Dunmow
13d741979a fix: rename module path from ninja/core to block/core
Matches the actual Gitea repo location at block/core.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
v0.1.0
2026-05-01 09:39:10 +08:00
Alex Dunmow
1be5172358 chore: go mod tidy before v0.1.0 tag
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-01 09:18:19 +08:00
Alex Dunmow
868df2d761 feat: WO-PS-011 SDK templates/bn shared components
Head, engagement, toolbar templ components and validation helpers
for use by template plugins.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-01 09:17:55 +08:00
Alex Dunmow
71d3416304 feat: WO-PS-010 SDK HTMLBlock with MediaResolver interface
HTMLBlock uses MediaResolver interface instead of db.Queries for
media metadata enrichment. Includes shared ButtonConfig, MediaValue,
TemplateRenderer interface, and block helper utilities.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-01 09:17:50 +08:00
Alex Dunmow
7c20538a4e feat: WO-PS-009 SDK plugin types
- plugin/types.go: Pool, EmailSender, JobHandlerFunc, Dependency,
  AdminPage, AIAction, MasterPageDefinition, status/source constants,
  MediaAnalyzedEvent, ModerationDecisionEvent, MediaHooksProvider,
  DirectoryExtensions
- plugin/deps.go: ServiceDeps with typed capability interfaces
  (Content, Settings, Gating, Crypto, ToolRegistry, JobRunner,
  EmbeddingService, RAGService)
- plugin/registration.go: PluginRegistration, RegisterFunc
- plugin/service.go: ConnectServiceBinding with generics, ServiceMount,
  ServiceRegistration
- plugin/provisioner.go: Provisioner interface with all config types
- plugin/css_manifest.go: CSSManifest, MergedCSSManifest, MergeCSSManifests
- plugin/version.go: ParseModVersion, CompareVersions
- plugin/topo_sort.go: TopologicalSort (Kahn's algorithm)
- plugin/block_registry.go: PluginBlockRegistry (auto-prefixing wrapper)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-30 22:41:52 +08:00
Alex Dunmow
79c558a968 fix: replace any with typed context accessors in SDK
- Define PageContext, PostContext, AuthorContext, CategoryContext,
  MasterPageContext structs for typed context passing
- Define EmbedResolver interface
- Make GetQueries generic: GetQueries[T](ctx) (T, bool)
- Fix Content.BlockNoteToHTML to take map[string]any, not any

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-30 22:39:34 +08:00
Alex Dunmow
99fc63ddfd feat: WO-PS-002–008 SDK type packages
- rbac/: Role type, constants, HasPermission, RoleFromString
- blocks/: BlockFunc, BlockMeta, BlockContext, context accessors, BlockRegistry interface
- templates/: TemplateFunc, meta types, TemplateRegistry interface
- auth/: Claims, PublicClaims, context extractors
- content/: Content interface, AuthorProfile/PageInfo/PostInfo types
- settings/: Settings interface, map accessor helpers
- gating/: AccessRule, AccessResult, EvaluateAccess, Gating interface
- crypto/: Crypto interface (Encrypt/Decrypt)
- render/: BlockNoteToHTML standalone renderer
- video/: ParseEmbedURL, EmbedIframeURL
- ai/: ToolDefinition, ToolResult, ToolRegistry interface

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-30 22:32:29 +08:00
Alex Dunmow
0991b791b1 feat: WO-PS-001 initialize SDK repo
Initialize git.dev.alexdunmow.com/ninja/core with Go 1.26 module,
package directory structure, and README.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-30 22:25:52 +08:00