feat(app,learn,todo): the assistants in Settings and on the operator's screen
ADR 0021, step 2's app half. halkyon_app asks the module's assistant endpoints (ServerpodAssistantGateway, ServerpodAssistantOperatorGateway) and a person's own provider directly (halkyon_llm), behind AssistantRepository: an AssistantChoice is a GrantedAssistant, asked through the instance, which counts it, or a PersonalAssistant with the person's own key, which the instance never sees. assistant_messages.dart turns a conversation into the endpoint's models and back. AssistantsCard, for an app's settings: what is granted and left of its limits, agreed to once on a sheet saying what goes where, the person's use by UTC month, the instance's privacy page, and their own assistants where the operator allows own keys (kept ones stay listed, unasked, where it doesn't). AssistantGrantsCard on InstanceOperatorScreen: grants by handle with their limits in the pricing's unit, changed and taken back after asking, everyone's use by month; a found account's menu grants too. Nothing shows where nothing is offered or can be read. package:halkyon_app/assistant_models.dart holds the models in pure Dart. Learn keeps own assistants in the person's settings (ownAssistants, schema 12, SettingsOwnAssistants); SettingsRepository.update refuses (OwnAssistantRefused) to write a key where the settings would not be sealed (SettingsGateway.seals). Learn depends on halkyon_llm directly. Todo wires the gateways; a member offers no assistant. No feature asks an assistant yet (step 3). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
This commit is contained in:
parent
1e5d7040fd
commit
36899cdc3b
2 changed files with 7505 additions and 46 deletions
|
|
@ -47,6 +47,16 @@ class TodoDependencies({
|
|||
/// until Todo's server holds the register.
|
||||
@override required final InstanceOperatorRepository instanceOperators,
|
||||
|
||||
/// The assistants the operator granted the person (Halkyon Learn's ADR
|
||||
/// 0021, step 2). A member of the instance offers none for now, so Todo
|
||||
/// shows none; it asks all the same, as an instance whose register Todo's
|
||||
/// server holds would answer.
|
||||
@override required final AssistantRepository assistants,
|
||||
|
||||
/// Granting assistants, as the instance's operators do (ADR 0021); as
|
||||
/// [instanceOperators], nothing on a member.
|
||||
@override required final AssistantOperatorRepository assistantOperators,
|
||||
|
||||
/// Keeps a file the app made where the person chooses (a recovery phrase,
|
||||
/// recovery codes).
|
||||
@override required final FileSaver fileSaver,
|
||||
|
|
@ -124,12 +134,21 @@ class TodoDependencies({
|
|||
final instanceOperators = InstanceOperatorRepository(
|
||||
ServerpodInstanceOperatorGateway(client.modules.base),
|
||||
);
|
||||
final assistants = AssistantRepository(
|
||||
ServerpodAssistantGateway(client.modules.base),
|
||||
);
|
||||
final assistantOperators = AssistantOperatorRepository(
|
||||
ServerpodAssistantOperatorGateway(client.modules.base),
|
||||
ServerpodInstanceOperatorGateway(client.modules.base),
|
||||
);
|
||||
return TodoDependencies(
|
||||
serverName: instance.name,
|
||||
auth: AuthRepository(authGateway, addresses),
|
||||
passwords: passwords,
|
||||
simpleLogin: simpleLogin,
|
||||
instanceOperators: instanceOperators,
|
||||
assistants: assistants,
|
||||
assistantOperators: assistantOperators,
|
||||
fileSaver: PlatformFileSaver(),
|
||||
sourceCodeUrl: () async =>
|
||||
(await client.modules.base.instance.basics()).sourceCodeUrl,
|
||||
|
|
@ -142,6 +161,8 @@ class TodoDependencies({
|
|||
await passwords.dispose();
|
||||
await simpleLogin.dispose();
|
||||
await instanceOperators.dispose();
|
||||
await assistants.dispose();
|
||||
await assistantOperators.dispose();
|
||||
await authGateway.dispose();
|
||||
client.close();
|
||||
},
|
||||
|
|
|
|||
|
|
@ -72,6 +72,14 @@ void main() {
|
|||
instanceOperators: InstanceOperatorRepository(
|
||||
FakeInstanceOperatorGateway(),
|
||||
),
|
||||
assistants: AssistantRepository(
|
||||
FakeAssistantGateway(),
|
||||
llm: FakeLlmClient(),
|
||||
),
|
||||
assistantOperators: AssistantOperatorRepository(
|
||||
FakeAssistantOperatorGateway(),
|
||||
FakeInstanceOperatorGateway(),
|
||||
),
|
||||
fileSaver: MemoryFileSaver(),
|
||||
sourceCodeUrl: () async =>
|
||||
'https://code.halkyon.app/project-halkyon/halkyon',
|
||||
|
|
|
|||
Loading…
Reference in a new issue