Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions FORK.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion apps/mobile/src/Stack.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ const SETTINGS_SCREENS = {
linking: "settings/personas",
options: {
...SETTINGS_PAGE_OPTIONS,
title: "Personas",
title: "Agent Setup",
},
}),
...j5SettingsFormRoutes(SETTINGS_PAGE_OPTIONS),
Expand Down
2 changes: 1 addition & 1 deletion apps/mobile/src/features/settings/SettingsRouteScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ function useSettingsIndexSections(): SettingsListSection[] {
serverPage("SettingsProviderAccounts", "person.crop.circle", "Providers"),
serverPage("SettingsThreads", "text.bubble", "Threads"),
page("SettingsScheduledTasks", "clock", "Scheduled tasks"),
page("SettingsAgents", "person.2", "Personas"),
page("SettingsAgents", "person.2", "Agent Setup"),
],
},
{
Expand Down
8 changes: 4 additions & 4 deletions apps/mobile/src/j5/agents/AgentLibrarySettingsScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ import { PlaybookLibrarySettingsSection } from "../playbooks/PlaybookLibrarySett
export function AgentLibrarySettingsScreen() {
// Personas and Playbooks are managed by a server's Owners (People and access AC27).
return useOwnerSomewhere() === false ? (
<SettingsScreen title="Personas">
<SettingsScreen title="Agent Setup">
<ScreenScrollView
contentInsetAdjustmentBehavior="automatic"
contentContainerClassName="px-5 pt-4"
Expand Down Expand Up @@ -320,7 +320,7 @@ function OwnerAgentLibrarySettingsScreen() {

return (
<SettingsScreen
title="Personas"
title="Agent Setup"
actions={[
{
accessibilityLabel: "Create persona",
Expand Down Expand Up @@ -408,10 +408,10 @@ function OwnerAgentLibrarySettingsScreen() {
) : null}

<SettingsSection
title="Personas"
title="Agent Setup"
footer={
Platform.OS === "web"
? "Use Settings → Personas in the web app to import files."
? "Use Settings → Agent Setup in the web app to import files."
: "In a Codex or Claude conversation, type @persona:id, or @ and the start of a persona’s name, to run a persona as a subagent."
}
>
Expand Down
2 changes: 1 addition & 1 deletion apps/mobile/src/j5/upstreamSeams.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ const SEAMS: ReadonlyArray<Seam> = [
file: "features/settings/SettingsRouteScreen.tsx",
record: "PR #75–#86 role library: Personas settings",
from: "",
reaches: ['page("SettingsAgents", "person.2", "Personas")'],
reaches: ['page("SettingsAgents", "person.2", "Agent Setup")'],
},
{
file: "features/home/useThreadListActions.ts",
Expand Down
16 changes: 13 additions & 3 deletions apps/server/src/j5/a2a/AgentCrewProposalService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ export interface CrewProposal {
readonly crewInstanceId: string | null;
readonly kind: CrewProposalKind;
readonly status: CrewProposalStatus;
readonly approvalMode?: "human" | "automatic";
readonly refusalDetail?: string | null;
readonly brief: string;
readonly displayName: string;
readonly requestedSeats: ReadonlyArray<CrewProposalSeat>;
Expand All @@ -99,6 +101,7 @@ export interface CrewProposal {
}

export interface CreateCrewProposalInput {
readonly approvalMode?: "human" | "automatic";
readonly id: string;
readonly projectId: LedgerProjectId;
readonly captainParticipantId: ParticipantId;
Expand Down Expand Up @@ -148,6 +151,7 @@ export interface AgentCrewProposalServiceShape {
readonly approvedSeats: ReadonlyArray<CrewProposalSeat> | null;
readonly resolvedAt: string;
readonly decidedBy?: string | null | undefined;
readonly refusalDetail?: string;
}) => Effect.Effect<CrewProposal | null, SqlError>;
/** Approved proposals whose launch report has not reached the Captain yet. */
readonly listUnreported: () => Effect.Effect<ReadonlyArray<CrewProposal>, SqlError>;
Expand Down Expand Up @@ -180,6 +184,8 @@ interface Row {
readonly resolved_at: string | null;
readonly reported_at: string | null;
readonly decided_by: string | null;
readonly approval_mode: "human" | "automatic";
readonly refusal_detail: string | null;
readonly playbook_name: string | null;
readonly playbook_definition_path: string | null;
}
Expand All @@ -200,6 +206,8 @@ const fromRow = (row: Row): CrewProposal => ({
resolvedAt: row.resolved_at,
reportedAt: row.reported_at,
decidedBy: row.decided_by,
approvalMode: row.approval_mode,
refusalDetail: row.refusal_detail,
playbook:
row.playbook_name === null || row.playbook_definition_path === null
? null
Expand Down Expand Up @@ -229,13 +237,13 @@ export const layer: Layer.Layer<AgentCrewProposalService, never, SqlClient.SqlCl
INSERT OR IGNORE INTO j5_agent_crew_proposal (
id, project_id, captain_participant_id, captain_thread_id, crew_instance_id, kind,
status, brief, display_name, requested_seats, approved_seats, created_at, resolved_at,
reported_at, playbook_name, playbook_definition_path
reported_at, playbook_name, playbook_definition_path, approval_mode
) VALUES (
${input.id}, ${input.projectId}, ${input.captainParticipantId},
${input.captainThreadId}, ${input.crewInstanceId}, ${input.kind}, 'open',
${input.brief}, ${input.displayName}, ${encodeSeats(input.requestedSeats)}, NULL,
${input.createdAt}, NULL, NULL, ${input.playbook?.name ?? null},
${input.playbook?.definitionPath ?? null}
${input.playbook?.definitionPath ?? null}, ${input.approvalMode ?? "human"}
)
`;
return (yield* read(input.id))!;
Expand Down Expand Up @@ -303,6 +311,7 @@ export const layer: Layer.Layer<AgentCrewProposalService, never, SqlClient.SqlCl
readonly approvedSeats: ReadonlyArray<CrewProposalSeat> | null;
readonly resolvedAt: string;
readonly decidedBy?: string | null | undefined;
readonly refusalDetail?: string;
}) {
const approvedSeats =
input.decision === "approve" && input.approvedSeats !== null
Expand All @@ -313,7 +322,8 @@ export const layer: Layer.Layer<AgentCrewProposalService, never, SqlClient.SqlCl
SET status = ${finalStatus(input.decision)},
approved_seats = ${approvedSeats},
resolved_at = ${input.resolvedAt},
decided_by = ${input.decidedBy ?? null}
decided_by = ${input.decidedBy ?? null},
refusal_detail = ${input.refusalDetail ?? null}
WHERE id = ${input.id} AND status = 'open'
RETURNING id
`;
Expand Down
1 change: 1 addition & 0 deletions apps/server/src/j5/a2a/ClientReadsService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,7 @@ export const layer: Layer.Layer<
);
}),
crewProposals: proposals.listOpen().pipe(
Effect.map((items) => items.filter((proposal) => proposal.approvalMode !== "automatic")),
Effect.flatMap((open) => Effect.forEach(open, projectProposal)),
Effect.map((listed) => ({ proposals: listed })),
),
Expand Down
5 changes: 2 additions & 3 deletions apps/server/src/j5/a2a/CrewLaunchService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -469,9 +469,8 @@ export const layer = Layer.effect(
}),
),
);
// Every seat reaching this point was approved by a human, and that approval is the
// authority: explicit runtime choices override the persona sandbox while its behavior
// instructions remain pinned to the original snapshot.
// Explicit runtime choices override the persona sandbox for both human-approved and
// automatic launches; behavior instructions stay pinned to the original snapshot.
const policy = translateAgentPersonaProviderPolicy(
assignment.authorityPolicy,
assignment.resolvedDriver,
Expand Down
Loading
Loading