// SPDX-FileCopyrightText: 2024-2026 The n5i Project
//
// SPDX-License-Identifier: AGPL-3.0-or-later
syntax = "proto3";
package n5i_plugin;
import "common.proto";
message GetContextRequest {
// The id of the app we're rendering the template for.
string app_id = 1;
// These permissions already have the <plugin-name>/ prefix removed.
repeated string permissions = 2;
// JSON-encoded data the app wants to share with the plugin.
string additional_data = 3;
UserState user_state = 4;
}
message AppContext {
// JSON-encoded data
// The built-in app.yml parser adds this to the Jinja context, but other plugins may handle it differently
string context = 1;
}
message RegisterAppRequest {
// The id of the app we're registering.
string app_id = 1;
// These permissions already have the <plugin-name>/ prefix removed.
repeated string permissions = 2;
// JSON-encoded data the app wants to share with the plugin.
string additional_data = 3;
UserState user_state = 4;
}
message UnregisterAppRequest {
// The id of the app we're unregistering.
string app_id = 1;
UserState user_state = 2;
}
message RegisterAppResponse {}
message UnregisterAppResponse {}
// A context plugin enhances the "context" of apps with data
service ContextPlugin {
// This method gets invoked whenever we install or change an app that has a permission this plugin cares about.
rpc RegisterApp(RegisterAppRequest) returns (RegisterAppResponse) {}
rpc UnregisterApp(UnregisterAppRequest) returns (UnregisterAppResponse) {}
// This method gets invoked whenever we need to render a template that uses this plugin.
rpc GetContext(GetContextRequest) returns (AppContext) {}
}