Skip to content
Docs
Reference

BackstageClient.conciergeSimulations

BackstageClient.conciergeSimulations in @ticketlayer/backstage.

@ticketlayer/backstage


@ticketlayer/backstage / BackstageClient / conciergeSimulations

conciergeSimulations: {
  addRegression: (request: {
     caseId: string;
     goal: string;
     opening: string;
   }, requestOptions?: RequestOptions) => Promise<{
     caseId: string | null;
     createdAt: string;
     createdBy: string;
     goal: string;
     id: string;
     opening: string;
  }>;
  get: (runId: string, requestOptions?: RequestOptions) => Promise<{
     channelId: string;
     createdAt: string;
     dispatchedAt: string | null;
     error:   | {
        code: string;
        message: string;
      }
        | null;
     evaluateCount: number;
     finishedAt: string | null;
     foreignOrderAttempts: number;
     policyFingerprint: string;
     proceduresVersion: string | null;
     regression: {
        goal: string;
        id: string;
        opening: string;
     }[];
     requestedBy: string;
     runId: string;
     scenarioCount: number;
     scenarios: {
        findings: string[];
        id: string;
        pass: boolean;
        score: number;
        transcript: {
           role: "customer" | "assistant";
           text: string;
           toolCalls?: {
              name: ...;
              status: ...;
           }[];
        }[];
     }[];
     scenariosPassed: number;
     scenariosVersion: string | null;
     stale: boolean;
     staleReasons: ("expired" | "policy_changed" | "procedures_changed")[];
     startedAt: string | null;
     status: "failed" | "error" | "queued" | "running" | "passed";
  }>;
  list: (channelId: string, requestOptions?: RequestOptions) => Promise<{
     gate: {
        actionsAvailable: boolean;
        reason: "SIMULATION_REQUIRED" | "SIMULATION_STALE" | null;
        runId: string | null;
     };
     runs: {
        channelId: string;
        createdAt: string;
        dispatchedAt: string | null;
        error:   | {
           code: string;
           message: string;
         }
           | null;
        evaluateCount: number;
        finishedAt: string | null;
        foreignOrderAttempts: number;
        policyFingerprint: string;
        proceduresVersion: string | null;
        requestedBy: string;
        runId: string;
        scenarioCount: number;
        scenariosPassed: number;
        scenariosVersion: string | null;
        stale: boolean;
        staleReasons: ("expired" | "policy_changed" | "procedures_changed")[];
        startedAt: string | null;
        status: "failed" | "error" | "queued" | "running" | "passed";
     }[];
  }>;
  start: (channelId: string, requestOptions?: RequestOptions) => Promise<any>;
};

Defined in: client.ts:8261

Concierge Simulations methods

addRegression()#

addRegression: (request: {
  caseId: string;
  goal: string;
  opening: string;
}, requestOptions?: RequestOptions) => Promise<{
  caseId: string | null;
  createdAt: string;
  createdBy: string;
  goal: string;
  id: string;
  opening: string;
}>;

Add a Concierge simulation regression scenario Add a regression scenario from a real case: the customer's opening line and the goal a good conversation reaches, written by staff. Every later run of the organisation's suite plays it, and a run passes only if it does. The case must be one you can read (404 CASE_NOT_FOUND otherwise). At most 50 per organisation. Requires saleschannels.update, as a person or an organisation API key, and the plan's Concierge AI.

Parameters#

ParameterTypeDescription
request{ caseId: string; goal: string; opening: string; }-
request.caseIdstringDescription The case the scenario comes from
request.goal?stringDescription What a good outcome is
request.opening?stringDescription The customer's opening line
requestOptions?RequestOptions-

Returns#

Promise<{ caseId: string | null; createdAt: string; createdBy: string; goal: string; id: string; opening: string; }>

Operation Id#

addConciergeSimulationRegression

get()#

get: (runId: string, requestOptions?: RequestOptions) => Promise<{
  channelId: string;
  createdAt: string;
  dispatchedAt: string | null;
  error:   | {
     code: string;
     message: string;
   }
     | null;
  evaluateCount: number;
  finishedAt: string | null;
  foreignOrderAttempts: number;
  policyFingerprint: string;
  proceduresVersion: string | null;
  regression: {
     goal: string;
     id: string;
     opening: string;
  }[];
  requestedBy: string;
  runId: string;
  scenarioCount: number;
  scenarios: {
     findings: string[];
     id: string;
     pass: boolean;
     score: number;
     transcript: {
        role: "customer" | "assistant";
        text: string;
        toolCalls?: {
           name: ...;
           status: ...;
        }[];
     }[];
  }[];
  scenariosPassed: number;
  scenariosVersion: string | null;
  stale: boolean;
  staleReasons: ("expired" | "policy_changed" | "procedures_changed")[];
  startedAt: string | null;
  status: "failed" | "error" | "queued" | "running" | "passed";
}>;

