All collaborator dependencies. See EmergentCapabilityEngineDeps.
Forge a new tool from a request.
Runs test cases, submits the candidate to the LLM judge, and registers the
tool at the 'session' tier if approved. Returns a ForgeResult with
the tool ID on success, or an error / rejection verdict on failure.
Pipeline:
0. Hold the tool's name to the forge's name rule (forgedToolNameProblem): a
refused name fails the forge before anything runs.
The forge request describing the desired tool.
The agent and session ids. caller is the forging
call's own context: a composition's test steps run as that caller, so
they meet the checks the caller's direct calls meet.
Optional caller?: ToolExecutionContextA ForgeResult indicating success or failure.
Check if a tool is eligible for promotion and auto-promote if the threshold is met.
A tool qualifies for promotion when:
'session' tier.EmergentConfig.promotionThreshold:totalUses >= threshold.usesconfidenceScore >= threshold.confidenceWhen eligible, the engine submits the tool to the judge's promotion panel.
If both reviewers approve, the tool is promoted to 'agent' tier.
The ID of the tool to check.
A PromotionResult if promotion was attempted, or null if
the tool is not eligible or does not exist.
Get all session-scoped tools for a given session ID.
The session identifier.
An array of EmergentTool objects belonging to the session.
Get all agent-tier tools for a given agent ID.
The agent identifier.
An array of EmergentTool objects created by the agent.
Clean up all session tools for a given session.
Delegates to the registry's EmergentToolRegistry.cleanupSession()
method and clears the local session index. A tool forged in the session
and promoted out of it since (now at the agent tier) is not the
session's any more: it stays held, registered and indexed under its
agent.
The session identifier to clean up.
the tools the cleanup removed.
Hydrate one stored tool and make it executable.
what happened, so a host can tell a registered tool from a refused one.
Use loadPersistedTools, which reads the rows itself. This applies the same checks to the one tool: a suspended or demoted tool is not registered, and a tool whose source cannot be rebuilt is suspended. When the tool has a stored row, that row is what is read, not the object passed in (a host-built object can carry a list the host made up), and a load never rewrites it. A tool with no row gets its row written first, as before, so its uses are recorded and the next load finds it.
Remove a previously synced tool from the live runtime and registry.
Load the stored tools of the given tiers into the running process.
Call it at start, after the host's own tools are registered. For each row
it reads the source (raw code, code with its list, a redacted record, or a
composition), keeps a demoted row off, suspends a row that cannot be
rebuilt, and registers the rest. A row is never rewritten by being loaded,
and a stored request is never replaced by a derived one. One line is logged
per tool that did not load. A row whose load throws is reported in
failed and does not stop the others.
shared rows load for every caller. agent rows are those of
options.agentId and session rows those of options.sessionId, and
naming either tier without its selector throws (selector_required), so
a shared store never puts one agent's private tools in another's
executor. A loaded or forged agent tool also refuses a call from any
other agent (see createExecutableTool). The agent identity is the
persona id: forge_tool records the forging caller's personaId as
created_by_agent, and agentId here is that id. Rows written by
releases before this one hold the forging GMI instance's id instead.
Suspend a tool and take it out of the executor. The state write is awaited, so the suspension survives a restart, and no later use, rewrite or load turns the tool back on. The suspension is recorded as the host's, so it stays, whatever its reason says, until reactivateTool is called.
false when the tool is unknown.
Demote a tool: its confidence is reset, it is taken out of the executor, and no later load brings it back. Only reactivateTool does.
false when the tool is unknown.
Re-check one suspended or demoted tool against the configuration in force and, when it fits, register it again. This is how a host clears a suspension or a demotion it set; the library never does so on its own.
the outcome, or undefined when the tool is unknown.
Called by the host when any tool is registered. A composition the library suspended because a step was missing, refused, replaced or circular is checked again when a tool one of its steps names arrives, and registered when it fits. A host's own suspension is left to the host.
Factory method that creates the four self-improvement tools when
config.selfImprovement?.enabled is true.
Returns an array containing:
Returns an empty array when self-improvement is disabled or the config is absent. Uses dynamic imports to avoid hard compile-time coupling to tool modules that may not yet exist.
Runtime hooks for personality, skills, tools, and memory.
Array of 0 or 4 ITool instances.
Create an executable ITool wrapper for a forged emergent tool.
The wrapper refuses a call to a tool that is not active and, for an
agent-tier tool, a call from any agent but its own, before anything
runs or a use is recorded; it then performs runtime output validation,
usage tracking, and promotion checks after each successful execution.
A call whose tool was removed, or replaced under its id, while it ran
returns its result, effects included, and records no use.
Create a new EmergentCapabilityEngine.