@voicelayer/sdk 0.4.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/brain/index.js +42 -3
- package/dist/index.d.ts +6 -0
- package/dist/index.js +898 -809
- package/dist/runtime/text-session.js +78 -15
- package/package.json +4 -4
package/dist/brain/index.js
CHANGED
|
@@ -622,9 +622,11 @@ var ProcessToolDTO = z.object({
|
|
|
622
622
|
});
|
|
623
623
|
var ProcessSchemaDTO = z.object({
|
|
624
624
|
id: z.string().min(1).max(64),
|
|
625
|
-
// System-prompt fragments compiled from say/confirm nodes. The SDK bridge
|
|
626
|
-
// composes these into the agent's prompt.
|
|
627
|
-
|
|
625
|
+
// System-prompt fragments compiled from say/confirm/llm nodes. The SDK bridge
|
|
626
|
+
// composes these into the agent's prompt. An AI step's instructions are a
|
|
627
|
+
// system prompt in their own right, so the cap is generous (2,000 refused real
|
|
628
|
+
// flows — G-27); publish checks it (validateFlowGraph → compiledSchemaIssues).
|
|
629
|
+
prompts: z.array(z.object({ id: z.string().min(1).max(128), text: z.string().max(16e3) })).max(64).optional(),
|
|
628
630
|
fields: z.array(ProcessFieldDTO).max(64),
|
|
629
631
|
completionGate: z.object({
|
|
630
632
|
requiredFields: z.array(z.string()).max(64),
|
|
@@ -1984,6 +1986,39 @@ byokProviders().map((p) => ({
|
|
|
1984
1986
|
keyPlaceholder: p.keyPlaceholder ?? "",
|
|
1985
1987
|
supportsBaseUrl: p.supportsBaseUrl
|
|
1986
1988
|
}));
|
|
1989
|
+
z.object({
|
|
1990
|
+
id: z.string().min(1),
|
|
1991
|
+
label: z.string().min(1),
|
|
1992
|
+
/** The vault `provider` the resulting connection is stored under. */
|
|
1993
|
+
vaultProvider: z.string().min(1),
|
|
1994
|
+
category: z.enum(["model", "tool"])
|
|
1995
|
+
});
|
|
1996
|
+
z.object({
|
|
1997
|
+
authorizeUrl: z.string().url()
|
|
1998
|
+
});
|
|
1999
|
+
z.object({
|
|
2000
|
+
state: z.string().min(1).max(512),
|
|
2001
|
+
code: z.string().min(1).max(4096)
|
|
2002
|
+
});
|
|
2003
|
+
z.object({
|
|
2004
|
+
providerId: z.string().min(1),
|
|
2005
|
+
/** The provider's display name ("ChatGPT"). */
|
|
2006
|
+
providerLabel: z.string().min(1),
|
|
2007
|
+
/** What the connection is for — which group the dashboard files it under. */
|
|
2008
|
+
category: z.enum(["model", "tool"]),
|
|
2009
|
+
/** The account's stable id at the provider (OIDC `sub`); reconnecting the same account updates the same row. */
|
|
2010
|
+
subject: z.string().min(1).nullable(),
|
|
2011
|
+
email: z.string().nullable(),
|
|
2012
|
+
displayName: z.string().nullable(),
|
|
2013
|
+
scopes: z.array(z.string()),
|
|
2014
|
+
/**
|
|
2015
|
+
* The workspace user who signed in. A person's model plan (category 'model') serves only them — never teammates or
|
|
2016
|
+
* API keys. Absent on rows connected before it was recorded.
|
|
2017
|
+
*/
|
|
2018
|
+
connectedBy: z.string().nullable().optional(),
|
|
2019
|
+
/** Set when a refresh was refused (e.g. `invalid_grant`): the owner must connect again. */
|
|
2020
|
+
reauthRequired: z.boolean().optional()
|
|
2021
|
+
});
|
|
1987
2022
|
var E164 = z.string().regex(/^\+[1-9]\d{6,14}$/, "must be E.164 (+15551234567)");
|
|
1988
2023
|
var RoomPrefix = z.string().regex(/^[a-z0-9][a-z0-9-]{0,30}[a-z0-9-]?$/, "lowercase letters, digits, dashes; max 32");
|
|
1989
2024
|
var RecordingPrefix = z.string().min(1).max(128).refine((v) => !v.startsWith("/") && !v.includes(".."), "relative key prefix only");
|
|
@@ -2286,6 +2321,10 @@ z.discriminatedUnion("kind", [
|
|
|
2286
2321
|
BrainRequestFrame,
|
|
2287
2322
|
BrainCancelFrame
|
|
2288
2323
|
]);
|
|
2324
|
+
var FLOW_BOOT_FAILURES = ["schema_fetch_failed", "no_process_schema", "missing_agent_id", "no_api_key"];
|
|
2325
|
+
z.enum(
|
|
2326
|
+
FLOW_BOOT_FAILURES.map((cause) => `flow_boot:${cause}`)
|
|
2327
|
+
);
|
|
2289
2328
|
var EnvironmentSpec = z.enum(["draft", "live"]);
|
|
2290
2329
|
z.object({
|
|
2291
2330
|
agentName: z.string().min(1),
|
package/dist/index.d.ts
CHANGED
|
@@ -1661,6 +1661,9 @@ declare const AgentConfig$1: z.ZodObject<{
|
|
|
1661
1661
|
}>;
|
|
1662
1662
|
type AgentConfig$1 = z.infer<typeof AgentConfig$1>;
|
|
1663
1663
|
|
|
1664
|
+
declare const AgentEndReason: z.ZodEnum<["flow_boot:schema_fetch_failed" | "flow_boot:no_process_schema" | "flow_boot:missing_agent_id" | "flow_boot:no_api_key", ...("flow_boot:schema_fetch_failed" | "flow_boot:no_process_schema" | "flow_boot:missing_agent_id" | "flow_boot:no_api_key")[]]>;
|
|
1665
|
+
type AgentEndReason = z.infer<typeof AgentEndReason>;
|
|
1666
|
+
|
|
1664
1667
|
interface ReadinessResult {
|
|
1665
1668
|
readonly ok: boolean;
|
|
1666
1669
|
/** Human-readable explanation when ok=false. Surfaced in metadata. */
|
|
@@ -2712,6 +2715,9 @@ interface SyncCallStateInput {
|
|
|
2712
2715
|
readonly attributes?: Record<string, CallAttributeValue>;
|
|
2713
2716
|
readonly participants?: CallParticipantInput[];
|
|
2714
2717
|
readonly legs?: CallLegInput[];
|
|
2718
|
+
/** Why the agent is ending the call — recorded as the call's end reason when it arrives before the disconnect.
|
|
2719
|
+
* Only agent-reported reasons are accepted (the rest come from the carrier). */
|
|
2720
|
+
readonly endReason?: AgentEndReason;
|
|
2715
2721
|
}
|
|
2716
2722
|
declare class CallsClient {
|
|
2717
2723
|
private readonly transport;
|