api

package
v0.45.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 15, 2026 License: Apache-2.0 Imports: 71 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package api assembles and runs the `jentic` command tree — the API-spec surface (register/identity, context/env, catalog, apis, search, inspect, execute) for discovering, inspecting, and executing against the Jentic API catalog. Data-plane commands speak to the control plane through the generated SDK (client/generated/control); `jentic migrate` is the sole reader of the legacy V1 store (see legacy_store.go).

Index

Constants

View Source
const PositionalArg = "<arg>"

PositionalArg is the CuratedBinding.Bind value for a spec field satisfied by a positional argument rather than a flag.

Variables

This section is empty.

Functions

func ExecuteAPI

func ExecuteAPI()

ExecuteAPI runs the jentic (API-spec) command tree and exits with an appropriate status code.

func NewDocsRoot

func NewDocsRoot() *cobra.Command

NewDocsRoot builds the assembled `jentic` root with a throwaway App for documentation generation. No filesystem or network access happens at construction time — commands only act when run — so a zero App is safe.

func TreeBuilder

func TreeBuilder() core.TreeBuilder

TreeBuilder exposes the built-in `jentic` (API) command tree as a core.TreeBuilder so a downstream module can compose it via core.NewRootCmd(deps, api.TreeBuilder()). cli/pkg/clitree re-exports it so other modules can import it (internal/ is not importable cross-module).

Types

type CuratedBinding

type CuratedBinding struct {
	// Command is the space-separated path under the `jentic` root, e.g.
	// "history export".
	Command string
	// Params is the zero value of the generated request params/body struct the
	// command constructs.
	Params any
	// Bind maps a json field name to the flag that populates it (or
	// PositionalArg when a positional argument does).
	Bind map[string]string
	// NotExposed maps a json field name to the one-line reviewed reason it has
	// no flag. `jentic api <op>` still reaches every one of these.
	NotExposed map[string]string
}

CuratedBinding declares, for ONE curated command, how the exported fields of its generated request params/body struct surface on the CLI. It is the registry Test1G_SpecFlagCoverageParity (impl/0.0 §1G) reflects over: every json field of Params must appear in exactly one of Bind or NotExposed, every Bind flag must exist on the command, and neither map may name a field the struct no longer has. The payoff: `make generate-api` after a spec addition makes 1G fail until a human classifies the new field — bind it or record why not — so a curated command can never silently lag its spec (GEN-1).

func CuratedBindings

func CuratedBindings() []CuratedBinding

CuratedBindings returns the registry of curated commands that construct generated request structs. Commands living entirely on internal/apiclient (search, apis list/show, execute) have no generated struct to drift from and are not listed; they migrate in here as they move onto the generated SDK.

type HTTPError

type HTTPError = agentops.HTTPError

HTTPError is a non-2xx control-plane response. The type moved to the UX-free core with the Inspector seam (plan 0.2) — agentops.ResolveOperation maps a 404 from the same error type this package's per-command mappers read — and is aliased here so every existing call site (apiErrorFor constructions, the errors.As targets in apisListErr/apiActionErr/catalogListErr/…) is untouched. It mirrors the shape the hand-written httpx.HTTPError offered — StatusCode plus the raw problem-details body (Detail()/Fields()) — so error-mapping logic ported unchanged. (Named HTTPError, not APIError, so it does not stutter as api.APIError — revive `exported`.)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL