Open History to see the last commit
1import type { EnvironmentId } from "@t3tools/contracts";
2import Constants from "expo-constants";
3
4import { authClientMetadata } from "../../lib/authClientMetadata";
5import { serverEnvironment } from "../../state/server";
6import { useAtomCommand } from "../../state/use-atom-command";
7
8/**
9 * Asks a machine to prepare a triage session. The result carries the prompt
10 * that links its playbook; the caller reports a failure.
11 */
12export function usePrepareTriage() {
13 const prepare = useAtomCommand(serverEnvironment.prepareTriage, { reportFailure: false });
14 return (environmentId: EnvironmentId) =>
15 prepare({
16 environmentId,
17 input: { client: authClientMetadata(Constants.expoConfig?.version) },
18 });
19}