AgentApiModule · packages/server/src/amsp/module.ts:36

AmspRoutes

component

The public /api/amsp/v1 group: the gate, CORS, the run stream, the Session stream and the Session routes (history, approvals, tasks); and the API tab's Try it, the same run for the owner's sign-in.

API

@Component({
  contributes: {
    "HttpModule.routes": [
      { id: "AmspRoutes.routes", prefix: "/api/amsp/v1", auth: "none", order: 5 },
      {
        id: "AmspRoutes.try",
        prefix: "/api/projects/:projectId/agents/:agentId/api/try",
        auth: "user",
        order: 224,
      },
    ],
  },
})
export class AmspRoutes {
  @Use() private readonly settings!: Settings;
  @Use() private readonly agentApi!: AgentApi;
  @Use() private readonly sessions!: SessionIndex;
  @Use() private readonly manager!: Sessions;
  @Use() private readonly sessionService!: SessionServiceIface;
  @Use() private readonly channels!: Channels;
  @Use() private readonly agentConfig!: AgentConfig;
  @Use() private readonly log!: Log;
  @Use() private readonly errors!: Errors;
  @Use() private readonly clock!: Clock;
  @Use() private readonly access!: Access;
  @Use() private readonly traces!: Traces;
  @Bind("AmspRoutes.routes") routes!: Hono<AppEnv>;
  @Bind("AmspRoutes.try") tryRoutes!: Hono<AppEnv>;
  setup();
}

Dependencies & Wiring

Extracted from class decorators
@Userequires (12)
settings: Settings · agentApi: AgentApi · sessions: SessionIndex · manager: Sessions · sessionService: SessionServiceIface · channels: Channels · agentConfig: AgentConfig · log: Log · errors: Errors · clock: Clock · access: Access · traces: Traces
@Bindbinds (2)
routes → AmspRoutes.routes: Hono<AppEnv> · tryRoutes → AmspRoutes.try: Hono<AppEnv>

Contributes

{
  "HttpModule.routes": [
    {
      "id": "AmspRoutes.routes",
      "prefix": "/api/amsp/v1",
      "auth": "none",
      "order": 5
    },
    {
      "id": "AmspRoutes.try",
      "prefix": "/api/projects/:projectId/agents/:agentId/api/try",
      "auth": "user",
      "order": 224
    }
  ]
}

Target slots: HttpModule.routes · View HTTP endpoints (12) →

Methods (1)

setup

setup()