Skip to main content

enterprise_ai.navin_library

Source: sdks/python/src/enterprise_ai/navin_library/__init__.py. Back to the Python SDK reference index.

note

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 NavinLibraryClient​

/v1/navin-library and /v1/projects/{id}/navin-library, /v1/projects/{id}/rules.

Resource

activate(project_id: str, kind: str, name: str) -> Any

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).

NameTypeDefaultRequiredDescription
project_idstryesIdentifier (UUID) or slug of the project.
kindstryesskill, plugin, command or agent.
namestryesName of the item in the library (1 to 128 characters).

Returns: Any. Decoded JSON answer of the operation "Activate a library item".

Raises: the typed errors of the transport (Errors).

deactivate(project_id: str, activation_id: str) -> Any

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).

NameTypeDefaultRequiredDescription
project_idstryesIdentifier (UUID) or slug of the project.
activation_idstryesIdentifier (UUID) of the activation.

Returns: Any. Decoded JSON answer of the operation "Deactivate a library item".

Raises: the typed errors of the transport (Errors).

delete_rule(project_id: str, name: str) -> Any

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).

NameTypeDefaultRequiredDescription
project_idstryesIdentifier (UUID) or slug of the project.
namestryesName of the rule.

Returns: Any. Decoded JSON answer of the operation "Delete a project rule".

Raises: the typed errors of the transport (Errors).

import_rules(project_id: str, files: list[dict[str, str]] | str | Path) -> Any

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).

NameTypeDefaultRequiredDescription
project_idstryesIdentifier (UUID) or slug of the project.
fileslist[dict[str, str]] | str | PathyesFiles to import (1 to 200).

Returns: Any. Decoded JSON answer of the operation "Import the rule files of a repository".

Raises: the typed errors of the transport (Errors).

install_channel(project_id: str, channel: str, settings: dict[str, Any] | None = None, secret_refs: dict[str, str] | None = None, name: str | None = None, agent_ref: str | None = None, **extra: Any) -> Any

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).

NameTypeDefaultRequiredDescription
project_idstryesIdentifier (UUID) or slug of the project.
channelstryesOnly the sessions opened on this channel.
settingsdict[str, Any] | NoneNonenoNon secret fields of the channel contract, each checked against its kind (string up to 2000 characters, int, bool, list, enum).
secret_refsdict[str, str] | NoneNonenoSecret fields of the contract as openbao:// or env:// references, by field name.
namestr | NoneNonenoName of the Navin channel adapter.
agent_refstr | NoneNonenoAgent that answers on the channel, as <kind>:<name>, for example agent:support.
**extraAnynoExtra fields merged into the request body.

Returns: Any. Decoded JSON answer of the operation "Install a channel from the library".

Raises: the typed errors of the transport (Errors).

install_mcp_preset(project_id: str, preset: str, url: str | None = None, values: dict[str, Any] | None = None, credential_refs: dict[str, str] | None = None, name: str | None = None, transport: str | None = None, allowed_tools: list[str] | None = None) -> Any

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).

NameTypeDefaultRequiredDescription
project_idstryesIdentifier (UUID) or slug of the project.
presetstryesName of the MCP preset of the Navin library to install.
urlstr | NoneNonenoHTTP endpoint (8 to 2000 characters); required for a stdio preset run by the Navin Manager. Default: the preset URL for an HTTP preset.
valuesdict[str, Any] | NoneNonenoNon secret preset fields (string, integer or boolean), by field name.
credential_refsdict[str, str] | NoneNonenoSecret preset fields as openbao:// or env:// references, by field name.
namestr | NoneNonenoName of the MCP preset.
transportstr | NoneNonenostreamable_http or sse. Default: the transport of the preset.
allowed_toolslist[str] | NoneNonenoTools of the server that may be called. Omitted: every tool.

Returns: Any. Decoded JSON answer of the operation "Install an MCP server from a preset".

Raises: the typed errors of the transport (Errors).

item(kind: str, name: str) -> Any

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).

NameTypeDefaultRequiredDescription
kindstryesKind of item: skills, plugins, commands, agents, mcp-presets or channels.
namestryesName of the item.

Returns: Any. Decoded JSON answer of the operation "Get a library item".

Raises: the typed errors of the transport (Errors).

items(kind: str, q: str | None = None, category: str | None = None) -> Any

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).

NameTypeDefaultRequiredDescription
kindstryesKind of item: skills, plugins, commands, agents, mcp-presets or channels.
qstr | NoneNonenoText searched in the name and the description.
categorystr | NoneNonenoOnly this category (skills, plugins and MCP presets).

Returns: Any. Decoded JSON answer of the operation "List the library items of a kind".

Raises: the typed errors of the transport (Errors).

project(project_id: str) -> Any

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).

NameTypeDefaultRequiredDescription
project_idstryesIdentifier (UUID) or slug of the project.

Returns: Any. Decoded JSON answer of the operation "Get what a project uses from the library".

Raises: the typed errors of the transport (Errors).

put_rule(project_id: str, name: str, content: str, mode: str = 'always', description: str = '', globs: list[str] | None = None, source: str = 'navin') -> Any

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).

NameTypeDefaultRequiredDescription
project_idstryesIdentifier (UUID) or slug of the project.
namestryesName of the rule.
contentstryesMarkdown content of the rule (1 to 65536 characters, at most 64 KiB).
modestr'always'noalways (default, inlined in the prompt of every run) or conditional (listed, read when its scope matches).
descriptionstr''noWhen the rule applies (up to 2000 characters).
globslist[str] | NoneNonenoFile patterns the rule applies to, for example src/**/*.ts (up to 50).
sourcestr'navin'noOrigin of the rule: navin (default), cursor, cursor_legacy, cline, windsurf or copilot.

Returns: Any. Decoded JSON answer of the operation "Create or replace a project rule".

Raises: the typed errors of the transport (Errors).

rules(project_id: str) -> Any

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).

NameTypeDefaultRequiredDescription
project_idstryesIdentifier (UUID) or slug of the project.

Returns: Any. Decoded JSON answer of the operation "List the project rules".

Raises: the typed errors of the transport (Errors).

rules_prompt(project_id: str) -> Any

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).

NameTypeDefaultRequiredDescription
project_idstryesIdentifier (UUID) or slug of the project.

Returns: Any. Decoded JSON answer of the operation "Get the rules prompt section".

Raises: the typed errors of the transport (Errors).

summary() -> Any

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).

This element takes no parameter.

Returns: Any. Decoded JSON answer of the operation "Get the library summary".

Raises: the typed errors of the transport (Errors).

Functions​

rule_files​

rule_files(root: str | Path) -> list[dict[str, str]]

The rule files of a repository, ready for :meth:NavinLibraryClient.import_rules (64 KB at most each).

NameTypeDefaultRequiredDescription
rootstr | PathyesRoot folder of the repository; read: .navin/rules/*.md, .cursor/rules/**/*.mdc, .clinerules, .cursorrules, .windsurfrules, .github/copilot-instructions.md.

Returns: list[dict[str, str]]. Sorted list of {path, content}, path relative to root; larger files are left out.