@prismshadow/penguin-server · packages/server/src/services/tool-model-bindings.ts:60 · Child of ModelToolsModule

ToolModelBindingsProvider

module

Owns the slot; provides the interface and serves it at /api/projects/:projectId/models/ tool-bindings. The declarations are read off the slot at boot; each call attributes them to the packages of the plugin host as it is then (the host registers its plugins when the generation commits, after this tree booted).

API

@Module({
  contributes: {
    "HttpModule.routes": [
      {
        id: "ToolModelBindingsProvider.routes",
        prefix: "/api/projects/:projectId/models/tool-bindings",
        auth: "user",
        // Before the models group (100), whose prefix is this one's parent.
        order: 99,
      },
    ],
  },
})
export class ToolModelBindingsProvider {
  @Use() private readonly hmr!: Hmr;
  @Use() private readonly projectConfig!: ProjectConfigStore;
  @Use() private readonly access!: Access;
  @Use() private readonly machines!: Machines;
  @Use() private readonly projectEvents!: ProjectEvents;
  @Provide() toolModelBindings!: ToolModelBindings;
  @Bind("ToolModelBindingsProvider.routes") routes!: Hono<AppEnv>;
  setup({ contributions }: ClassCtx);
}

Dependencies & Wiring

Extracted from class decorators
@Userequires (5)
hmr: Hmr · projectConfig: ProjectConfigStore · access: Access · machines: Machines · projectEvents: ProjectEvents
@Provideprovides (1)
toolModelBindings: ToolModelBindings
@Bindbinds (1)
routes → ToolModelBindingsProvider.routes: Hono<AppEnv>

Contributes

{
  "HttpModule.routes": [
    {
      "id": "ToolModelBindingsProvider.routes",
      "prefix": "/api/projects/:projectId/models/tool-bindings",
      "auth": "user",
      "order": 99
    }
  ]
}

Target slots: HttpModule.routes

Children (0)

No child modules or components declared in @Module.

Exports (0)

None (module-private).