Skip to main content

navin_library.go (package eai)

Source: sdks/go/navin_library.go. Back to the Go 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 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).

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

NameTypeDefaultRequiredDescription
ctxcontext.ContextyesContext of the call: cancellation and deadline.
projectIDstringyesIdentifier (UUID) or slug of the project.
bodyanyyesKind and name of the item to activate.
opts...CallOptionnoPer 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).

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

NameTypeDefaultRequiredDescription
ctxcontext.ContextyesContext of the call: cancellation and deadline.
projectIDstringyesIdentifier (UUID) or slug of the project.
activationIDstringyesIdentifier (UUID) of the activation.
opts...CallOptionnoPer 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).

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

NameTypeDefaultRequiredDescription
ctxcontext.ContextyesContext of the call: cancellation and deadline.
projectIDstringyesIdentifier (UUID) or slug of the project.
namestringyesName of the rule.
opts...CallOptionnoPer 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).

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

NameTypeDefaultRequiredDescription
ctxcontext.ContextyesContext of the call: cancellation and deadline.
projectIDstringyesIdentifier (UUID) or slug of the project.
files[]RuleFileyesFiles to import (1 to 200).
opts...CallOptionnoPer 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).

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

NameTypeDefaultRequiredDescription
ctxcontext.ContextyesContext of the call: cancellation and deadline.
projectIDstringyesIdentifier (UUID) or slug of the project.
channelstringyesOnly the sessions opened on this channel.
bodyanyyesChannel name, agent, settings, secret references, authentication, limits and DLP.
opts...CallOptionnoPer 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).

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

NameTypeDefaultRequiredDescription
ctxcontext.ContextyesContext of the call: cancellation and deadline.
projectIDstringyesIdentifier (UUID) or slug of the project.
presetstringyesName of the MCP preset of the Navin Library, put in place of {name} in the path.
bodyanyyesServer name, endpoint, transport, preset fields, secret references and allowed tools.
opts...CallOptionnoPer 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).

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

NameTypeDefaultRequiredDescription
ctxcontext.ContextyesContext of the call: cancellation and deadline.
kindstringyesKind of item: skills, plugins, commands, agents, mcp-presets or channels.
namestringyesName of the item.
opts...CallOptionnoPer 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).

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

NameTypeDefaultRequiredDescription
ctxcontext.ContextyesContext of the call: cancellation and deadline.
kindstringyesKind of item: skills, plugins, commands, agents, mcp-presets or channels.
opts...CallOptionnoPer 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).

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

NameTypeDefaultRequiredDescription
ctxcontext.ContextyesContext of the call: cancellation and deadline.
projectIDstringyesIdentifier (UUID) or slug of the project.
opts...CallOptionnoPer 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).

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

NameTypeDefaultRequiredDescription
ctxcontext.ContextyesContext of the call: cancellation and deadline.
projectIDstringyesIdentifier (UUID) or slug of the project.
namestringyesName of the rule.
bodyanyyesContent, mode, description, globs and source of the rule.
opts...CallOptionnoPer 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).

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

NameTypeDefaultRequiredDescription
ctxcontext.ContextyesContext of the call: cancellation and deadline.
projectIDstringyesIdentifier (UUID) or slug of the project.
opts...CallOptionnoPer 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).

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

NameTypeDefaultRequiredDescription
ctxcontext.ContextyesContext of the call: cancellation and deadline.
projectIDstringyesIdentifier (UUID) or slug of the project.
opts...CallOptionnoPer 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).

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

NameTypeDefaultRequiredDescription
ctxcontext.ContextyesContext of the call: cancellation and deadline.
opts...CallOptionnoPer 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:

NameTypeRequiredDescription
Path (path)stringyesPath of the file in the repository, for example .cursor/rules/style.mdc (1 to 500 characters).
Content (content)stringyesContent of the file (up to 65536 characters).