Skip to content

Graphorin API reference v0.1.0


Graphorin API reference / @graphorin/skills / / stampSkillTool

Function: stampSkillTool()

ts
function stampSkillTool<TInput, TOutput, TDeps>(tool, skill): StampedSkillTool<TInput, TOutput, TDeps>;

Defined in: packages/skills/src/registry/bridge.ts:53

Stamp a skill-bundled tool with the metadata the @graphorin/tools registry expects:

  1. Derive a ToolSource of kind 'skill' carrying the skill's name and trust level.
  2. Run resolveSandbox(...) so the resulting Tool.sandboxPolicy matches the mandatory tier for untrusted skills (DEC-148).
  3. Default the inboundSanitization policy to 'detect-and-strip-and-wrap' for untrusted skills when the tool author left it unset; trusted skills inherit the operator's choice.

The function returns a freshly-frozen Tool with the resolved sandboxPolicy and inboundSanitization baked in so downstream registries cannot accidentally re-inherit a relaxed policy.

Type Parameters

Type ParameterDefault type
TInputunknown
TOutputunknown
TDepsunknown

Parameters

ParameterType
toolTool&lt;TInput, TOutput, TDeps&gt;
skillPick&lt;Skill, "metadata"&gt;

Returns

StampedSkillTool&lt;TInput, TOutput, TDeps&gt;

Stable