Skip to content

InstructionLoader

reference
1 min readUpdated

Kind: Class

Source: atloria-monorepo/libs/agent-core/src/context/instruction-loader.ts

Methods

MethodSignatureReturns
addPersistentaddPersistent(layer: InstructionLayer)void
removePersistentremovePersistent(id: string)void
addTurnaddTurn(layer: InstructionLayer)void
getInstructionsgetInstructions(_context: RunContext<TContext>)string
createDynamicInstructionscreateDynamicInstructions()(context: RunContext<TContext>) => string
addConditionaladdConditional(layer: ConditionalLayer)void
removeConditionalremoveConditional(id: string)void
setActiveToolssetActiveTools(toolNames: string[])void
hasActiveToolhasActiveTool(name: string)boolean
addToZoneaddToZone(zone: InstructionZone, layer: Omit<InstructionLayer, 'priority'>, offset: undefined)void
discoverdiscover(rootDir: string, options: DiscoveryOptions)DiscoveredInstruction[]
loadFromDirectoryloadFromDirectory(rootDir: string, options: DiscoveryOptions)DiscoveredInstruction[]

Where it refuses work

  • InstructionLoader stops the work with an early return when allLayers.length === 0.
  • InstructionLoader stops the work with an early return when depth > opts.maxDepth.

When something fails

  • InstructionLoader handles failure in 1 place: it turns it into a return value in all 1.

Was this page helpful?

Download as PDF