Agent / foldkit-agent-native

ActionEntry

interface · packages/agent-native/src/actions.ts:32

interface ActionEntry {
  readonly tool: {
    readonly description: string
    readonly parameters: NonNullable<ActionTool['parameters']>
  }
  readonly run: (
    args: unknown,
    context?: ActionRunContext,
  ) => Promise<ActionResult>
  readonly schema: StandardSchemaV1<unknown, unknown> &
    StandardJSONSchemaV1<unknown, unknown>
  readonly http: {
    readonly method: 'POST'
  }
  readonly requiresAuth: boolean
  readonly readOnly: false
}

One entry of the record registerPackageActions takes.

Members

ActionEntry.tool

property · packages/agent-native/src/actions.ts:33

readonly tool: {
  readonly description: string
  readonly parameters: NonNullable<ActionTool['parameters']>
}

ActionEntry.run

property · packages/agent-native/src/actions.ts:37

readonly run: (
  args: unknown,
  context?: ActionRunContext,
) => Promise<ActionResult>

ActionEntry.schema

property · packages/agent-native/src/actions.ts:39

readonly schema: StandardSchemaV1<unknown, unknown> &
  StandardJSONSchemaV1<unknown, unknown>

Validates input and carries the JSON Schema its parameters are advertised from.

ActionEntry.http

property · packages/agent-native/src/actions.ts:40

readonly http: {
  readonly method: 'POST'
}

ActionEntry.requiresAuth

property · packages/agent-native/src/actions.ts:42

readonly requiresAuth: boolean

Defaults to true in the framework; stated so it is not left to a default.

ActionEntry.readOnly

property · packages/agent-native/src/actions.ts:51

readonly readOnly: false

Always false. A capability dispatches a Message into update, so it is a write however little it changes.

This feeds plan-mode classification, where the dangerous direction is claiming read-only: plan mode would then run it for real. A resource read would be the read-only case, and resources are not exposed as actions yet.