@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
|
@@ -430,9 +430,11 @@ var init_agents = __esm({
|
|
|
430
430
|
});
|
|
431
431
|
ProcessSchemaDTO = z.object({
|
|
432
432
|
id: z.string().min(1).max(64),
|
|
433
|
-
// System-prompt fragments compiled from say/confirm nodes. The SDK bridge
|
|
434
|
-
// composes these into the agent's prompt.
|
|
435
|
-
|
|
433
|
+
// System-prompt fragments compiled from say/confirm/llm nodes. The SDK bridge
|
|
434
|
+
// composes these into the agent's prompt. An AI step's instructions are a
|
|
435
|
+
// system prompt in their own right, so the cap is generous (2,000 refused real
|
|
436
|
+
// flows — G-27); publish checks it (validateFlowGraph → compiledSchemaIssues).
|
|
437
|
+
prompts: z.array(z.object({ id: z.string().min(1).max(128), text: z.string().max(16e3) })).max(64).optional(),
|
|
436
438
|
fields: z.array(ProcessFieldDTO).max(64),
|
|
437
439
|
completionGate: z.object({
|
|
438
440
|
requiredFields: z.array(z.string()).max(64),
|
|
@@ -1758,10 +1760,41 @@ var init_flow_ports = __esm({
|
|
|
1758
1760
|
INCOMPLETE_PORT_ID = "incomplete";
|
|
1759
1761
|
}
|
|
1760
1762
|
});
|
|
1763
|
+
|
|
1764
|
+
// ../contracts/src/flow-edges.ts
|
|
1765
|
+
var init_flow_edges = __esm({
|
|
1766
|
+
"../contracts/src/flow-edges.ts"() {
|
|
1767
|
+
}
|
|
1768
|
+
});
|
|
1769
|
+
|
|
1770
|
+
// ../contracts/src/flow-enrichment.ts
|
|
1771
|
+
var init_flow_enrichment = __esm({
|
|
1772
|
+
"../contracts/src/flow-enrichment.ts"() {
|
|
1773
|
+
}
|
|
1774
|
+
});
|
|
1775
|
+
|
|
1776
|
+
// ../contracts/src/flow-compile.ts
|
|
1777
|
+
var init_flow_compile = __esm({
|
|
1778
|
+
"../contracts/src/flow-compile.ts"() {
|
|
1779
|
+
init_flow_enrichment();
|
|
1780
|
+
init_flow_edges();
|
|
1781
|
+
}
|
|
1782
|
+
});
|
|
1783
|
+
|
|
1784
|
+
// ../contracts/src/flow-compile-check.ts
|
|
1785
|
+
var init_flow_compile_check = __esm({
|
|
1786
|
+
"../contracts/src/flow-compile-check.ts"() {
|
|
1787
|
+
init_agents();
|
|
1788
|
+
init_flow_compile();
|
|
1789
|
+
}
|
|
1790
|
+
});
|
|
1761
1791
|
var FlowIssueSeverity, FlowIssue;
|
|
1762
1792
|
var init_flow_validate = __esm({
|
|
1763
1793
|
"../contracts/src/flow-validate.ts"() {
|
|
1764
1794
|
init_flow_ports();
|
|
1795
|
+
init_flow_edges();
|
|
1796
|
+
init_flow_compile_check();
|
|
1797
|
+
init_flow_edges();
|
|
1765
1798
|
FlowIssueSeverity = z.enum(["error", "warning"]);
|
|
1766
1799
|
FlowIssue = z.object({
|
|
1767
1800
|
code: z.string().max(64),
|
|
@@ -1937,6 +1970,39 @@ var init_connection = __esm({
|
|
|
1937
1970
|
keyPlaceholder: p.keyPlaceholder ?? "",
|
|
1938
1971
|
supportsBaseUrl: p.supportsBaseUrl
|
|
1939
1972
|
}));
|
|
1973
|
+
z.object({
|
|
1974
|
+
id: z.string().min(1),
|
|
1975
|
+
label: z.string().min(1),
|
|
1976
|
+
/** The vault `provider` the resulting connection is stored under. */
|
|
1977
|
+
vaultProvider: z.string().min(1),
|
|
1978
|
+
category: z.enum(["model", "tool"])
|
|
1979
|
+
});
|
|
1980
|
+
z.object({
|
|
1981
|
+
authorizeUrl: z.string().url()
|
|
1982
|
+
});
|
|
1983
|
+
z.object({
|
|
1984
|
+
state: z.string().min(1).max(512),
|
|
1985
|
+
code: z.string().min(1).max(4096)
|
|
1986
|
+
});
|
|
1987
|
+
z.object({
|
|
1988
|
+
providerId: z.string().min(1),
|
|
1989
|
+
/** The provider's display name ("ChatGPT"). */
|
|
1990
|
+
providerLabel: z.string().min(1),
|
|
1991
|
+
/** What the connection is for — which group the dashboard files it under. */
|
|
1992
|
+
category: z.enum(["model", "tool"]),
|
|
1993
|
+
/** The account's stable id at the provider (OIDC `sub`); reconnecting the same account updates the same row. */
|
|
1994
|
+
subject: z.string().min(1).nullable(),
|
|
1995
|
+
email: z.string().nullable(),
|
|
1996
|
+
displayName: z.string().nullable(),
|
|
1997
|
+
scopes: z.array(z.string()),
|
|
1998
|
+
/**
|
|
1999
|
+
* The workspace user who signed in. A person's model plan (category 'model') serves only them — never teammates or
|
|
2000
|
+
* API keys. Absent on rows connected before it was recorded.
|
|
2001
|
+
*/
|
|
2002
|
+
connectedBy: z.string().nullable().optional(),
|
|
2003
|
+
/** Set when a refresh was refused (e.g. `invalid_grant`): the owner must connect again. */
|
|
2004
|
+
reauthRequired: z.boolean().optional()
|
|
2005
|
+
});
|
|
1940
2006
|
}
|
|
1941
2007
|
});
|
|
1942
2008
|
var E164, RoomPrefix, RecordingPrefix, Cidr, TelephonySettings, ProfileSource, EffectiveCallProfile;
|
|
@@ -2259,18 +2325,13 @@ var init_connector_stream = __esm({
|
|
|
2259
2325
|
]);
|
|
2260
2326
|
}
|
|
2261
2327
|
});
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
})
|
|
2268
|
-
|
|
2269
|
-
// ../contracts/src/flow-compile.ts
|
|
2270
|
-
var init_flow_compile = __esm({
|
|
2271
|
-
"../contracts/src/flow-compile.ts"() {
|
|
2272
|
-
init_flow_enrichment();
|
|
2273
|
-
init_flow_validate();
|
|
2328
|
+
var FLOW_BOOT_FAILURES;
|
|
2329
|
+
var init_call_end_reason = __esm({
|
|
2330
|
+
"../contracts/src/call-end-reason.ts"() {
|
|
2331
|
+
FLOW_BOOT_FAILURES = ["schema_fetch_failed", "no_process_schema", "missing_agent_id", "no_api_key"];
|
|
2332
|
+
z.enum(
|
|
2333
|
+
FLOW_BOOT_FAILURES.map((cause) => `flow_boot:${cause}`)
|
|
2334
|
+
);
|
|
2274
2335
|
}
|
|
2275
2336
|
});
|
|
2276
2337
|
var EnvironmentSpec;
|
|
@@ -3509,6 +3570,8 @@ var init_src = __esm({
|
|
|
3509
3570
|
init_connector();
|
|
3510
3571
|
init_connector_stream();
|
|
3511
3572
|
init_flow_compile();
|
|
3573
|
+
init_flow_compile_check();
|
|
3574
|
+
init_call_end_reason();
|
|
3512
3575
|
init_flow_enrichment();
|
|
3513
3576
|
init_environments();
|
|
3514
3577
|
init_variables();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@voicelayer/sdk",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"description": "Official SDK for VoiceLayer — define, run, and orchestrate voice AI agents on the VoiceLayer control plane.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "VoiceLayer",
|
|
@@ -80,15 +80,15 @@
|
|
|
80
80
|
"vitest": "^4.1.5",
|
|
81
81
|
"@voicelayer/contracts": "0.1.0",
|
|
82
82
|
"@voicelayer/llm-client": "0.1.0",
|
|
83
|
-
"@voicelayer/primitive-audio-experience": "0.1.0",
|
|
84
83
|
"@voicelayer/observability": "0.1.0",
|
|
85
84
|
"@voicelayer/primitive-audio-routing": "0.1.0",
|
|
85
|
+
"@voicelayer/primitive-audio-experience": "0.1.0",
|
|
86
86
|
"@voicelayer/primitive-process-schema": "0.1.0",
|
|
87
87
|
"@voicelayer/primitive-security": "0.1.0",
|
|
88
88
|
"@voicelayer/agents-plugin-deepgram": "1.0.1",
|
|
89
|
-
"@voicelayer/agents-plugin-livekit": "1.0.1",
|
|
90
89
|
"@voicelayer/agents-plugin-openai": "1.0.1",
|
|
91
|
-
"@voicelayer/agents-plugin-silero": "1.0.1"
|
|
90
|
+
"@voicelayer/agents-plugin-silero": "1.0.1",
|
|
91
|
+
"@voicelayer/agents-plugin-livekit": "1.0.1"
|
|
92
92
|
},
|
|
93
93
|
"scripts": {
|
|
94
94
|
"typecheck": "tsc -b --pretty false",
|