Documentation
¶
Overview ¶
Package planner is the public SDK facade over Harbor's internal/planner package — the swappable Planner interface, the Decision sum, the RunContext view, the Trajectory record, and the driver registry external planner concretes register on (RFC §3.6, §6.2; D-204). Alias-based re-exports only: no behavior lives here. Event payload structs, prompt-materialisation helpers, and repair internals are deliberately private.
Index ¶
- Constants
- Variables
- type AnswerEnvelope
- type AwaitTask
- type BackgroundMemberOutcome
- type BackgroundResult
- type Budget
- type BudgetHints
- type CallParallel
- type CallTool
- type ChunkKind
- type CompressionOption
- type CompressionRunner
- type ControlSignals
- type Decision
- type ErrToolContextLost
- type ErrUnserializable
- type Factory
- type FactoryDeps
- type FailureRecord
- type Finish
- type FinishReason
- type HandleID
- type HandleRegistry
- type InputArtifactView
- type JoinKind
- type JoinSpec
- type MemoryBlocks
- type MemoryView
- type ParallelBranchObservation
- type ParallelObservation
- type PauseReason
- type Planner
- type PlannerConfig
- type PlanningHints
- type PlanningNudges
- type ReasoningReplayMode
- type RepairCounters
- type RequestPause
- type ResumeHint
- type RunContext
- type Skill
- type SkillLookup
- type SkillResult
- type Source
- type SpawnSpec
- type SpawnTask
- type SteeringInjection
- type Step
- type StreamChunk
- type Summariser
- type Summary
- type TokenEstimator
- type ToolCallDeferred
- type ToolCatalogView
- type ToolContext
- type Trajectory
- type WakeAware
- type WakeMode
Constants ¶
const ( // FinishGoal — the goal was achieved. FinishGoal = internal.FinishGoal // FinishNoPath — no step/decision path remains. FinishNoPath = internal.FinishNoPath // FinishCancelled — the run was cancelled. FinishCancelled = internal.FinishCancelled // FinishDeadlineExceeded — the run ran out of time/steps. FinishDeadlineExceeded = internal.FinishDeadlineExceeded // FinishConstraintsConflict — constraints are unsatisfiable. FinishConstraintsConflict = internal.FinishConstraintsConflict )
FinishReason values.
const ( // PauseApprovalRequired — HITL approval is required. PauseApprovalRequired = internal.PauseApprovalRequired // PauseAwaitInput — the run awaits user input. PauseAwaitInput = internal.PauseAwaitInput // PauseExternalEvent — the run awaits an external event. PauseExternalEvent = internal.PauseExternalEvent // PauseConstraintsConflict — a conflict requires a human decision. PauseConstraintsConflict = internal.PauseConstraintsConflict )
PauseReason values.
const ( // JoinAll — wait for every branch. JoinAll = internal.JoinAll // JoinFirstSuccess — first successful branch wins. JoinFirstSuccess = internal.JoinFirstSuccess // JoinKeyed — join on a keyed subset. JoinKeyed = internal.JoinKeyed // JoinN — join when N branches resolved. JoinN = internal.JoinN )
JoinKind values.
const ( // WakePush — the runtime wakes the planner on resolution. WakePush = internal.WakePush // WakePoll — the planner polls at deterministic boundaries. WakePoll = internal.WakePoll // WakeHybrid — push with a poll fallback. WakeHybrid = internal.WakeHybrid )
WakeMode values.
const ( // TaskErrorCodeRunLoopError — the run loop failed. TaskErrorCodeRunLoopError = internal.TaskErrorCodeRunLoopError // TaskErrorCodeCancelled — the run was cancelled. TaskErrorCodeCancelled = internal.TaskErrorCodeCancelled )
Task-error codes the runtime maps non-goal finishes to.
Variables ¶
var ( // ErrPlannerClosed — the planner has been closed. ErrPlannerClosed = internal.ErrPlannerClosed // ErrInvalidDecision — the decision failed runtime validation. ErrInvalidDecision = internal.ErrInvalidDecision // ErrRepairExhausted — the schema-repair budget ran out. ErrRepairExhausted = internal.ErrRepairExhausted // ErrIdentityRequired — the run's identity quadruple is incomplete. ErrIdentityRequired = internal.ErrIdentityRequired // ErrInvalidConfig — the planner configuration is invalid. ErrInvalidConfig = internal.ErrInvalidConfig // ErrDeterministicStep — a deterministic step returned an error. ErrDeterministicStep = internal.ErrDeterministicStep // ErrParallelCapExceeded — CallParallel exceeded the absolute cap. ErrParallelCapExceeded = internal.ErrParallelCapExceeded // ErrParallelInvalidJoin — the CallParallel join spec is invalid. ErrParallelInvalidJoin = internal.ErrParallelInvalidJoin // ErrMemoryBlockUnserializable — a memory block is not JSON-serialisable. ErrMemoryBlockUnserializable = internal.ErrMemoryBlockUnserializable // ErrDriverUnknown — the named planner driver is not registered. ErrDriverUnknown = internal.ErrDriverUnknown // ErrNilTrajectory — compression refuses a nil trajectory. ErrNilTrajectory = internal.ErrNilTrajectory // ErrEmptySummary — the summariser violated its contract. ErrEmptySummary = internal.ErrEmptySummary )
Re-exported sentinel errors callers compare via errors.Is.
var ConfigFromOperator = internal.ConfigFromOperator
ConfigFromOperator projects the operator config block into the resolved PlannerConfig.
var DefaultTokenEstimator = internal.DefaultTokenEstimator
DefaultTokenEstimator is the chars/4 trajectory token estimate.
var HintsFromConfig = internal.HintsFromConfig
HintsFromConfig projects the operator hints block into PlanningHints (nil when the block is empty).
var IsValidFinishReason = internal.IsValidFinishReason
IsValidFinishReason reports whether r is canonical.
var IsValidPauseReason = internal.IsValidPauseReason
IsValidPauseReason reports whether r is canonical.
var MustRegister = internal.MustRegister
MustRegister registers a planner concrete, panicking on conflict (init()-time registration).
var NewCompressionRunner = internal.NewCompressionRunner
NewCompressionRunner constructs the trajectory-compression runner over a Summariser.
var NewProcessLocalRegistry = internal.NewProcessLocalRegistry
NewProcessLocalRegistry constructs the process-local handle registry for non-serialisable tool handles.
var Register = internal.Register
Register registers a planner concrete by name (the seam external planner authors plug into).
var RegisteredDrivers = internal.RegisteredDrivers
RegisteredDrivers lists the seated planner driver names (blank-import sdk/planner/react or sdk/drivers/prod to seat the production set).
var Resolve = internal.Resolve
Resolve resolves the configured planner concrete via the driver registry (D-103).
var ResolveWakeMode = internal.ResolveWakeMode
ResolveWakeMode resolves a planner's effective WakeMode (WakePush unless the concrete declares otherwise via WakeAware).
var TaskErrorCodeForFinish = internal.TaskErrorCodeForFinish
TaskErrorCodeForFinish maps a non-goal FinishReason to its task-error code.
var WithTokenEstimator = internal.WithTokenEstimator
WithTokenEstimator overrides the runner's token estimator.
Functions ¶
This section is empty.
Types ¶
type AnswerEnvelope ¶
type AnswerEnvelope = internal.AnswerEnvelope
AnswerEnvelope is the canonical terminal answer shape.
type BackgroundMemberOutcome ¶
type BackgroundMemberOutcome = internal.BackgroundMemberOutcome
BackgroundMemberOutcome is one member of a joined group.
type BackgroundResult ¶
type BackgroundResult = internal.BackgroundResult
BackgroundResult is a joined background task's outcome.
type BudgetHints ¶
type BudgetHints = internal.BudgetHints
BudgetHints carries advisory budget guidance.
type CallParallel ¶
type CallParallel = internal.CallParallel
CallParallel dispatches N tool branches with a join spec.
type CompressionOption ¶
type CompressionOption = internal.CompressionOption
CompressionOption customises NewCompressionRunner.
type CompressionRunner ¶
type CompressionRunner = internal.CompressionRunner
CompressionRunner runs trajectory compression at step boundaries.
type ControlSignals ¶
type ControlSignals = internal.ControlSignals
ControlSignals is the steering snapshot the runtime projects.
type ErrToolContextLost ¶
type ErrToolContextLost = internal.ErrToolContextLost
ErrToolContextLost is the loud lost-handle failure on resume.
type ErrUnserializable ¶
type ErrUnserializable = internal.ErrUnserializable
ErrUnserializable is the loud pause/resume serialization failure (CLAUDE.md §5 fail-loudly; never a silent context drop).
type FactoryDeps ¶
type FactoryDeps = internal.FactoryDeps
FactoryDeps carries the dependencies a Factory may consume.
type FailureRecord ¶
type FailureRecord = internal.FailureRecord
FailureRecord records one repaired/observed failure.
type FinishReason ¶
type FinishReason = internal.FinishReason
FinishReason is the canonical terminal reason.
type HandleRegistry ¶
type HandleRegistry = internal.HandleRegistry
HandleRegistry stores non-serialisable handles across steps.
type InputArtifactView ¶
type InputArtifactView = internal.InputArtifactView
InputArtifactView is one planner-visible input artifact.
type MemoryBlocks ¶
type MemoryBlocks = internal.MemoryBlocks
MemoryBlocks is the projected memory block set.
type MemoryView ¶
type MemoryView = internal.MemoryView
MemoryView is the read-only memory view a planner sees.
type ParallelBranchObservation ¶
type ParallelBranchObservation = internal.ParallelBranchObservation
ParallelBranchObservation is one branch's observation.
type ParallelObservation ¶
type ParallelObservation = internal.ParallelObservation
ParallelObservation is the joined CallParallel observation.
type PauseReason ¶
type PauseReason = internal.PauseReason
PauseReason is the canonical pause vocabulary.
type Planner ¶
Planner is the swappable reasoning-policy interface (CLAUDE.md §1 property 3). Concretes implement Next(ctx, rc) (Decision, error).
type PlannerConfig ¶
type PlannerConfig = internal.PlannerConfig
PlannerConfig is the resolved planner configuration.
type PlanningHints ¶
type PlanningHints = internal.PlanningHints
PlanningHints are runtime-supplied planning constraints.
type PlanningNudges ¶
type PlanningNudges = internal.PlanningNudges
PlanningNudges are caller-provided ordering/parallel/budget nudges.
type ReasoningReplayMode ¶
type ReasoningReplayMode = internal.ReasoningReplayMode
ReasoningReplayMode controls reasoning-trace replay in prompts.
type RepairCounters ¶
type RepairCounters = internal.RepairCounters
RepairCounters carries the per-run schema-repair counters.
type RequestPause ¶
type RequestPause = internal.RequestPause
RequestPause parks the run on the unified pause/resume primitive.
type ResumeHint ¶
type ResumeHint = internal.ResumeHint
ResumeHint carries the pause's resume guidance.
type RunContext ¶
type RunContext = internal.RunContext
RunContext is the per-step view the runtime projects for the planner (identity, goal, trajectory, catalog, memory, skills).
type SkillLookup ¶
type SkillLookup = internal.SkillLookup
SkillLookup is the read-only skill lookup a planner sees.
type SkillResult ¶
type SkillResult = internal.SkillResult
SkillResult is one planner-visible skill search hit.
type SteeringInjection ¶
type SteeringInjection = internal.SteeringInjection
SteeringInjection is an INJECT_CONTEXT record on the trajectory.
type StreamChunk ¶
type StreamChunk = internal.StreamChunk
StreamChunk is one chunked-output fragment on the trajectory.
type Summariser ¶
type Summariser = internal.Summariser
Summariser produces the five-field trajectory Summary.
type TokenEstimator ¶
type TokenEstimator = internal.TokenEstimator
TokenEstimator estimates a trajectory's token footprint.
type ToolCallDeferred ¶
type ToolCallDeferred = internal.ToolCallDeferred
ToolCallDeferred records a deferred (approval-gated) tool call.
type ToolCatalogView ¶
type ToolCatalogView = internal.ToolCatalogView
ToolCatalogView is the identity-filtered catalog view.
type ToolContext ¶
type ToolContext = internal.ToolContext
ToolContext is the tool-only handle bundle (serialisable half + handle registry).
type Trajectory ¶
type Trajectory = internal.Trajectory
Trajectory is the append-only execution log of a run.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package deterministic is the public SDK facade over Harbor's internal/planner/deterministic package — the decision-tree planner concrete that drives the same Runtime as the LLM-driven ReAct planner through the identical Planner seam (RFC §3.6, §6.2; D-204).
|
Package deterministic is the public SDK facade over Harbor's internal/planner/deterministic package — the decision-tree planner concrete that drives the same Runtime as the LLM-driven ReAct planner through the identical Planner seam (RFC §3.6, §6.2; D-204). |
|
Package react is the public SDK facade over Harbor's internal/planner/react package — the reference LLM-driven ReAct planner concrete (RFC §3.6, §6.2; D-204).
|
Package react is the public SDK facade over Harbor's internal/planner/react package — the reference LLM-driven ReAct planner concrete (RFC §3.6, §6.2; D-204). |