feat(sdk): add plugin management endpoints#71
Merged
Conversation
Add a typed PluginsClient + contracts covering the full backend plugin surface: list, get, upload (multipart bundle), activate, enable, disable, config, priority, logs. - contracts: PluginHook/PluginRuntimeType/PluginOutcome enums, PluginDetail/ PluginSummary/PluginVersion/PluginInvocationLog/PluginConsoleLine models, and Activate/UpdateConfig/SetPriority requests + GetPluginLogsOptions - sdk: plugins endpoint group, InsurUpPluginClient (FormData upload), wired onto DefaultInsurUpClient.plugins and exported Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
kerem-acer
added a commit
to InsurUp/cli
that referenced
this pull request
Jun 6, 2026
New `insurup plugins` command group: - init: scaffold a plugin project — interactive prompts (or flags) for id, language (ts|js), package manager (bun|npm|pnpm|yarn), and bundler (bun|esbuild) - build / deploy: run the project's own package.json `build` script (with the chosen/detected package manager), then Jint-safety-scan + zip the output and (for deploy) upload via @insurup/sdk, optionally activate + set config - list / get / logs / activate / enable / disable / config / priority The bundler is the plugin project's choice (not hardcoded) — the CLI orchestrates `<pm> run build`. Zipping uses fflate; a select/text prompt helper backs init. Depends on InsurUp/ts-toolkit#71 (the @insurup/sdk plugin endpoints). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- add deletePlugin(pluginId) (DELETE plugins/{PluginId}) + the route, mirroring
the backend endpoint added to core
- plugin enums were numeric/PascalCase but the API serializes them as UPPER_SNAKE
strings (JsonStringEnumConverter). Convert PluginHook / PluginRuntimeType /
PluginOutcome to string enums with the wire values, matching the rest of the
contracts package
- refresh PluginHook: drop OnAgentCreated (removed backend-side), replace the
stale ValidateCustomer/MutateCustomer/DecorateIgwRequest with the current
validation (VALIDATE_*) and transformation (TRANSFORM_*) hooks
- add PluginOutcome.Disabled (DISABLED)
- PluginInvocationLog.hookName:string -> hook:PluginHook, and the logs query
param hookName -> hook (both match the API)
typecheck / lint / build / test green (sdk: 397 tests).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
kerem-acer
added a commit
to InsurUp/cli
that referenced
this pull request
Jun 8, 2026
* feat(plugins): add plugin build/deploy/manage commands New `insurup plugins` command group: - init: scaffold a plugin project — interactive prompts (or flags) for id, language (ts|js), package manager (bun|npm|pnpm|yarn), and bundler (bun|esbuild) - build / deploy: run the project's own package.json `build` script (with the chosen/detected package manager), then Jint-safety-scan + zip the output and (for deploy) upload via @insurup/sdk, optionally activate + set config - list / get / logs / activate / enable / disable / config / priority The bundler is the plugin project's choice (not hardcoded) — the CLI orchestrates `<pm> run build`. Zipping uses fflate; a select/text prompt helper backs init. Depends on InsurUp/ts-toolkit#71 (the @insurup/sdk plugin endpoints). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * feat(plugins): add `remove` command + align logs hook filter with the SDK - add `insurup plugins remove <id>` (client.plugins.deletePlugin), mirroring the disable command, for the new backend DELETE /plugins/{id} - the logs hook filter passed `hookName`; the SDK option was renamed to `hook` (a PluginHook). Pass `{ hook }` and import the PluginHook type. Verified against a local @insurup/sdk build that has the plugin client: tsc 0 errors, biome clean. NOTE: CI stays red until @insurup/sdk is published with the plugin client (ts-toolkit#71) and this PR bumps the dependency + regenerates the frozen lockfile. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * chore(deps): bump @insurup/sdk to 0.1.35 (adds the plugin client) Unblocks the plugin commands: 0.1.35 (ts-toolkit#71) ships InsurUpPluginClient with deletePlugin and the UPPER_SNAKE plugin enums. Regenerates the lockfile, fixing the frozen-lockfile CI failure. typecheck / biome / 243 tests / build all green. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a typed PluginsClient + contracts to
@insurup/sdk/@insurup/contracts, covering the full backend plugin-management surface so the CLI (and any consumer) can install, configure, and observe server-side plugins.What's added
@insurup/contracts(src/plugins.ts)PluginHook(events 0–16 + sync hooks at 100k/200k/300k),PluginRuntimeType(JavaScriptJint = 1),PluginOutcome(Ok/Faulted/TimedOut/LimitExceeded)PluginDetail,PluginSummary,PluginVersion,PluginInvocationLog,PluginConsoleLineActivatePluginRequest,UpdatePluginConfigRequest,SetPluginPriorityRequest,GetPluginLogsOptions@insurup/sdkpluginsendpoint group incore/endpoints.ts(incl. alogsquery builder forlimit/hookName)InsurUpPluginClient(clients/plugin.ts) with:getPlugins,getPluginById,uploadPlugin(multipartFormData),activatePlugin,enablePlugin,disablePlugin,updatePluginConfig,setPluginPriority,getPluginLogsDefaultInsurUpClient.pluginsand exported from the package rootNotes
uploadPluginaccepts aBlob/FileorArrayBufferand posts it as multipartfile— the host derives hooks + the config schema from the bundle.InsurUpResult<T>, bilingual JSDoc).Verified
bun run typecheck,bun run build,bun run lint,bun run format:check— all green.🤖 Generated with Claude Code