Skip to content

feat: add @lytics/lio-client-contentstack-brand-kit plugin#20

Merged
prosdev merged 2 commits intomainfrom
feature/contentstack-brand-kit
Feb 27, 2026
Merged

feat: add @lytics/lio-client-contentstack-brand-kit plugin#20
prosdev merged 2 commits intomainfrom
feature/contentstack-brand-kit

Conversation

@prosdev
Copy link
Collaborator

@prosdev prosdev commented Feb 27, 2026

Summary

  • New plugin package @lytics/lio-client-contentstack-brand-kit wrapping Contentstack Brand Kit and Knowledge Vault APIs
  • Single factory function (brandKitPlugin) exposing two namespaces: brandKit.* and knowledgeVault.*
  • 28 unit tests, all passing. 114 total across the workspace.

Brand Kit methods

  • list() — list brand kits
  • get(uid) — get single brand kit
  • listGuidelines(brandKitUid) — list agent guidelines
  • getResolvedGuidelines(brandKitUid, guidelineUid) — fully resolved guidelines (voice profile + KV context + prompts)
  • listVoiceProfiles(brandKitUid) — list voice profiles
  • getVoiceProfile(brandKitUid, profileUid) — get single voice profile

Knowledge Vault methods

  • ingest(payload) — ingest text content
  • search(params) — vector similarity search
  • hybridSearch(params) — vector + keyword search
  • listContent(options?) — paginated content listing
  • getContent(uid) — get single content item
  • updateContent(uid, payload) — update content
  • deleteContent(uid) — delete content

Live API verification

All endpoints were manually tested against the real Contentstack API using credentials from spark-ui:

Endpoint Result
brandKit.list() ✅ 2 kits returned (Jade Leaf, Data and Insights QA)
brandKit.get(uid) ✅ Name, description returned
brandKit.listGuidelines(uid) ✅ 1 guideline (System Default Agent Guidelines)
brandKit.getResolvedGuidelines(uid, glId) ✅ Full resolved payload with all guideline keys
brandKit.listVoiceProfiles(uid) ✅ Works (0 profiles in test kit)
knowledgeVault.ingest(payload) ✅ task_id, uid, tokens returned
knowledgeVault.search({content}) ✅ Documents with cosine similarity scores
knowledgeVault.hybridSearch({content}) ⚠️ Returns null body (200 OK) — likely no hybrid index configured on test kit
knowledgeVault.listContent({limit}) ✅ Paginated documents returned
knowledgeVault.getContent(uid) ✅ Single document with metadata
knowledgeVault.updateContent(uid, payload) ✅ "Your content will be updated shortly" + tokens
knowledgeVault.deleteContent(uid) ✅ "Content deleted Successfully"

API path corrections discovered during testing

  • Guidelines endpoint: /guidelines/agent-guidelines (response key: agent_guidelines)
  • Resolved endpoint: /resolve/resolved (response key: data)
  • KV base path: /ingest/knowledge-vault/ (all KV endpoints nested under /knowledge-vault/)
  • getContent returns unwrapped object directly, not { document: ... }

Test plan

  • pnpm install — workspace resolves new package
  • pnpm build — clean ESM output with .d.ts types
  • pnpm typecheck — no type errors across workspace (pre-commit hook)
  • pnpm test — 114 tests pass (28 new + 86 existing)
  • Manual verification against live Contentstack API

🤖 Generated with Claude Code

pros-cs and others added 2 commits February 26, 2026 23:37
Wrap Contentstack Brand Kit and Knowledge Vault APIs for Spark integration.
Exposes brandKit.* (list, get, guidelines, voice profiles) and
knowledgeVault.ingest() via a single factory plugin.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
API path corrections (verified against live API):
- Guidelines: /guidelines → /agent-guidelines (key: agent_guidelines)
- Resolved: /guidelines/{id}/resolve → /agent-guidelines/{id}/resolved (key: data)
- KV ingest: /ingest → /knowledge-vault/
- KV getContent: returns unwrapped object, not { document: ... }

New Knowledge Vault methods:
- search(params) — vector similarity search
- hybridSearch(params) — vector + keyword search
- listContent(options?) — paginated content listing
- getContent(uid) — single content item
- updateContent(uid, payload) — update content (PUT)
- deleteContent(uid) — delete content (DELETE)

Refactored kvFetch to support GET/POST/PUT/DELETE with optional
query params and body.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@prosdev prosdev merged commit f86bc79 into main Feb 27, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants