navin_library.go (package eai)
Source: sdks/go/navin_library.go. Back to the Go SDK reference index.
This page is generated by tools/docs/gen_sdk_reference.py from the SDK sources and the OpenAPI text folders. Do not edit it by hand: change the source and regenerate.
Class NavinLibraryService
NavinLibraryService groups the endpoints of: Navin library vendored with the platform (skills, plugins, commands, agents, MCP presets, channels), its activation per project, and the rules of a project (ADR-0164).
NavinLibraryService.Activate
Activate(ctx context.Context, projectID string, body any, opts ...CallOption) (json.RawMessage, error)
Activate a library item. Activates a skill, a plugin (with its skills, commands and agents), a command or an agent for the project (201). A skill is registered in the Skill Registry, verified by its library digest; a skill name already used by a skill not from the library answers 409 navin_skill_name_taken. Needs tenant_admin, developer or application_owner and the ReBAC relation editor. 422 navin_library_kind_not_activable; 404 navin_library_item_not_found. Audited as navin_library.activate.
Route: /v1/projects/{project_id}/navin-library/activations (POST).
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
ctx | context.Context | yes | Context of the call: cancellation and deadline. | |
projectID | string | yes | Identifier (UUID) or slug of the project. | |
body | any | yes | Kind and name of the item to activate. | |
opts | ...CallOption | no | Per call options (query, idempotency key, traceparent, headers). |
Returns: (json.RawMessage, error). Decoded JSON answer of the operation "Activate a library item". The error is a typed error of the SDK, nil on success.
Raises: error, the typed errors of the transport (Errors).
NavinLibraryService.Deactivate
Deactivate(ctx context.Context, projectID string, activationID string, opts ...CallOption) (json.RawMessage, error)
Deactivate a library item. Removes an activation from the project; a plugin takes the skills, commands and agents it brought with it. Needs tenant_admin, developer or application_owner and the ReBAC relation editor. 404 navin_library_activation_not_found. Audited as navin_library.deactivate.
Route: /v1/projects/{project_id}/navin-library/activations/{activation_id} (DELETE).
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
ctx | context.Context | yes | Context of the call: cancellation and deadline. | |
projectID | string | yes | Identifier (UUID) or slug of the project. | |
activationID | string | yes | Identifier (UUID) of the activation. | |
opts | ...CallOption | no | Per call options (query, idempotency key, traceparent, headers). |
Returns: (json.RawMessage, error). Decoded JSON answer of the operation "Deactivate a library item". The error is a typed error of the SDK, nil on success.
Raises: error, the typed errors of the transport (Errors).
NavinLibraryService.DeleteRule
DeleteRule(ctx context.Context, projectID string, name string, opts ...CallOption) (json.RawMessage, error)
Delete a project rule. Deletes the rule; runs of the project no longer receive it. Needs tenant_admin, developer or application_owner and the ReBAC relation editor. 404 rule_not_found. Audited as project.rule.delete.
Route: /v1/projects/{project_id}/rules/{name} (DELETE).
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
ctx | context.Context | yes | Context of the call: cancellation and deadline. | |
projectID | string | yes | Identifier (UUID) or slug of the project. | |
name | string | yes | Name of the rule. | |
opts | ...CallOption | no | Per call options (query, idempotency key, traceparent, headers). |
Returns: (json.RawMessage, error). Decoded JSON answer of the operation "Delete a project rule". The error is a typed error of the SDK, nil on success.
Raises: error, the typed errors of the transport (Errors).
NavinLibraryService.ImportRules
ImportRules(ctx context.Context, projectID string, files []RuleFile, opts ...CallOption) (json.RawMessage, error)
Import the rule files of a repository. Imports the rule files of a repository (.navin/rules, .cursor/rules/*.mdc with their frontmatter, .cursorrules, .clinerules, .windsurfrules, .github/copilot-instructions.md); each recognised file creates or replaces a rule. Other files are reported in skipped with a reason (not_a_rule_file, empty, too_large). At most 200 files (400 invalid_request). Needs tenant_admin, developer or application_owner and the ReBAC relation editor.
Route: /v1/projects/{project_id}/rules/import (POST).
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
ctx | context.Context | yes | Context of the call: cancellation and deadline. | |
projectID | string | yes | Identifier (UUID) or slug of the project. | |
files | []RuleFile | yes | Files to import (1 to 200). | |
opts | ...CallOption | no | Per call options (query, idempotency key, traceparent, headers). |
Returns: (json.RawMessage, error). Decoded JSON answer of the operation "Import the rule files of a repository". The error is a typed error of the SDK, nil on success.
Raises: error, the typed errors of the transport (Errors).
NavinLibraryService.InstallChannel
InstallChannel(ctx context.Context, projectID string, channel string, body any, opts ...CallOption) (json.RawMessage, error)
Install a channel from the library. Creates a channel of the project from a Navin channel adapter (201). The setup contract of the adapter is checked: unknown, secret or read-only fields in settings and non secret fields in secret_refs answer 422 channel_field_invalid, a wrong value kind also, missing requirements 422 channel_field_missing; secrets are openbao:// or env:// references only (422 channel_secret_ref_required). Defaults: auth api_key, limits 65536 bytes per message and 60 per minute, DLP detect inbound and mask outbound. Needs tenant_admin, developer or application_owner and the ReBAC relation editor. Audited as navin_library.channel_install.
Route: /v1/projects/{project_id}/navin-library/channels/{name}/install (POST).
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
ctx | context.Context | yes | Context of the call: cancellation and deadline. | |
projectID | string | yes | Identifier (UUID) or slug of the project. | |
channel | string | yes | Only the sessions opened on this channel. | |
body | any | yes | Channel name, agent, settings, secret references, authentication, limits and DLP. | |
opts | ...CallOption | no | Per call options (query, idempotency key, traceparent, headers). |
Returns: (json.RawMessage, error). Decoded JSON answer of the operation "Install a channel from the library". The error is a typed error of the SDK, nil on success.
Raises: error, the typed errors of the transport (Errors).
NavinLibraryService.InstallMcpPreset
InstallMcpPreset(ctx context.Context, projectID string, preset string, body any, opts ...CallOption) (json.RawMessage, error)
Install an MCP server from a preset. Registers an MCP server of the project in the MCP gateway from a Navin preset (201), over streamable HTTP or SSE. A stdio preset runs where its command runs (the MCP page of the Navin Manager): give its HTTP endpoint in url; its environment and argument fields are returned in bridge_fields. Errors: 409 mcp_preset_not_installable, 409 mcp_preset_needs_endpoint, 422 mcp_preset_field_unknown, 422 mcp_preset_field_missing, 422 mcp_preset_secret_ref_required (a secret field must be an openbao:// or env:// reference), 422 mcp_preset_unsupported. Needs tenant_admin, developer or application_owner and the ReBAC relation editor. Audited as navin_library.mcp_install.
Route: /v1/projects/{project_id}/navin-library/mcp-presets/{name}/install (POST).
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
ctx | context.Context | yes | Context of the call: cancellation and deadline. | |
projectID | string | yes | Identifier (UUID) or slug of the project. | |
preset | string | yes | Name of the MCP preset of the Navin Library, put in place of {name} in the path. | |
body | any | yes | Server name, endpoint, transport, preset fields, secret references and allowed tools. | |
opts | ...CallOption | no | Per call options (query, idempotency key, traceparent, headers). |
Returns: (json.RawMessage, error). Decoded JSON answer of the operation "Install an MCP server from a preset". The error is a typed error of the SDK, nil on success.
Raises: error, the typed errors of the transport (Errors).
NavinLibraryService.Item
Item(ctx context.Context, kind string, name string, opts ...CallOption) (json.RawMessage, error)
Get a library item. One item with its content (SKILL.md and files of a skill, plugin.json and README of a plugin, Markdown of a command or an agent, full MCP preset or channel contract). 404 navin_library_item_not_found.
Route: /v1/navin-library/{kind}/{name} (GET).
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
ctx | context.Context | yes | Context of the call: cancellation and deadline. | |
kind | string | yes | Kind of item: skills, plugins, commands, agents, mcp-presets or channels. | |
name | string | yes | Name of the item. | |
opts | ...CallOption | no | Per call options (query, idempotency key, traceparent, headers). |
Returns: (json.RawMessage, error). Decoded JSON answer of the operation "Get a library item". The error is a typed error of the SDK, nil on success.
Raises: error, the typed errors of the transport (Errors).
NavinLibraryService.Items
Items(ctx context.Context, kind string, opts ...CallOption) (json.RawMessage, error)
List the library items of a kind. Items of one kind: skills, plugins, commands, agents, mcp-presets or channels (q searches name and description, category filters skills, plugins and MCP presets). An unknown kind answers 404 navin_library_kind_unknown.
Route: /v1/navin-library/{kind} (GET).
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
ctx | context.Context | yes | Context of the call: cancellation and deadline. | |
kind | string | yes | Kind of item: skills, plugins, commands, agents, mcp-presets or channels. | |
opts | ...CallOption | no | Per call options (query, idempotency key, traceparent, headers). |
Returns: (json.RawMessage, error). Decoded JSON answer of the operation "List the library items of a kind". The error is a typed error of the SDK, nil on success.
Raises: error, the typed errors of the transport (Errors).
NavinLibraryService.Project
Project(ctx context.Context, projectID string, opts ...CallOption) (json.RawMessage, error)
Get what a project uses from the library. Library version, activations of the project with counts per kind, and the MCP servers and channels of the project (with the preset they come from). Needs the ReBAC relation viewer on the project.
Route: /v1/projects/{project_id}/navin-library (GET).
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
ctx | context.Context | yes | Context of the call: cancellation and deadline. | |
projectID | string | yes | Identifier (UUID) or slug of the project. | |
opts | ...CallOption | no | Per call options (query, idempotency key, traceparent, headers). |
Returns: (json.RawMessage, error). Decoded JSON answer of the operation "Get what a project uses from the library". The error is a typed error of the SDK, nil on success.
Raises: error, the typed errors of the transport (Errors).
NavinLibraryService.PutRule
PutRule(ctx context.Context, projectID string, name string, body any, opts ...CallOption) (json.RawMessage, error)
Create or replace a project rule. Creates (201) or replaces (200) a rule of the project. The name has 1 to 64 letters, digits, ., _ or - (a .md suffix is dropped, readme is refused; 422 rule_name_invalid). Empty content answers 422 rule_empty, more than 64 KiB 413 rule_too_large; a conditional rule needs globs or a description (422 rule_scope_required). Needs tenant_admin, developer or application_owner and the ReBAC relation editor. Audited as project.rule.put.
Route: /v1/projects/{project_id}/rules/{name} (PUT).
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
ctx | context.Context | yes | Context of the call: cancellation and deadline. | |
projectID | string | yes | Identifier (UUID) or slug of the project. | |
name | string | yes | Name of the rule. | |
body | any | yes | Content, mode, description, globs and source of the rule. | |
opts | ...CallOption | no | Per call options (query, idempotency key, traceparent, headers). |
Returns: (json.RawMessage, error). Decoded JSON answer of the operation "Create or replace a project rule". The error is a typed error of the SDK, nil on success.
Raises: error, the typed errors of the transport (Errors).
NavinLibraryService.Rules
Rules(ctx context.Context, projectID string, opts ...CallOption) (json.RawMessage, error)
List the project rules. Rules of the project by mode then name, each with source, source path, description, globs, content, digest and size in bytes. Needs the ReBAC relation viewer.
Route: /v1/projects/{project_id}/rules (GET).
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
ctx | context.Context | yes | Context of the call: cancellation and deadline. | |
projectID | string | yes | Identifier (UUID) or slug of the project. | |
opts | ...CallOption | no | Per call options (query, idempotency key, traceparent, headers). |
Returns: (json.RawMessage, error). Decoded JSON answer of the operation "List the project rules". The error is a typed error of the SDK, nil on success.
Raises: error, the typed errors of the transport (Errors).
NavinLibraryService.RulesPrompt
RulesPrompt(ctx context.Context, projectID string, opts ...CallOption) (json.RawMessage, error)
Get the rules prompt section. The prompt section every run of the project receives: always on rules inlined (each clipped at 8000 characters), conditional ones listed with their description and globs. Returns prompt, the always and conditional counts and the digest of the text (empty when the project has no rule). Needs the ReBAC relation viewer.
Route: /v1/projects/{project_id}/rules/prompt (GET).
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
ctx | context.Context | yes | Context of the call: cancellation and deadline. | |
projectID | string | yes | Identifier (UUID) or slug of the project. | |
opts | ...CallOption | no | Per call options (query, idempotency key, traceparent, headers). |
Returns: (json.RawMessage, error). Decoded JSON answer of the operation "Get the rules prompt section". The error is a typed error of the SDK, nil on success.
Raises: error, the typed errors of the transport (Errors).
NavinLibraryService.Summary
Summary(ctx context.Context, opts ...CallOption) (json.RawMessage, error)
Get the library summary. Version of the vendored navin package, counts per kind and the rule files read from a repository. 503 navin_library_unavailable when the catalogue is not packaged.
Route: /v1/navin-library (GET).
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
ctx | context.Context | yes | Context of the call: cancellation and deadline. | |
opts | ...CallOption | no | Per call options (query, idempotency key, traceparent, headers). |
Returns: (json.RawMessage, error). Decoded JSON answer of the operation "Get the library summary". The error is a typed error of the SDK, nil on success.
Raises: error, the typed errors of the transport (Errors).
Model RuleFile
One file of a repository to import as a rule.
Fields:
| Name | Type | Required | Description |
|---|---|---|---|
Path (path) | string | yes | Path of the file in the repository, for example .cursor/rules/style.mdc (1 to 500 characters). |
Content (content) | string | yes | Content of the file (up to 65536 characters). |