Get a Concierge simulation One run: its status, the policy fingerprint and versions it ran under, whether it is stale, and every scenario with its score, findings and transcript. Requires saleschannels.read on the run's channel's account; any other run is 404 SIMULATION_RUN_NOT_FOUND.

Parameters#

ParameterType
runIdstring
requestOptions?RequestOptions

Returns#

Promise<{ channelId: string; createdAt: string; dispatchedAt: string | null; error: | { code: string; message: string; } | null; evaluateCount: number; finishedAt: string | null; foreignOrderAttempts: number; policyFingerprint: string; proceduresVersion: string | null; regression: { goal: string; id: string; opening: string; }[]; requestedBy: string; runId: string; scenarioCount: number; scenarios: { findings: string[]; id: string; pass: boolean; score: number; transcript: { role: "customer" | "assistant"; text: string; toolCalls?: { name: ...; status: ...; }[]; }[]; }[]; scenariosPassed: number; scenariosVersion: string | null; stale: boolean; staleReasons: ("expired" | "policy_changed" | "procedures_changed")[]; startedAt: string | null; status: "failed" | "error" | "queued" | "running" | "passed"; }>

Operation Id#

getConciergeSimulation

list()#

list: (channelId: string, requestOptions?: RequestOptions) => Promise<{
  gate: {
     actionsAvailable: boolean;
     reason: "SIMULATION_REQUIRED" | "SIMULATION_STALE" | null;
     runId: string | null;
  };
  runs: {
     channelId: string;
     createdAt: string;
     dispatchedAt: string | null;
     error:   | {
        code: string;
        message: string;
      }
        | null;
     evaluateCount: number;
     finishedAt: string | null;
     foreignOrderAttempts: number;
     policyFingerprint: string;
     proceduresVersion: string | null;
     requestedBy: string;
     runId: string;
     scenarioCount: number;
     scenariosPassed: number;
     scenariosVersion: string | null;
     stale: boolean;
     staleReasons: ("expired" | "policy_changed" | "procedures_changed")[];
     startedAt: string | null;
     status: "failed" | "error" | "queued" | "running" | "passed";
  }[];
}>;

List a channel's Concierge simulations The channel's simulation runs, newest first (at most 50), each with whether it is stale, and the organisation's gate: whether a channel may be put at the Actions tier now, and if not, SIMULATION_REQUIRED or SIMULATION_STALE. Requires saleschannels.read on the channel's account.

Parameters#

ParameterType
channelIdstring
requestOptions?RequestOptions

Returns#

Promise<{ gate: { actionsAvailable: boolean; reason: "SIMULATION_REQUIRED" | "SIMULATION_STALE" | null; runId: string | null; }; runs: { channelId: string; createdAt: string; dispatchedAt: string | null; error: | { code: string; message: string; } | null; evaluateCount: number; finishedAt: string | null; foreignOrderAttempts: number; policyFingerprint: string; proceduresVersion: string | null; requestedBy: string; runId: string; scenarioCount: number; scenariosPassed: number; scenariosVersion: string | null; stale: boolean; staleReasons: ("expired" | "policy_changed" | "procedures_changed")[]; startedAt: string | null; status: "failed" | "error" | "queued" | "running" | "passed"; }[]; }>

Operation Id#

listConciergeSimulations

start()#

start: (channelId: string, requestOptions?: RequestOptions) => Promise<any>;

Start a Concierge simulation for a channel Run the organisation's Concierge simulation suite against this channel: simulated customers (polite, angry, confused, an injection attempt, someone else's order, and the organisation's regression scenarios) talk to the real assistant over synthetic orders, the policy engine decides every proposal as a dry run, and a judge scores each conversation against the policy. Nothing real is touched. The run is queued and runs asynchronously; read it with GET /concierge/simulations/{runId}. The Actions tier can be switched on only while the organisation has a passed run from the last 90 days under its current refund policies and AI action limits. With no runner configured the run stays queued with error SIMULATION_RUNNER_UNAVAILABLE and never passes. At most five runs per organisation in 24 hours (429 SIMULATION_RATE_LIMITED). Requires saleschannels.update on the channel's account, as a person or an organisation API key, and the plan's Concierge AI (403 PLAN_ENTITLEMENT_REQUIRED).

Parameters#

ParameterType
channelIdstring
requestOptions?RequestOptions

Returns#

Promise<any>

Operation Id#

startConciergeSimulation