@signalwire/sdk 2.0.5 → 3.5.0
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/CHANGELOG.md +785 -0
- package/LICENSE +21 -0
- package/README.md +163 -68
- package/dist/AGENTS.md +13 -0
- package/dist/AgentBase.d.ts +481 -126
- package/dist/AgentBase.js +1502 -438
- package/dist/AgentBase.js.map +1 -1
- package/dist/AgentServer.d.ts +21 -0
- package/dist/AgentServer.js +154 -47
- package/dist/AgentServer.js.map +1 -1
- package/dist/AuthHandler.d.ts +14 -2
- package/dist/AuthHandler.js +7 -2
- package/dist/AuthHandler.js.map +1 -1
- package/dist/ConfigLoader.d.ts +5 -13
- package/dist/ConfigLoader.js +15 -29
- package/dist/ConfigLoader.js.map +1 -1
- package/dist/ContextBuilder.d.ts +202 -9
- package/dist/ContextBuilder.js +219 -36
- package/dist/ContextBuilder.js.map +1 -1
- package/dist/DataMap.d.ts +158 -45
- package/dist/DataMap.js +167 -52
- package/dist/DataMap.js.map +1 -1
- package/dist/FunctionResult.d.ts +277 -83
- package/dist/FunctionResult.js +444 -116
- package/dist/FunctionResult.js.map +1 -1
- package/dist/Logger.d.ts +30 -5
- package/dist/Logger.js +77 -19
- package/dist/Logger.js.map +1 -1
- package/dist/POM/PromptObjectModel.d.ts +12 -1
- package/dist/POM/PromptObjectModel.js +25 -9
- package/dist/POM/PromptObjectModel.js.map +1 -1
- package/dist/ParameterSchema.d.ts +306 -0
- package/dist/ParameterSchema.js +251 -0
- package/dist/ParameterSchema.js.map +1 -0
- package/dist/PlatformContracts.d.ts +21 -0
- package/dist/PlatformContracts.generated.d.ts +109 -0
- package/dist/PlatformContracts.generated.js +8 -0
- package/dist/PlatformContracts.generated.js.map +1 -0
- package/dist/PlatformContracts.js +2 -0
- package/dist/PlatformContracts.js.map +1 -0
- package/dist/PomBuilder.d.ts +18 -0
- package/dist/PomBuilder.js +53 -3
- package/dist/PomBuilder.js.map +1 -1
- package/dist/PostPrompt.d.ts +110 -0
- package/dist/PostPrompt.js +204 -0
- package/dist/PostPrompt.js.map +1 -0
- package/dist/PromptManager.d.ts +22 -1
- package/dist/PromptManager.js +28 -1
- package/dist/PromptManager.js.map +1 -1
- package/dist/PublicFetch.d.ts +132 -0
- package/dist/PublicFetch.js +311 -0
- package/dist/PublicFetch.js.map +1 -0
- package/dist/RobotsTxt.d.ts +41 -0
- package/dist/RobotsTxt.js +152 -0
- package/dist/RobotsTxt.js.map +1 -0
- package/dist/SWMLHandler.js.map +1 -1
- package/dist/SWMLService.d.ts +158 -58
- package/dist/SWMLService.js +435 -127
- package/dist/SWMLService.js.map +1 -1
- package/dist/SchemaUtils.d.ts +115 -2
- package/dist/SchemaUtils.js +444 -12
- package/dist/SchemaUtils.js.map +1 -1
- package/dist/SecurityUtils.d.ts +49 -9
- package/dist/SecurityUtils.js +153 -51
- package/dist/SecurityUtils.js.map +1 -1
- package/dist/ServerlessAdapter.d.ts +156 -7
- package/dist/ServerlessAdapter.js +399 -42
- package/dist/ServerlessAdapter.js.map +1 -1
- package/dist/SessionManager.d.ts +11 -2
- package/dist/SessionManager.js +50 -18
- package/dist/SessionManager.js.map +1 -1
- package/dist/SslConfig.d.ts +2 -1
- package/dist/SslConfig.js +4 -1
- package/dist/SslConfig.js.map +1 -1
- package/dist/SwaigActions.generated.d.ts +23 -0
- package/dist/SwaigActions.generated.js +8 -0
- package/dist/SwaigActions.generated.js.map +1 -0
- package/dist/SwaigContracts.d.ts +15 -0
- package/dist/SwaigContracts.generated.d.ts +264 -0
- package/dist/SwaigContracts.generated.js +12 -0
- package/dist/SwaigContracts.generated.js.map +1 -0
- package/dist/SwaigContracts.js +2 -0
- package/dist/SwaigContracts.js.map +1 -0
- package/dist/SwaigFunction.d.ts +110 -4
- package/dist/SwaigFunction.js +151 -19
- package/dist/SwaigFunction.js.map +1 -1
- package/dist/SwmlBuilder.d.ts +68 -19
- package/dist/SwmlBuilder.js +74 -38
- package/dist/SwmlBuilder.js.map +1 -1
- package/dist/SwmlVerbMethods.generated.d.ts +41 -4
- package/dist/SwmlVerbMethods.generated.js +1 -1
- package/dist/TypeInference.d.ts +39 -3
- package/dist/TypeInference.js +256 -16
- package/dist/TypeInference.js.map +1 -1
- package/dist/WebService.d.ts +79 -11
- package/dist/WebService.js +320 -109
- package/dist/WebService.js.map +1 -1
- package/dist/WebhookMiddleware.d.ts +119 -0
- package/dist/WebhookMiddleware.js +271 -0
- package/dist/WebhookMiddleware.js.map +1 -0
- package/dist/WebhookValidator.d.ts +92 -0
- package/dist/WebhookValidator.js +409 -0
- package/dist/WebhookValidator.js.map +1 -0
- package/dist/agents/BedrockAgent.d.ts +162 -0
- package/dist/agents/BedrockAgent.js +323 -0
- package/dist/agents/BedrockAgent.js.map +1 -0
- package/dist/ai-chat/AIChatClient.d.ts +316 -0
- package/dist/ai-chat/AIChatClient.js +535 -0
- package/dist/ai-chat/AIChatClient.js.map +1 -0
- package/dist/ai-chat/ChatGateway.d.ts +408 -0
- package/dist/ai-chat/ChatGateway.js +747 -0
- package/dist/ai-chat/ChatGateway.js.map +1 -0
- package/dist/ai-chat/HandoffRouter.d.ts +282 -0
- package/dist/ai-chat/HandoffRouter.js +518 -0
- package/dist/ai-chat/HandoffRouter.js.map +1 -0
- package/dist/ai-chat/index.d.ts +12 -0
- package/dist/ai-chat/index.js +10 -0
- package/dist/ai-chat/index.js.map +1 -0
- package/dist/capabilities.d.ts +64 -0
- package/dist/capabilities.js +95 -0
- package/dist/capabilities.js.map +1 -0
- package/dist/cli/agent-loader.d.ts +32 -6
- package/dist/cli/agent-loader.js +92 -33
- package/dist/cli/agent-loader.js.map +1 -1
- package/dist/cli/datamap-exec.d.ts +175 -0
- package/dist/cli/datamap-exec.js +1284 -0
- package/dist/cli/datamap-exec.js.map +1 -0
- package/dist/cli/function-args.d.ts +40 -0
- package/dist/cli/function-args.js +146 -0
- package/dist/cli/function-args.js.map +1 -0
- package/dist/cli/simulation.d.ts +99 -0
- package/dist/cli/simulation.js +490 -0
- package/dist/cli/simulation.js.map +1 -0
- package/dist/cli/swaig-test.d.ts +12 -25
- package/dist/cli/swaig-test.js +935 -371
- package/dist/cli/swaig-test.js.map +1 -1
- package/dist/cli/tsdocs/agentsNote.d.ts +30 -0
- package/dist/cli/tsdocs/agentsNote.js +92 -0
- package/dist/cli/tsdocs/agentsNote.js.map +1 -0
- package/dist/cli/tsdocs/api-index.json +1 -0
- package/dist/cli/tsdocs/api.d.ts +91 -0
- package/dist/cli/tsdocs/api.js +372 -0
- package/dist/cli/tsdocs/api.js.map +1 -0
- package/dist/cli/tsdocs/apiTypes.d.ts +64 -0
- package/dist/cli/tsdocs/apiTypes.js +7 -0
- package/dist/cli/tsdocs/apiTypes.js.map +1 -0
- package/dist/cli/tsdocs/bin.d.ts +6 -0
- package/dist/cli/tsdocs/bin.js +23 -0
- package/dist/cli/tsdocs/bin.js.map +1 -0
- package/dist/cli/tsdocs/files.d.ts +108 -0
- package/dist/cli/tsdocs/files.js +287 -0
- package/dist/cli/tsdocs/files.js.map +1 -0
- package/dist/cli/tsdocs/index.d.ts +28 -0
- package/dist/cli/tsdocs/index.js +307 -0
- package/dist/cli/tsdocs/index.js.map +1 -0
- package/dist/cli/tsdocs/live.d.ts +41 -0
- package/dist/cli/tsdocs/live.js +202 -0
- package/dist/cli/tsdocs/live.js.map +1 -0
- package/dist/cli/tsdocs/locate.d.ts +51 -0
- package/dist/cli/tsdocs/locate.js +75 -0
- package/dist/cli/tsdocs/locate.js.map +1 -0
- package/dist/cli/tsdocs/render.d.ts +75 -0
- package/dist/cli/tsdocs/render.js +323 -0
- package/dist/cli/tsdocs/render.js.map +1 -0
- package/dist/cli/tsdocs/topics.d.ts +43 -0
- package/dist/cli/tsdocs/topics.js +916 -0
- package/dist/cli/tsdocs/topics.js.map +1 -0
- package/dist/index.d.ts +47 -68
- package/dist/index.js +44 -73
- package/dist/index.js.map +1 -1
- package/dist/livewire/index.d.ts +229 -155
- package/dist/livewire/index.js +298 -195
- package/dist/livewire/index.js.map +1 -1
- package/dist/llms.txt +65 -0
- package/dist/prefabs/CallSessionStore.d.ts +52 -0
- package/dist/prefabs/CallSessionStore.js +72 -0
- package/dist/prefabs/CallSessionStore.js.map +1 -0
- package/dist/prefabs/ConciergeAgent.d.ts +13 -1
- package/dist/prefabs/ConciergeAgent.js +36 -31
- package/dist/prefabs/ConciergeAgent.js.map +1 -1
- package/dist/prefabs/FAQBotAgent.d.ts +9 -1
- package/dist/prefabs/FAQBotAgent.js +113 -47
- package/dist/prefabs/FAQBotAgent.js.map +1 -1
- package/dist/prefabs/InfoGathererAgent.d.ts +22 -3
- package/dist/prefabs/InfoGathererAgent.js +67 -58
- package/dist/prefabs/InfoGathererAgent.js.map +1 -1
- package/dist/prefabs/ReceptionistAgent.d.ts +16 -5
- package/dist/prefabs/ReceptionistAgent.js +39 -31
- package/dist/prefabs/ReceptionistAgent.js.map +1 -1
- package/dist/prefabs/SurveyAgent.d.ts +22 -4
- package/dist/prefabs/SurveyAgent.js +84 -68
- package/dist/prefabs/SurveyAgent.js.map +1 -1
- package/dist/relay/Action.d.ts +44 -21
- package/dist/relay/Action.js +75 -17
- package/dist/relay/Action.js.map +1 -1
- package/dist/relay/Call.d.ts +312 -47
- package/dist/relay/Call.js +369 -18
- package/dist/relay/Call.js.map +1 -1
- package/dist/relay/Deferred.js.map +1 -1
- package/dist/relay/Message.d.ts +26 -5
- package/dist/relay/Message.js +36 -6
- package/dist/relay/Message.js.map +1 -1
- package/dist/relay/RelayClient.d.ts +44 -17
- package/dist/relay/RelayClient.js +175 -65
- package/dist/relay/RelayClient.js.map +1 -1
- package/dist/relay/RelayError.d.ts +14 -0
- package/dist/relay/RelayError.js +15 -0
- package/dist/relay/RelayError.js.map +1 -1
- package/dist/relay/RelayEvent.d.ts +96 -65
- package/dist/relay/RelayEvent.js +85 -56
- package/dist/relay/RelayEvent.js.map +1 -1
- package/dist/relay/closedSets.d.ts +111 -0
- package/dist/relay/closedSets.js +83 -0
- package/dist/relay/closedSets.js.map +1 -0
- package/dist/relay/index.d.ts +3 -1
- package/dist/relay/index.js +1 -0
- package/dist/relay/index.js.map +1 -1
- package/dist/relay/normalize.js.map +1 -1
- package/dist/relay/protocol.types.generated.d.ts +1195 -0
- package/dist/relay/protocol.types.generated.js +8 -0
- package/dist/relay/protocol.types.generated.js.map +1 -0
- package/dist/relay/types.d.ts +73 -42
- package/dist/rest/HttpClient.d.ts +36 -8
- package/dist/rest/HttpClient.js +233 -40
- package/dist/rest/HttpClient.js.map +1 -1
- package/dist/rest/RequestOptions.d.ts +110 -0
- package/dist/rest/RequestOptions.js +113 -0
- package/dist/rest/RequestOptions.js.map +1 -0
- package/dist/rest/RestError.d.ts +52 -6
- package/dist/rest/RestError.js +89 -5
- package/dist/rest/RestError.js.map +1 -1
- package/dist/rest/base/CrudResource.d.ts +16 -26
- package/dist/rest/base/CrudResource.js +19 -33
- package/dist/rest/base/CrudResource.js.map +1 -1
- package/dist/rest/base/CrudWithAddresses.d.ts +3 -2
- package/dist/rest/base/CrudWithAddresses.js +2 -2
- package/dist/rest/base/CrudWithAddresses.js.map +1 -1
- package/dist/rest/base/FabricResource.d.ts +15 -0
- package/dist/rest/base/FabricResource.js +16 -0
- package/dist/rest/base/FabricResource.js.map +1 -0
- package/dist/rest/base/ReadResource.d.ts +62 -0
- package/dist/rest/base/ReadResource.js +69 -0
- package/dist/rest/base/ReadResource.js.map +1 -0
- package/dist/rest/callHandler.d.ts +5 -2
- package/dist/rest/callHandler.js +4 -1
- package/dist/rest/callHandler.js.map +1 -1
- package/dist/rest/index.d.ts +18 -77
- package/dist/rest/index.js +47 -120
- package/dist/rest/index.js.map +1 -1
- package/dist/rest/namespaces/_client_tree_generated.d.ts +103 -0
- package/dist/rest/namespaces/_client_tree_generated.js +171 -0
- package/dist/rest/namespaces/_client_tree_generated.js.map +1 -0
- package/dist/rest/namespaces/addresses.d.ts +3 -42
- package/dist/rest/namespaces/addresses.js +3 -50
- package/dist/rest/namespaces/addresses.js.map +1 -1
- package/dist/rest/namespaces/calling.d.ts +6 -378
- package/dist/rest/namespaces/calling.js +6 -473
- package/dist/rest/namespaces/calling.js.map +1 -1
- package/dist/rest/namespaces/calling.resources.generated.d.ts +165 -0
- package/dist/rest/namespaces/calling.resources.generated.js +477 -0
- package/dist/rest/namespaces/calling.resources.generated.js.map +1 -0
- package/dist/rest/namespaces/calling.types.generated.d.ts +2917 -0
- package/dist/rest/namespaces/calling.types.generated.js +8 -0
- package/dist/rest/namespaces/calling.types.generated.js.map +1 -0
- package/dist/rest/namespaces/chat.d.ts +4 -18
- package/dist/rest/namespaces/chat.js +4 -21
- package/dist/rest/namespaces/chat.js.map +1 -1
- package/dist/rest/namespaces/chat.resources.generated.d.ts +12 -0
- package/dist/rest/namespaces/chat.resources.generated.js +29 -0
- package/dist/rest/namespaces/chat.resources.generated.js.map +1 -0
- package/dist/rest/namespaces/chat.types.generated.d.ts +56 -0
- package/dist/rest/namespaces/chat.types.generated.js +8 -0
- package/dist/rest/namespaces/chat.types.generated.js.map +1 -0
- package/dist/rest/namespaces/datasphere.d.ts +6 -62
- package/dist/rest/namespaces/datasphere.js +6 -72
- package/dist/rest/namespaces/datasphere.js.map +1 -1
- package/dist/rest/namespaces/datasphere.resources.generated.d.ts +25 -0
- package/dist/rest/namespaces/datasphere.resources.generated.js +50 -0
- package/dist/rest/namespaces/datasphere.resources.generated.js.map +1 -0
- package/dist/rest/namespaces/datasphere.types.generated.d.ts +180 -0
- package/dist/rest/namespaces/datasphere.types.generated.js +8 -0
- package/dist/rest/namespaces/datasphere.types.generated.js.map +1 -0
- package/dist/rest/namespaces/fabric.d.ts +11 -327
- package/dist/rest/namespaces/fabric.js +14 -439
- package/dist/rest/namespaces/fabric.js.map +1 -1
- package/dist/rest/namespaces/fabric.resources.generated.d.ts +195 -0
- package/dist/rest/namespaces/fabric.resources.generated.js +399 -0
- package/dist/rest/namespaces/fabric.resources.generated.js.map +1 -0
- package/dist/rest/namespaces/fabric.types.generated.d.ts +4557 -0
- package/dist/rest/namespaces/fabric.types.generated.js +8 -0
- package/dist/rest/namespaces/fabric.types.generated.js.map +1 -0
- package/dist/rest/namespaces/fax.resources.generated.d.ts +6 -0
- package/dist/rest/namespaces/fax.resources.generated.js +14 -0
- package/dist/rest/namespaces/fax.resources.generated.js.map +1 -0
- package/dist/rest/namespaces/fax.types.generated.d.ts +131 -0
- package/dist/rest/namespaces/fax.types.generated.js +8 -0
- package/dist/rest/namespaces/fax.types.generated.js.map +1 -0
- package/dist/rest/namespaces/imported-numbers.d.ts +3 -18
- package/dist/rest/namespaces/imported-numbers.js +3 -21
- package/dist/rest/namespaces/imported-numbers.js.map +1 -1
- package/dist/rest/namespaces/logs.d.ts +10 -101
- package/dist/rest/namespaces/logs.js +10 -128
- package/dist/rest/namespaces/logs.js.map +1 -1
- package/dist/rest/namespaces/logs.resources.generated.d.ts +9 -0
- package/dist/rest/namespaces/logs.resources.generated.js +17 -0
- package/dist/rest/namespaces/logs.resources.generated.js.map +1 -0
- package/dist/rest/namespaces/logs.types.generated.d.ts +131 -0
- package/dist/rest/namespaces/logs.types.generated.js +8 -0
- package/dist/rest/namespaces/logs.types.generated.js.map +1 -0
- package/dist/rest/namespaces/lookup.d.ts +3 -25
- package/dist/rest/namespaces/lookup.js +3 -27
- package/dist/rest/namespaces/lookup.js.map +1 -1
- package/dist/rest/namespaces/message.resources.generated.d.ts +6 -0
- package/dist/rest/namespaces/message.resources.generated.js +14 -0
- package/dist/rest/namespaces/message.resources.generated.js.map +1 -0
- package/dist/rest/namespaces/message.types.generated.d.ts +122 -0
- package/dist/rest/namespaces/message.types.generated.js +8 -0
- package/dist/rest/namespaces/message.types.generated.js.map +1 -0
- package/dist/rest/namespaces/messages.resources.generated.d.ts +18 -0
- package/dist/rest/namespaces/messages.resources.generated.js +44 -0
- package/dist/rest/namespaces/messages.resources.generated.js.map +1 -0
- package/dist/rest/namespaces/messages.types.generated.d.ts +99 -0
- package/dist/rest/namespaces/messages.types.generated.js +8 -0
- package/dist/rest/namespaces/messages.types.generated.js.map +1 -0
- package/dist/rest/namespaces/mfa.d.ts +3 -42
- package/dist/rest/namespaces/mfa.js +3 -49
- package/dist/rest/namespaces/mfa.js.map +1 -1
- package/dist/rest/namespaces/number-groups.d.ts +3 -45
- package/dist/rest/namespaces/number-groups.js +3 -53
- package/dist/rest/namespaces/number-groups.js.map +1 -1
- package/dist/rest/namespaces/phone-numbers.d.ts +8 -196
- package/dist/rest/namespaces/phone-numbers.js +8 -230
- package/dist/rest/namespaces/phone-numbers.js.map +1 -1
- package/dist/rest/namespaces/project.d.ts +6 -42
- package/dist/rest/namespaces/project.js +6 -51
- package/dist/rest/namespaces/project.js.map +1 -1
- package/dist/rest/namespaces/project.resources.generated.d.ts +17 -0
- package/dist/rest/namespaces/project.resources.generated.js +44 -0
- package/dist/rest/namespaces/project.resources.generated.js.map +1 -0
- package/dist/rest/namespaces/project.types.generated.d.ts +58 -0
- package/dist/rest/namespaces/project.types.generated.js +8 -0
- package/dist/rest/namespaces/project.types.generated.js.map +1 -0
- package/dist/rest/namespaces/projects.resources.generated.d.ts +12 -0
- package/dist/rest/namespaces/projects.resources.generated.js +25 -0
- package/dist/rest/namespaces/projects.resources.generated.js.map +1 -0
- package/dist/rest/namespaces/projects.types.generated.d.ts +77 -0
- package/dist/rest/namespaces/projects.types.generated.js +8 -0
- package/dist/rest/namespaces/projects.types.generated.js.map +1 -0
- package/dist/rest/namespaces/pubsub.d.ts +4 -18
- package/dist/rest/namespaces/pubsub.js +4 -21
- package/dist/rest/namespaces/pubsub.js.map +1 -1
- package/dist/rest/namespaces/pubsub.resources.generated.d.ts +12 -0
- package/dist/rest/namespaces/pubsub.resources.generated.js +29 -0
- package/dist/rest/namespaces/pubsub.resources.generated.js.map +1 -0
- package/dist/rest/namespaces/pubsub.types.generated.d.ts +60 -0
- package/dist/rest/namespaces/pubsub.types.generated.js +8 -0
- package/dist/rest/namespaces/pubsub.types.generated.js.map +1 -0
- package/dist/rest/namespaces/queues.d.ts +3 -38
- package/dist/rest/namespaces/queues.js +3 -44
- package/dist/rest/namespaces/queues.js.map +1 -1
- package/dist/rest/namespaces/recordings.d.ts +3 -34
- package/dist/rest/namespaces/recordings.js +3 -40
- package/dist/rest/namespaces/recordings.js.map +1 -1
- package/dist/rest/namespaces/registry.d.ts +6 -137
- package/dist/rest/namespaces/registry.js +6 -173
- package/dist/rest/namespaces/registry.js.map +1 -1
- package/dist/rest/namespaces/relay-rest.resources.generated.d.ts +168 -0
- package/dist/rest/namespaces/relay-rest.resources.generated.js +430 -0
- package/dist/rest/namespaces/relay-rest.resources.generated.js.map +1 -0
- package/dist/rest/namespaces/relay-rest.types.generated.d.ts +1906 -0
- package/dist/rest/namespaces/relay-rest.types.generated.js +8 -0
- package/dist/rest/namespaces/relay-rest.types.generated.js.map +1 -0
- package/dist/rest/namespaces/short-codes.d.ts +3 -35
- package/dist/rest/namespaces/short-codes.js +3 -41
- package/dist/rest/namespaces/short-codes.js.map +1 -1
- package/dist/rest/namespaces/sip-profile.d.ts +3 -24
- package/dist/rest/namespaces/sip-profile.js +3 -29
- package/dist/rest/namespaces/sip-profile.js.map +1 -1
- package/dist/rest/namespaces/verified-callers.d.ts +3 -29
- package/dist/rest/namespaces/verified-callers.js +3 -34
- package/dist/rest/namespaces/verified-callers.js.map +1 -1
- package/dist/rest/namespaces/video.d.ts +10 -227
- package/dist/rest/namespaces/video.js +10 -288
- package/dist/rest/namespaces/video.js.map +1 -1
- package/dist/rest/namespaces/video.resources.generated.d.ts +81 -0
- package/dist/rest/namespaces/video.resources.generated.js +171 -0
- package/dist/rest/namespaces/video.resources.generated.js.map +1 -0
- package/dist/rest/namespaces/video.types.generated.d.ts +771 -0
- package/dist/rest/namespaces/video.types.generated.js +8 -0
- package/dist/rest/namespaces/video.types.generated.js.map +1 -0
- package/dist/rest/namespaces/voice.resources.generated.d.ts +9 -0
- package/dist/rest/namespaces/voice.resources.generated.js +17 -0
- package/dist/rest/namespaces/voice.resources.generated.js.map +1 -0
- package/dist/rest/namespaces/voice.types.generated.d.ts +214 -0
- package/dist/rest/namespaces/voice.types.generated.js +8 -0
- package/dist/rest/namespaces/voice.types.generated.js.map +1 -0
- package/dist/rest/pagination.d.ts +5 -1
- package/dist/rest/pagination.js +40 -20
- package/dist/rest/pagination.js.map +1 -1
- package/dist/rest/types.d.ts +21 -3
- package/dist/schema.json +299 -98
- package/dist/skills/SkillBase.d.ts +97 -20
- package/dist/skills/SkillBase.js +100 -17
- package/dist/skills/SkillBase.js.map +1 -1
- package/dist/skills/SkillManager.d.ts +66 -13
- package/dist/skills/SkillManager.js +101 -20
- package/dist/skills/SkillManager.js.map +1 -1
- package/dist/skills/SkillName.d.ts +44 -0
- package/dist/skills/SkillName.js +2 -0
- package/dist/skills/SkillName.js.map +1 -0
- package/dist/skills/SkillRegistry.d.ts +22 -11
- package/dist/skills/SkillRegistry.js +47 -17
- package/dist/skills/SkillRegistry.js.map +1 -1
- package/dist/skills/builtin/api_ninjas_trivia.d.ts +3 -1
- package/dist/skills/builtin/api_ninjas_trivia.js +18 -6
- package/dist/skills/builtin/api_ninjas_trivia.js.map +1 -1
- package/dist/skills/builtin/ask_claude.d.ts +14 -4
- package/dist/skills/builtin/ask_claude.js +36 -14
- package/dist/skills/builtin/ask_claude.js.map +1 -1
- package/dist/skills/builtin/claude_skills.d.ts +3 -1
- package/dist/skills/builtin/claude_skills.js +19 -15
- package/dist/skills/builtin/claude_skills.js.map +1 -1
- package/dist/skills/builtin/custom_skills.d.ts +10 -3
- package/dist/skills/builtin/custom_skills.js +26 -9
- package/dist/skills/builtin/custom_skills.js.map +1 -1
- package/dist/skills/builtin/datasphere.d.ts +5 -3
- package/dist/skills/builtin/datasphere.js +21 -22
- package/dist/skills/builtin/datasphere.js.map +1 -1
- package/dist/skills/builtin/datasphere_serverless.d.ts +12 -1
- package/dist/skills/builtin/datasphere_serverless.js +17 -6
- package/dist/skills/builtin/datasphere_serverless.js.map +1 -1
- package/dist/skills/builtin/datetime.d.ts +3 -1
- package/dist/skills/builtin/datetime.js +11 -7
- package/dist/skills/builtin/datetime.js.map +1 -1
- package/dist/skills/builtin/google_maps.d.ts +29 -14
- package/dist/skills/builtin/google_maps.js +89 -269
- package/dist/skills/builtin/google_maps.js.map +1 -1
- package/dist/skills/builtin/index.d.ts +8 -6
- package/dist/skills/builtin/index.js +8 -6
- package/dist/skills/builtin/index.js.map +1 -1
- package/dist/skills/builtin/info_gatherer.d.ts +4 -2
- package/dist/skills/builtin/info_gatherer.js +20 -12
- package/dist/skills/builtin/info_gatherer.js.map +1 -1
- package/dist/skills/builtin/joke.d.ts +16 -6
- package/dist/skills/builtin/joke.js +54 -37
- package/dist/skills/builtin/joke.js.map +1 -1
- package/dist/skills/builtin/math.d.ts +3 -1
- package/dist/skills/builtin/math.js +14 -9
- package/dist/skills/builtin/math.js.map +1 -1
- package/dist/skills/builtin/mcp_gateway.d.ts +34 -5
- package/dist/skills/builtin/mcp_gateway.js +77 -46
- package/dist/skills/builtin/mcp_gateway.js.map +1 -1
- package/dist/skills/builtin/native_vector_search.d.ts +19 -5
- package/dist/skills/builtin/native_vector_search.js +179 -61
- package/dist/skills/builtin/native_vector_search.js.map +1 -1
- package/dist/skills/builtin/play_background_file.d.ts +21 -15
- package/dist/skills/builtin/play_background_file.js +43 -122
- package/dist/skills/builtin/play_background_file.js.map +1 -1
- package/dist/skills/builtin/spider.d.ts +42 -4
- package/dist/skills/builtin/spider.js +277 -104
- package/dist/skills/builtin/spider.js.map +1 -1
- package/dist/skills/builtin/swml_transfer.d.ts +14 -3
- package/dist/skills/builtin/swml_transfer.js +45 -24
- package/dist/skills/builtin/swml_transfer.js.map +1 -1
- package/dist/skills/builtin/weather_api.d.ts +24 -13
- package/dist/skills/builtin/weather_api.js +38 -30
- package/dist/skills/builtin/weather_api.js.map +1 -1
- package/dist/skills/builtin/web_search.d.ts +48 -10
- package/dist/skills/builtin/web_search.js +294 -100
- package/dist/skills/builtin/web_search.js.map +1 -1
- package/dist/skills/builtin/wikipedia_search.d.ts +4 -2
- package/dist/skills/builtin/wikipedia_search.js +14 -13
- package/dist/skills/builtin/wikipedia_search.js.map +1 -1
- package/dist/skills/index.d.ts +3 -2
- package/dist/skills/index.js +1 -1
- package/dist/skills/index.js.map +1 -1
- package/dist/swml_verbs_generated.d.ts +2824 -0
- package/dist/swml_verbs_generated.js +12 -0
- package/dist/swml_verbs_generated.js.map +1 -0
- package/dist/types.d.ts +59 -6
- package/dist/web.d.ts +27 -0
- package/dist/web.js +20 -0
- package/dist/web.js.map +1 -0
- package/docs/agent-guide.md +1034 -0
- package/docs/ai_chat.md +560 -0
- package/docs/api-reference.md +3534 -0
- package/docs/architecture.md +846 -0
- package/docs/bedrock_agent.md +411 -0
- package/docs/cli-guide.md +403 -0
- package/docs/cloud_functions_guide.md +399 -0
- package/docs/configuration.md +548 -0
- package/docs/contexts-guide.md +884 -0
- package/docs/datamap-guide.md +1160 -0
- package/docs/developer_pain_points.md +548 -0
- package/docs/llm_parameters.md +298 -0
- package/docs/mcp_gateway_reference.md +354 -0
- package/docs/mcp_integration.md +162 -0
- package/docs/pgi_agent_guide.md +1820 -0
- package/docs/prefabs-guide.md +815 -0
- package/docs/programmatically_governed_inference.md +301 -0
- package/docs/sdk_features.md +501 -0
- package/docs/security.md +559 -0
- package/docs/serverless-guide.md +520 -0
- package/docs/skills-guide.md +1223 -0
- package/docs/skills-system.md +405 -0
- package/docs/skills_parameter_schema.md +417 -0
- package/docs/swaig-reference.md +1938 -0
- package/docs/swml_service_guide.md +573 -0
- package/docs/third_party_skills.md +410 -0
- package/docs/web_service.md +666 -0
- package/examples/README.md +202 -0
- package/examples/advanced-datamap.ts +108 -0
- package/examples/advanced-dynamic-config.ts +70 -0
- package/examples/auto-vivified.ts +95 -0
- package/examples/call-flow.ts +65 -0
- package/examples/comprehensive-dynamic.ts +125 -0
- package/examples/contexts-steps.ts +65 -0
- package/examples/custom-path.ts +45 -0
- package/examples/datamap-tools.ts +51 -0
- package/examples/datasphere-multi-instance.ts +66 -0
- package/examples/datasphere-serverless-env.ts +87 -0
- package/examples/datasphere-webhook-env.ts +65 -0
- package/examples/datasphere.ts +56 -0
- package/examples/declarative.ts +100 -0
- package/examples/dynamic-config.ts +54 -0
- package/examples/dynamic-info-gatherer.ts +69 -0
- package/examples/dynamic-swml-service.ts +67 -0
- package/examples/gather-info.ts +95 -0
- package/examples/gather-per-question-functions-demo.ts +139 -0
- package/examples/joke-agent.ts +34 -0
- package/examples/kubernetes-agent.ts +45 -0
- package/examples/llm-params.ts +75 -0
- package/examples/mcp-agent.ts +89 -0
- package/examples/mcp-gateway.ts +81 -0
- package/examples/multi-agent.ts +80 -0
- package/examples/multi-endpoint.ts +79 -0
- package/examples/pgi/case-domain.ts +114 -0
- package/examples/pgi/serve.ts +16 -0
- package/examples/pgi/support-agent.ts +265 -0
- package/examples/pom-prompt.ts +70 -0
- package/examples/prefab-concierge.ts +42 -0
- package/examples/prefab-faq.ts +58 -0
- package/examples/prefab-info-gatherer.ts +33 -0
- package/examples/prefab-receptionist.ts +36 -0
- package/examples/prefab-survey.ts +69 -0
- package/examples/quickstart-agent.ts +29 -0
- package/examples/quickstart-relay.ts +25 -0
- package/examples/quickstart-rest.ts +25 -0
- package/examples/record-call.ts +65 -0
- package/examples/relay-demo.ts +33 -0
- package/examples/room-and-sip.ts +93 -0
- package/examples/serverless-lambda.ts +43 -0
- package/examples/session-state.ts +83 -0
- package/examples/simple-agent.ts +36 -0
- package/examples/simple-static.ts +29 -0
- package/examples/skills-demo.ts +41 -0
- package/examples/step-function-inheritance-demo.ts +124 -0
- package/examples/swaig-features.ts +193 -0
- package/examples/swml-service-routing.ts +66 -0
- package/examples/swml-service.ts +38 -0
- package/examples/swmlservice_ai_sidecar.ts +104 -0
- package/examples/swmlservice_swaig_standalone.ts +79 -0
- package/examples/tap.ts +67 -0
- package/examples/typed-tools.ts +68 -0
- package/examples/verb-methods.ts +45 -0
- package/examples/web-search-multi-instance.ts +75 -0
- package/examples/web-search.ts +38 -0
- package/examples/wikipedia.ts +36 -0
- package/livewire/README.md +164 -0
- package/livewire/docs/migration-guide.md +251 -0
- package/livewire/examples/livewire-basic-agent.ts +74 -0
- package/livewire/examples/livewire-handoff.ts +196 -0
- package/livewire/examples/livewire-multi-tool.ts +121 -0
- package/package.json +85 -13
- package/relay/README.md +101 -0
- package/relay/docs/call-methods.md +622 -0
- package/relay/docs/client-reference.md +281 -0
- package/relay/docs/events.md +193 -0
- package/relay/docs/getting-started.md +221 -0
- package/relay/docs/guide.md +386 -0
- package/relay/docs/messaging.md +246 -0
- package/relay/examples/relay-inbound.ts +66 -0
- package/relay/examples/relay-messaging.ts +74 -0
- package/relay/examples/relay-outbound.ts +76 -0
- package/rest/README.md +141 -0
- package/rest/docs/calling.md +313 -0
- package/rest/docs/client-reference.md +149 -0
- package/rest/docs/fabric.md +192 -0
- package/rest/docs/getting-started.md +138 -0
- package/rest/docs/guide.md +421 -0
- package/rest/docs/namespaces.md +367 -0
- package/rest/docs/phone-binding.md +116 -0
- package/rest/examples/rest-10dlc-registration.ts +177 -0
- package/rest/examples/rest-bind-phone-to-swml-webhook.ts +66 -0
- package/rest/examples/rest-calling-ivr-and-ai.ts +136 -0
- package/rest/examples/rest-calling-play-and-record.ts +98 -0
- package/rest/examples/rest-client.ts +59 -0
- package/rest/examples/rest-datasphere-search.ts +81 -0
- package/rest/examples/rest-fabric-conferences-and-routing.ts +147 -0
- package/rest/examples/rest-fabric-subscribers-and-sip.ts +106 -0
- package/rest/examples/rest-fabric-swml-and-callflows.ts +101 -0
- package/rest/examples/rest-manage-resources.ts +64 -0
- package/rest/examples/rest-phone-number-management.ts +200 -0
- package/rest/examples/rest-queues-mfa-and-recordings.ts +143 -0
- package/rest/examples/rest-video-rooms.ts +186 -0
- package/tutorial/fred/fred.ts +218 -0
- package/tutorial/fred/tutorial/01-introduction.md +141 -0
- package/tutorial/fred/tutorial/02-setup.md +304 -0
- package/tutorial/fred/tutorial/03-basic-agent.md +284 -0
- package/tutorial/fred/tutorial/04-wikipedia-skill.md +298 -0
- package/tutorial/fred/tutorial/05-custom-functions.md +347 -0
- package/tutorial/fred/tutorial/06-running-testing.md +642 -0
- package/tutorial/fred/tutorial/README.md +56 -0
- package/tutorial/fred/tutorial/appendix-complete-code.md +632 -0
- package/tutorial/fred/tutorial/appendix-docker-deployment.md +504 -0
- package/tutorial/full-guardrails-agent/handlers.ts +436 -0
- package/tutorial/full-guardrails-agent/penny.ts +305 -0
- package/tutorial/full-guardrails-agent/reservations.ts +1109 -0
- package/tutorial/full-guardrails-agent/tutorial/01-why-guardrails.md +149 -0
- package/tutorial/full-guardrails-agent/tutorial/02-design-first.md +139 -0
- package/tutorial/full-guardrails-agent/tutorial/03-rules-first.md +422 -0
- package/tutorial/full-guardrails-agent/tutorial/04-the-shell.md +238 -0
- package/tutorial/full-guardrails-agent/tutorial/05-steps-and-scoping.md +247 -0
- package/tutorial/full-guardrails-agent/tutorial/06-tools-that-decide.md +467 -0
- package/tutorial/full-guardrails-agent/tutorial/07-gather-and-projection.md +160 -0
- package/tutorial/full-guardrails-agent/tutorial/08-the-verification-gate.md +333 -0
- package/tutorial/full-guardrails-agent/tutorial/09-people-and-endings.md +313 -0
- package/tutorial/full-guardrails-agent/tutorial/10-testing-and-running.md +387 -0
- package/tutorial/full-guardrails-agent/tutorial/README.md +106 -0
- package/tutorial/full-guardrails-agent/tutorial/appendix-complete-code.md +2207 -0
- package/tutorial/full-guardrails-agent/tutorial/appendix-deployment.md +191 -0
- package/tutorial/full-guardrails-agent/tutorial/appendix-technique-map.md +117 -0
- package/tutorial/full-guardrails-agent/workflow.ts +219 -0
- package/tutorial/multi_agents/README.md +175 -0
- package/tutorial/multi_agents/advanced_agent.ts +395 -0
- package/tutorial/multi_agents/extending_agents.ts +641 -0
- package/tutorial/multi_agents/knowledge.ts +59 -0
- package/tutorial/multi_agents/lesson1_first_agent.md +368 -0
- package/tutorial/multi_agents/lesson2_knowledge_bases.md +404 -0
- package/tutorial/multi_agents/lesson3_multi_agent_systems.md +621 -0
- package/tutorial/multi_agents/lesson4_advanced_features.md +805 -0
- package/tutorial/multi_agents/lesson5_extending_agents.md +856 -0
- package/tutorial/multi_agents/pc_builder.ts +529 -0
- package/tutorial/multi_agents/sales_agent.ts +88 -0
- package/tutorial/multi_agents/sales_agent_with_search.ts +116 -0
- package/tutorial/multi_agents/sales_knowledge.md +139 -0
- package/tutorial/multi_agents/support_knowledge.md +256 -0
- package/dist/cli/mock-data.d.ts +0 -37
- package/dist/cli/mock-data.js +0 -80
- package/dist/cli/mock-data.js.map +0 -1
- package/dist/generateVerbTypes.d.ts +0 -11
- package/dist/generateVerbTypes.js +0 -265
- package/dist/generateVerbTypes.js.map +0 -1
- package/dist/rest/namespaces/compat.d.ts +0 -585
- package/dist/rest/namespaces/compat.js +0 -735
- package/dist/rest/namespaces/compat.js.map +0 -1
|
@@ -0,0 +1,301 @@
|
|
|
1
|
+
# Programmatically Governed Inference
|
|
2
|
+
|
|
3
|
+
Programmatically Governed Inference (PGI), also called System-Directed AI, is an architectural discipline. All authority over state, decisions, and side effects lives in deterministic software. The AI model does only what it is good at: understanding natural language, interpreting intent, calling the right tools at the right time, and communicating results. The model participates in the interaction but does not control it. The software was always in charge.
|
|
4
|
+
|
|
5
|
+
This document describes the discipline. Its examples use the TypeScript SDK (`@signalwire/sdk`). The [PGI implementation guide](pgi_agent_guide.md) turns the discipline into rules, recipes and a tested reference implementation.
|
|
6
|
+
|
|
7
|
+
## The observation
|
|
8
|
+
|
|
9
|
+
Current AI models are good at language. They understand loosely phrased human input, map intent onto structured actions, and render system decisions back into natural, conversational speech. They are the best interface layer ever built for bridging the gap between how humans communicate and how software operates.
|
|
10
|
+
|
|
11
|
+
They are also inconsistent, non-deterministic, and prone to confident error. They hallucinate facts, invent outcomes, drift from instructions, and make promises that no system behind them can keep. These are not bugs that will be fixed in the next model generation. They are properties of probabilistic inference itself. A system that predicts the most likely next token will sometimes predict wrong. It does so with the same fluency and confidence as when it predicts right.
|
|
12
|
+
|
|
13
|
+
The industry's dominant response has been to prompt harder and hope. Give the model detailed instructions. Tell it what not to do. Add retrieval-augmented generation for grounding. Add output filtering. Add human review. This methodology, known as prompt and pray, treats the model as the brain of the system. Everything else is a safety net beneath it.
|
|
14
|
+
|
|
15
|
+
The results are predictable. During the early development of SignalWire's AI platform, experiments with AI ordering systems showed a pattern. Models would occasionally decide, unprompted, that certain menu items were sold out. Not because of any inventory signal. Because the model inferred it. The system did not crash. It did not say anything offensive. It confidently lied about availability. Unless someone was watching closely, it would have gone unnoticed. This is the insidious failure mode of prompt and pray: not catastrophic breakdown, but quiet, confident fabrication that erodes trust without announcing itself.
|
|
16
|
+
|
|
17
|
+
The deeper problem surfaces as complexity increases. Show a model every tool it might need (find a restaurant, book a table, order food, process payment, handle complaints), and it will misuse them. It will call the wrong tool at the wrong time or combine tools in ways no one intended. It will invoke capabilities that do not belong in the current phase of the interaction. This is not a training problem. It is a surface area problem. The more authority you give the model, the more ways it can go wrong.
|
|
18
|
+
|
|
19
|
+
You could wait for models to become perfect. You could wait the way we wait for fully autonomous vehicles to navigate every road without error. That wait may be permanent, because the problem is not insufficient intelligence. It is the nature of probabilistic systems. They are approximate by design. A system that is right 99% of the time is wrong at scale, and in production, wrong at scale means real consequences for real people.
|
|
20
|
+
|
|
21
|
+
Programmatically Governed Inference starts from a different premise. Instead of giving the model authority and trying to contain the damage, PGI assumes the model should never have authority in the first place. The model is not the brain. It is not the locus of control. It is not the source of truth. It is a controlled participant inside a larger, deterministic system that was always in charge.
|
|
22
|
+
|
|
23
|
+
## The principle
|
|
24
|
+
|
|
25
|
+
The core of PGI is a single design rule: do not tell the AI anything it does not need to know.
|
|
26
|
+
|
|
27
|
+
Do not show it tools that do not belong to the current phase. Do not give it data it should not reason about. Do not explain the full system to it. Do not trust it with decisions that software can make deterministically. Reduce the model's surface area until it has three responsibilities: understanding what the human said, deciding what information to collect, and calling the tools available now. Everything else is software.
|
|
28
|
+
|
|
29
|
+
This produces a property that sets PGI apart from guardrails, output filtering, and other containment strategies. The model does not know it is being governed. It does not know that other tools exist elsewhere in the system. It does not know that a state machine is managing the interaction. It does not know that its context is being curated by the platform underneath it. It sees its current world (a prompt, a set of functions, a conversation history) and operates within it. There is nothing to reason around, nothing to game, nothing to circumvent, because the model has no awareness that anything exists beyond what it can see.
|
|
30
|
+
|
|
31
|
+
This is not achieved through prompt discipline or hope. It is enforced mechanically. The platform presents the model with only what it should see at each moment. When the moment changes, the platform changes what the model sees. The model experiences each phase of the interaction as its entire reality, unaware of the phases that came before or the phases that will come after.
|
|
32
|
+
|
|
33
|
+
This is not input validation. Input validation is what any backend does: clamp a quantity, reject a bad email, enforce a range. PGI is something deeper. It is authoring what the model believes to be true. Each step constructs the model's perceptual reality from scratch: the prompt it reads, the tools it can call, the data it can reason about. Meanwhile, authoritative state travels through `global_data`, a structured session record the model doesn't see unless the application puts a value in front of it. Account references, risk flags, verification results and workflow state flow between tool handlers, invisible to the model. They shape what happens next without the model knowing they exist.
|
|
34
|
+
|
|
35
|
+
The model listens, interprets, and speaks. It does not decide, it does not own state, and it does not know the full truth of the system. It operates on a carefully curated projection of reality, sufficient for it to perform its role, insufficient for it to act outside its bounds.
|
|
36
|
+
|
|
37
|
+
Most models are trained into an actor's frame: they behave as though performing a role. That makes the developer a set designer rather than a director. Handing the model the entire play and asking it to perform every scene in one pass exceeds what it can hold. Telling it which scene it is in, giving it the props that scene requires, and letting it play the part does not. When the scene ends, the program clears the stage, sets the next one, and places the right actor. The model performs. The software decides what is on the stage.
|
|
38
|
+
|
|
39
|
+
## Why this matters now
|
|
40
|
+
|
|
41
|
+
AI is moving into production across contact centers, enterprise communications, healthcare, financial services, and customer-facing applications, through both voice and text interfaces. The stakes are no longer demo-quality. An AI agent that handles real interactions must be correct about pricing, compliant with regulations, accurate about account state, and reliable under adversarial input. It must not hallucinate policy, invent transactions, leak sensitive data, or make commitments the business cannot honor.
|
|
42
|
+
|
|
43
|
+
Prompt and pray produces diminishing returns at production scale. Each additional layer of defense reduces the failure rate but never eliminates it, because the model retains authority. It can still reason its way around instructions, misinterpret retrieved context, or generate confident errors that pass through output filters.
|
|
44
|
+
|
|
45
|
+
The deployment process converts that residual risk into lost capability. Nothing customer-facing ships without a risk review, and risk reviews demand guarantees. When the model's behavior is the only control surface, the only available guarantee is removal: fewer tools, closed questions, scripted intents, hard refusals. The models running in production are more capable than anything their deployments are permitted to do, and the gap widens with every model release. The visible result is an agent that answers a bank's phone line with a menu. It says "I cannot help with that," and it is stripped until it becomes an IVR with better diction. The market then draws the wrong conclusion: that AI is not ready for production. The accurate conclusion is narrower. Ungoverned AI is not approvable, and what survives approval is often not worth deploying.
|
|
46
|
+
|
|
47
|
+
The fallback costs more than the failure. Once the agent is stripped back to a recording, the work returns to a person reading answers off a screen. That is the job the IVR was built to remove. Putting people back on that task is dragging rocks up a hill with a rope. It works, and it is the wrong use of the labor.
|
|
48
|
+
|
|
49
|
+
PGI eliminates entire categories of failure outright. If the model never sees payment data, it cannot leak it. If a function is not in its schema, a request for it has nothing to run. If a transition is not offered, it cannot take it. Unauthorized actions by the model, leaks of data it never received, and state corruption through the model stop being risks to mitigate and become structural impossibilities. Correctness of every consequential action is a property of the software, not a hope about the model.
|
|
50
|
+
|
|
51
|
+
One channel remains: speech. A model with no authority over pricing cannot charge the wrong amount. It can still say a wrong number, as the ordering system spoke confidently about inventory it had no signal for. PGI narrows this channel rather than eliminating it. The facts the model has are the projections its tools hand it: authoritative results it reports, not beliefs it generates. The curated context leaves far less room to fabricate. The consequential surface is eliminated. The conversational surface is contained.
|
|
52
|
+
|
|
53
|
+
The strongest test of a PGI system is to replace the model with a rigid, scripted menu ("press 1 for tacos, press 2 for drinks"). The system would still produce correct outcomes. The tool handlers would still validate input, enforce business rules, clamp absurd quantities, and manage state. The experience would be worse, because the natural language interface is what makes the interaction feel human. But every order would be accurate, every payment would process correctly, and every transition would follow the rules. The model makes the interaction natural. The software makes it correct. In a PGI system, those are independent properties.
|
|
54
|
+
|
|
55
|
+
That independence also lets the model change without changing the rules. Correctness lives in the handlers and the step definitions, so a team can upgrade or replace the model and the same business rules still apply. The change still needs testing, because another model can phrase answers and choose tools differently. It doesn't reopen the question of what the agent is allowed to do.
|
|
56
|
+
|
|
57
|
+
## The mechanism
|
|
58
|
+
|
|
59
|
+
PGI is enforced through four layers of constraint, each operating independently. The model must comply with all four simultaneously. Only the first layer depends on the model's cooperation. The remaining three are mechanical.
|
|
60
|
+
|
|
61
|
+
### Layer 1: Semantic guidance
|
|
62
|
+
|
|
63
|
+
The model receives a prompt that describes its role, the current phase of the interaction, and instructions for how to behave. These are conventional prompt instructions: what to say, what not to say, what tone to use, when to ask clarifying questions.
|
|
64
|
+
|
|
65
|
+
Semantic guidance is the weakest layer. It depends on the model's compliance, which is probabilistic. A well-crafted prompt improves behavior but cannot guarantee it. PGI treats this layer as guidance, not enforcement. It is the suggestion. The remaining layers are the law.
|
|
66
|
+
|
|
67
|
+
The weakness of this layer can be partially offset through strategic reinforcement. A model may drift from a single system prompt over a long conversation. Critical instructions can be reinjected at points in the context where they matter most. Step instructions work this way: the platform injects the current step's instructions as a system message on every turn. This does not make semantic guidance mechanical, but it makes it more durable than a static prompt alone.
|
|
68
|
+
|
|
69
|
+
### Layer 2: Schema scope
|
|
70
|
+
|
|
71
|
+
At each step in a conversation, the model sees only the tools that are explicitly listed for that step. Tools that belong to other steps do not exist in the model's function schema. The model cannot call them, reference them, or reason about them, because they are not presented to it. A model can still produce the name of a tool it wasn't given. The protection is that the tool isn't active in this step, so the request has nothing to run.
|
|
72
|
+
|
|
73
|
+
This is why surface area matters. A model that sees ten tools will misuse them in ways a model that sees two will not. The failure mode is not malice or stupidity. It is probability. Given enough tools, the model will eventually find a plausible reason to call the wrong one. Schema scope eliminates this by reducing the model's options to only what is appropriate right now.
|
|
74
|
+
|
|
75
|
+
In a blackjack game, the betting step exposes only `place_bet`. The model cannot deal cards, draw cards, or resolve hands during betting because those functions are not in its schema. When the tool handler transitions the conversation to the playing step, the schema changes: `place_bet` disappears and `hit`, `stand`, and `double_down` appear. The model's capabilities change not because it was told to behave differently, but because the available operations were mechanically replaced.
|
|
76
|
+
|
|
77
|
+
The steps are defined in a context. This fragment sets each step's tools and allowed transitions:
|
|
78
|
+
|
|
79
|
+
```typescript
|
|
80
|
+
import { AgentBase } from '@signalwire/sdk';
|
|
81
|
+
|
|
82
|
+
const agent = new AgentBase({ name: 'blackjack' });
|
|
83
|
+
const ctx = agent.defineContexts().addContext('default');
|
|
84
|
+
// Each step also needs its instructions (setText), and the hand_complete
|
|
85
|
+
// step is defined the same way; both are omitted here.
|
|
86
|
+
|
|
87
|
+
const betting = ctx.addStep('betting');
|
|
88
|
+
betting.setFunctions(['place_bet']);
|
|
89
|
+
betting.setValidSteps(['playing']);
|
|
90
|
+
|
|
91
|
+
const playing = ctx.addStep('playing');
|
|
92
|
+
playing.setFunctions(['hit', 'stand', 'double_down']);
|
|
93
|
+
playing.setValidSteps(['hand_complete']);
|
|
94
|
+
|
|
95
|
+
const lost = ctx.addStep('you_lost');
|
|
96
|
+
lost.setFunctions([]);
|
|
97
|
+
lost.setValidSteps([]);
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
A step that doesn't list its tools inherits the previous step's set, so a governed step always sets its list, even when the list is empty.
|
|
101
|
+
|
|
102
|
+
This is the difference between telling someone not to open a door and removing the door from the building. Schema scope does not rely on the model's judgment or compliance. It alters the environment the model operates in.
|
|
103
|
+
|
|
104
|
+
### Layer 3: Transition scope
|
|
105
|
+
|
|
106
|
+
Each step in a conversation declares which steps the model may move to next. The enforcement is mechanical and lives in the schema, not in the model's judgment. On every turn, the platform rewrites the argument schema of the model's transition tool, `next_step`, so that only whitelisted step names exist as options. The model cannot request a transition to a step that is not on the list. The reason is the same as for a tool that is not in its schema: the option is not part of its world. An empty whitelist leaves the model no step it can request.
|
|
107
|
+
|
|
108
|
+
The whitelist constrains the model, not the software. Tool handlers, which are the developer's deterministic code, retain full transition authority. They can move the conversation to any step in the current context, or to another context, as the business logic requires. This is the authority inversion applied to control flow. The model can only request movements the system pre-approved, while the software that owns the state machine moves the conversation wherever the rules say. In the blackjack example, `playing` whitelists only `hand_complete`, so the model can't talk its way anywhere else. The `hit` handler, on detecting a bust, moves the conversation straight to `you_lost` with `swmlChangeStep()`. The software is the authority, and the whitelist was never a constraint on it.
|
|
109
|
+
|
|
110
|
+
The model cannot skip phases, loop back to completed steps, or jump ahead, because those requests are not expressible. PGI allows this to operate at different levels of strictness. In the simplest case, the model knows it is in a named step and receives criteria for when to request the next one. In more advanced usage, the model does not know transitions are possible at all. Tool handlers change the step silently, and the model finds itself in a new context with new instructions and new tools. It did not request the change. It did not know it could.
|
|
111
|
+
|
|
112
|
+
At maximum strictness, a step has no valid transitions and no tools. Consider the `you_lost` step in the [Layer 2 example](#layer-2-schema-scope): zero functions, zero valid transitions. The game is over. A user can beg, negotiate, or attempt to social-engineer the AI into continuing. None of it works, because the mechanism for continuing does not exist. With no transition options there is nothing to request. With no tools, no handler is left that could move the state. There is nothing for the model to comply with or resist. The interaction is structurally complete.
|
|
113
|
+
|
|
114
|
+
### Layer 4: Execution authority
|
|
115
|
+
|
|
116
|
+
This is the most important layer. When the model calls a tool, it is not issuing a command. It is making a request that is handled by ordinary software. The tool handler receives the request, accesses authoritative state, and applies business logic. It returns a structured result with two parts: a response the model uses to answer, and actions for the platform to execute.
|
|
117
|
+
|
|
118
|
+
This handler draws a card, reports the new total, and ends the hand on a bust:
|
|
119
|
+
|
|
120
|
+
```typescript
|
|
121
|
+
import { AgentBase, FunctionResult } from '@signalwire/sdk';
|
|
122
|
+
|
|
123
|
+
interface GameState {
|
|
124
|
+
deck: string[];
|
|
125
|
+
player_hand: string[];
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
// Application code: scoring and card names.
|
|
129
|
+
declare function calculateHand(hand: string[]): number;
|
|
130
|
+
declare function formatCard(card: string): string;
|
|
131
|
+
|
|
132
|
+
const agent = new AgentBase({ name: 'blackjack' });
|
|
133
|
+
|
|
134
|
+
agent.defineTool({
|
|
135
|
+
name: 'hit',
|
|
136
|
+
description: 'Draw another card for the player',
|
|
137
|
+
parameters: {},
|
|
138
|
+
handler: (_args, rawData) => {
|
|
139
|
+
const game = rawData.global_data?.['game_state'] as GameState;
|
|
140
|
+
const card = game.deck.pop() as string;
|
|
141
|
+
game.player_hand.push(card);
|
|
142
|
+
const score = calculateHand(game.player_hand);
|
|
143
|
+
|
|
144
|
+
const result = new FunctionResult(`You drew ${formatCard(card)}. Your total is ${score}.`);
|
|
145
|
+
result.updateGlobalData({ game_state: game });
|
|
146
|
+
|
|
147
|
+
if (score > 21) {
|
|
148
|
+
result.swmlChangeStep('you_lost');
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
return result;
|
|
152
|
+
},
|
|
153
|
+
});
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
The model does not execute actions. The platform does. The model does not update state. The tool handler does. The model does not decide what happens next. In the preceding example, the model has no idea it is about to be moved to the `you_lost` step. It receives the result as context and answers from it. The platform changes the step. The model's world changes without its participation.
|
|
157
|
+
|
|
158
|
+
The same pattern scales to business workflows. Consider a billing agent where a customer calls to dispute a charge. During the `verify_identity` step, the model knows the customer's name and has one tool: `verify_account`. It does not know the account balance, credit history, or dispute tools exist. Once identity is verified, the tool handler silently transitions to `review_charges`, expanding the model's reality to include recent transactions and a `file_dispute` tool. The model experiences this as its whole world. It has no memory of the prior step's constraints and no awareness that `global_data` is carrying account details, risk flags, and the verification result underneath.
|
|
159
|
+
|
|
160
|
+
This handler decides whether the dispute resolves automatically or goes to a specialist:
|
|
161
|
+
|
|
162
|
+
```typescript
|
|
163
|
+
import { FunctionResult, type SwaigRequest } from '@signalwire/sdk';
|
|
164
|
+
|
|
165
|
+
interface Account {
|
|
166
|
+
id: string;
|
|
167
|
+
auto_resolve_limit: number;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
interface RiskFlags {
|
|
171
|
+
auto_resolve_eligible: boolean;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
// Application code: the billing system of record reverses the charge.
|
|
175
|
+
declare function reverseCharge(accountId: string, amount: number): Promise<void>;
|
|
176
|
+
|
|
177
|
+
export async function handleDispute(
|
|
178
|
+
args: { disputed_amount: number },
|
|
179
|
+
rawData: SwaigRequest,
|
|
180
|
+
): Promise<FunctionResult> {
|
|
181
|
+
const account = rawData.global_data?.['account'] as Account;
|
|
182
|
+
const risk = rawData.global_data?.['risk_flags'] as RiskFlags;
|
|
183
|
+
const amount = args.disputed_amount;
|
|
184
|
+
|
|
185
|
+
if (risk.auto_resolve_eligible && amount < account.auto_resolve_limit) {
|
|
186
|
+
await reverseCharge(account.id, amount);
|
|
187
|
+
return new FunctionResult(
|
|
188
|
+
`The charge of $${amount} has been reversed to the customer's account.`,
|
|
189
|
+
).swmlChangeStep('resolution_summary');
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
return new FunctionResult(
|
|
193
|
+
'The dispute needs a specialist review. Tell the customer you are connecting them with a specialist.',
|
|
194
|
+
).swmlChangeStep('escalation');
|
|
195
|
+
}
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
The model requested the dispute. The tool handler read the account details and risk flags from `global_data` and applied business logic the model cannot see. It then moved the conversation to an auto-resolution or an escalation step. On the auto-resolution path, the billing system committed the reversal before the model received the result. The model does not know which path was available, what thresholds governed the decision, or that `global_data` exists at all. It answers from the result. The platform reshapes its world.
|
|
199
|
+
|
|
200
|
+
This inversion of authority is the core of PGI. In conventional systems, the model calls tools to accomplish its goals. In PGI, the model calls tools to report human intent, and the tools accomplish the system's goals. The model is an input layer, not a decision-maker.
|
|
201
|
+
|
|
202
|
+
Not all tool calls need to reach the developer's server. The platform itself handles certain operations: step transitions, context updates, and governance decisions that are invisible to the model. When the conversation's step changes, the platform updates the model's prompt and available tools without the developer writing explicit handlers for that transition. The step definitions are the instructions. The platform carries them out. The developer defines what should happen. The platform ensures it does.
|
|
203
|
+
|
|
204
|
+
## Data isolation
|
|
205
|
+
|
|
206
|
+
PGI extends to how data flows through the system. The model operates on a projection of reality, not the full truth. The mechanism that makes this possible is `global_data`: a structured record that travels between tool handlers and carries authoritative state. It stays out of the model's context unless the application projects a value into it.
|
|
207
|
+
|
|
208
|
+
Consider the billing agent from the previous section. When a customer calls to dispute a charge, `global_data` carries the account details, risk flags, auto-resolve thresholds, and verification result from the moment identity is verified. The model never sees any of it. During `verify_identity`, the model knows the customer's name and nothing else. During `review_charges`, the model sees recent transactions, a curated projection. It doesn't see the risk score, the credit limit, or the internal flags that decide whether a dispute is auto-resolved or escalated. The tool handler reads `global_data`, applies business logic, and returns only the facts the model needs to answer. The model cannot promise a credit it does not know exists. It cannot negotiate a threshold it has never seen. It reports what the system gives it to report.
|
|
209
|
+
|
|
210
|
+
This pattern recurs everywhere PGI is applied. In a blackjack game, the model knows the player's chip count and visible cards. It does not know the deck composition, the dealer's hidden card, or the internal scoring calculations. In an ordering system, the model knows which items have been added. It does not know the internal pricing logic, tax calculations, or inventory state. In every case, `global_data` carries the authoritative record and the model sees only what is safe and necessary for conversational coherence.
|
|
211
|
+
|
|
212
|
+
Hidden from the model isn't the same as secret. The platform sends `global_data` with every tool request, and the call-end payload includes it. A step's text can also pull a value into the prompt with `${...}` expansion. Keep credentials out of it, and prefer references to records your backend holds. `global_data` lasts for the session, so durable truth, such as a reversed charge, belongs in your system of record.
|
|
213
|
+
|
|
214
|
+
Sensitive operations are handled entirely outside the model's awareness. When a user needs to provide payment information, a tool handler returns a payment action (the `pay()` method of `FunctionResult`). The platform collects the card details on the phone keypad and sends them to the payment connector the application configures, which processes the charge. The model does not hear the card number, does not process it, does not retain it. It receives only the outcome, such as the payment status, and reports it as fact.
|
|
215
|
+
|
|
216
|
+
All four PGI layers converge in this single flow. The model can only call the payment tool when the conversation reaches the payment step (schema scope). The tool handler hands collection to the platform's payment flow rather than taking card details itself (execution authority). The card number, CVV, and billing details never enter the model's context (data isolation). And when processing completes, the conversation transitions to a post-payment step where the payment tool is no longer available (transition scope). The user experiences a seamless interaction in the same voice. The model was never exposed to anything sensitive. Each layer contributed independently, and the result is a payment flow that keeps the model out of the sensitive path by construction.
|
|
217
|
+
|
|
218
|
+
Data isolation also enables capabilities that model-centric architectures cannot achieve. When the platform owns data flow independently of the model, it can route information to destinations the model is unaware of. In a system with a visual interface, tool handlers can send structured events directly to a connected browser or application with `swmlUserEvent()`. These events update an order display, reveal cards on a table, or render content that would be impractical to communicate by voice alone. The model does not trigger these updates. The model does not know they happen.
|
|
219
|
+
|
|
220
|
+
The platform coordinates voice, visual, and data channels independently, each governed separately, producing experiences that are richer than what any single channel could deliver. This is not a workaround for the model's limitations. It is a capability that exists precisely because PGI separates the model from the system's broader behavior.
|
|
221
|
+
|
|
222
|
+
## What PGI produces
|
|
223
|
+
|
|
224
|
+
The result is something that neither pure software nor pure AI could produce alone.
|
|
225
|
+
|
|
226
|
+
Pure software is rigid. An IVR or scripted chat system can process structured input, enforce business rules, and guarantee correctness. But it cannot absorb the ambiguity of human communication. It cannot handle "give me two of those tacos and a water". Nor can it handle "actually, make that three, and throw in some chips". It forces the human to conform to the system.
|
|
227
|
+
|
|
228
|
+
Pure AI is fluid but unreliable. A model that handles ordering can understand any phrasing, manage conversational flow, and make the interaction feel natural. But it will occasionally invent facts, miscalculate totals, or make promises the backend cannot honor. It forces the system to hope the model behaves.
|
|
229
|
+
|
|
230
|
+
PGI combines them into something new. The AI provides flexibility at the edges: absorbing ambiguity, handling variation, maintaining conversational coherence. The software provides certainty at the core: enforcing rules, maintaining accurate state, ensuring every consequential action is correct. The tension between them is not a flaw but the design.
|
|
231
|
+
|
|
232
|
+
The deployment consequence follows directly. Because risk is bounded by architecture rather than behavior, capability no longer has to be traded away to pass review. A governed agent ships with retrieval over the full knowledge base and answers open questions in free form. The model can inform the caller, but it cannot act on its own inventions: acting requires the code gate. Consequential tools (payments, account changes, scheduling, transfers) become grantable. Every invocation is validated deterministically, and the sensitive data involved never enters the model's context. Two claims stay distinct here. That the agent cannot act outside its rails is an architectural guarantee. Grounded answering from the business's data improves answer quality, but it isn't a guarantee about every sentence the model produces. The net effect inverts the industry's trade. Everywhere else, safety is purchased by making the agent do less. Under PGI, the same review passes with the capability intact. The governed agent is not the restricted version of the capable agent. It is the only version of the capable agent that reaches production.
|
|
233
|
+
|
|
234
|
+
This combination creates a new class of interactive applications. Applications where a person communicates naturally and the system responds conversationally, but every action underneath is deterministic, auditable, and correct. Applications where the AI is the voice of the system, not the mind of it. Applications that feel like talking to an intelligent agent but behave like well-tested software. This class of application could not be built reliably before. The two required components, natural language understanding and deterministic execution, were never integrated with a clear, enforced boundary between them. PGI is that boundary.
|
|
235
|
+
|
|
236
|
+
## Building with PGI
|
|
237
|
+
|
|
238
|
+
PGI is not only an architectural pattern for platform engineers. It is a methodology for every developer building AI-powered applications.
|
|
239
|
+
|
|
240
|
+
The current industry narrative tells developers that AI has changed everything. That the future belongs to prompt engineers who can coax the right behavior out of a language model. That building an AI application means writing a detailed system message and iterating until the model mostly does what you want. This narrative has produced a generation of applications that are impressive in demos and unreliable in production, because prompting a model is not programming. It is negotiation.
|
|
241
|
+
|
|
242
|
+
PGI restores programming to the equation. In PGI, the developer's traditional skills make an AI application safe and useful: defining state machines, writing business logic, managing data, and enforcing rules in code. The model handles language. The developer handles everything else. Tool handlers are ordinary functions. State transitions are declared in configuration, not hoped for in prompts. Business rules are enforced in code, not in natural language instructions the model might ignore.
|
|
243
|
+
|
|
244
|
+
A developer building an intake system writes a gather sequence. The platform presents the model with one question at a time and a single submission tool, `gather_submit`. The tool's schema is rebuilt for each question, with that answer's type and, when the question asks for it, a required confirmation. The model does not know how many questions remain or what the full form looks like. When an answer arrives, the platform stores it in `global_data` and silently advances to the next question. When the sequence is complete, the accumulated structured data is handed off to the next phase of the workflow. There, a handler validates the whole record before anything consequential uses it. The model never saw the form. It never had the opportunity to skip ahead, reorder questions, or submit answers to questions that were never asked.
|
|
245
|
+
|
|
246
|
+
Visibility of what came before is itself a dial the developer controls. By default, each new phase withdraws the prior phase's instructions from the model's context while the conversation itself remains visible. At stricter settings, the platform pulls the earlier dialogue out entirely, or hides the answers already collected so the model must ask rather than infer. A hidden phase can also be brought back on purpose. The platform can hand the model a summary of an earlier phase instead of the raw transcript. The summary is one more curated projection in place of the full truth. Reality authoring extends to the past, not only the present. In the SDK, these settings are `setHistory()` on a step or context (`keep`, `default` or `hide`) and the `isolated` option of `setGatherInfo()` and `addGatherQuestion()`. A `${step_history.*}` reference in a step's text chooses what comes back. The call log keeps every message either way.
|
|
247
|
+
|
|
248
|
+
This is not the same as ordinary backend validation (clamping a quantity with `if (quantity > 20) quantity = 20;`, or rejecting a bad input). Those are single lines of defensive code any backend performs. The gather sequence is reality authoring. The developer constructs what the model believes to be true at each moment, and `global_data` carries the accumulated truth the model never sees.
|
|
249
|
+
|
|
250
|
+
PGI reduces the developer's working surface to business logic. The platform handles governance: managing steps, enforcing schema scope, validating transitions, isolating data, executing platform actions. The developer defines what the application does at each phase and writes the tool handlers that implement domain logic. The platform keeps the model within those bounds. Developers spend their time on what differentiates their application, not on trying to constrain a language model through increasingly elaborate instructions.
|
|
251
|
+
|
|
252
|
+
PGI is not all-or-nothing. A developer can start simple, with a single step and a few tools, and progressively adopt stricter patterns as their application demands it. A casual FAQ agent might use basic PGI with one step and a handful of tools. A payment flow might use maximum PGI with strict transitions, data isolation, and no-exit steps. The discipline scales with the risk profile.
|
|
253
|
+
|
|
254
|
+
This is a deliberate design choice. PGI was not conceived as a proprietary technique to be deployed internally and sold as a finished product. It was developed as a set of principles, simplified through platform design, that any developer can employ in their own applications. The tools that enforce PGI are primitives every developer on the infrastructure can use. They are step definitions, scoped tool lists, structured tool results, platform actions, and state isolation. The goal is not to gate a methodology behind a product. It is to give developers the means to build AI applications that work in production, using skills they already have. The foundation handles the hard problems they should not have to solve from scratch.
|
|
255
|
+
|
|
256
|
+
## What PGI is not
|
|
257
|
+
|
|
258
|
+
**PGI is not prompt and pray.** The dominant methodology in AI development treats the model as the system and the prompt as the program. Write a detailed enough system message, the thinking goes, and the model will do what you need. PGI rejects this entirely. Prompts are the weakest layer of constraint, useful for guidance but unreliable as enforcement. PGI's correctness survives the total failure of every prompt instruction, because the remaining three layers are mechanical.
|
|
259
|
+
|
|
260
|
+
**PGI is not guardrails.** Guardrails assume the model has authority and attempt to intercept the damage after the fact. They are reactive: catch bad outputs, filter harmful content, flag anomalous behavior. PGI is structural: the model never has authority in the first place. There is nothing to intercept because there is nothing to catch. The system is correct by construction, not by interception. Guardrails also pay for safety with capability, because every filter narrows what the agent may do; PGI spends architecture instead.
|
|
261
|
+
|
|
262
|
+
**PGI is not human-in-the-loop.** There is no human gating decisions in real time. The authority is software, not people. A human designed the state machine, wrote the business rules, and defined the tool handlers. But at runtime, the system operates autonomously. The governance is programmatic, built into the architecture, not applied by a human reviewing each interaction.
|
|
263
|
+
|
|
264
|
+
**PGI is not "dumb AI."** The model's capabilities are fully utilized: natural language understanding, intent recognition, conversational fluency, handling ambiguity, managing dialogue across turns. These are difficult problems that the model solves well. PGI does not diminish the model. It focuses the model on what it is good at and removes it from what it is bad at. The model is not wasted. It is deployed where it creates the most value with the least risk.
|
|
265
|
+
|
|
266
|
+
## PGI and Programmable Unified Communications
|
|
267
|
+
|
|
268
|
+
PGI is a set of design principles. Programmable Unified Communications (PUC) is the platform architecture that makes those principles mechanically enforceable.
|
|
269
|
+
|
|
270
|
+
A PUC platform owns the interaction: its state, its lifecycle, and its outcomes. When AI operates inside a PUC platform, every property of the platform applies to the AI's behavior. The AI inherits the state machine's constraints. It inherits the tool system's mediation. It inherits the data isolation model's projections. The AI does not need its own governance framework because it is governed by the same infrastructure that governs the interaction itself.
|
|
271
|
+
|
|
272
|
+
This is why PGI requires specific infrastructure to implement. A platform that separates call control from application logic (the webhook model) can approximate pieces of PGI in middleware. It can build its own step machine, scoped tool lists and server-side checks. What it cannot do is bind that governance to the interaction, because the constraints and the call live in different systems. The platform recognizes no step, and no state machine governs the interaction's lifecycle apart from the middleware's. A tool handler has no way to return actions that the same system runs against the call. Every enforcement becomes a message between systems, with its own latency and failure modes. Nothing guarantees that the model's tools, the conversation state, and the call change together.
|
|
273
|
+
|
|
274
|
+
PGI requires the AI and the interaction platform to be the same layer. The instruction language for the AI and for the interaction must be the same. Then one tool result can update the model's context, change the conversation's step, and route the interaction. This unification is what makes PGI governance mechanical rather than aspirational.
|
|
275
|
+
|
|
276
|
+
A tool result can say "tell the player they busted, update the chip count, and change to the you_lost step." All three instructions arrive together. The platform that runs the call carries them out. The model reports the result. The state updates. The step transitions. The available tools change. This happens as one coordinated response because the platform orchestrates both the AI and the interaction. Where the AI is bolted onto interaction control through webhooks, these are three separate operations. Each has its own failure modes and race conditions, and nothing keeps them consistent. One result coordinates the platform's own instructions. It doesn't make an external system, such as a billing database, part of the same transaction.
|
|
277
|
+
|
|
278
|
+
PUC provides the speed and agility to build sophisticated interactive applications rapidly. PGI provides the discipline that makes those applications safe, consistent, and trustworthy. They are complementary commitments. PUC without PGI produces applications that ship fast but behave unpredictably. PGI without PUC produces sound principles with no platform to enforce them. Together, they give developers the foundation to build applications that ship quickly and behave correctly from the first deployment.
|
|
279
|
+
|
|
280
|
+
## The broader implication
|
|
281
|
+
|
|
282
|
+
PGI rejects the idea that intelligence must be centralized inside the model. Instead, it treats intelligence as something distributed: rules and guarantees in software, language and interpretation in the model, and a clear, enforced boundary between the two.
|
|
283
|
+
|
|
284
|
+
This distribution is not a compromise. It is an optimization. Software is better at rules, state, compliance, and enforcement than any language model will be, because software is deterministic and verifiable. Language models are better than any scripted system at understanding human communication, managing conversational flow, and rendering structured data as dialogue. Models are probabilistic and adaptive. PGI assigns each component the task it is best suited for and enforces the boundary between them so that neither overreaches.
|
|
285
|
+
|
|
286
|
+
PGI is not limited to voice. The same principles apply wherever a model interacts with users: chat interfaces, multimodal applications, or any future modality. The model's role (understand the human, call the right tools, communicate the results) stays the same regardless of input modality. The platform's role (manage state, enforce constraints, execute actions, isolate data) is equally unchanged. The transport changes. The governance does not.
|
|
287
|
+
|
|
288
|
+
The economic implication is significant. Businesses navigating the AI transition face a concrete challenge: ship AI-powered products that work reliably in production, or watch competitors do it first. PGI provides a path to reliable AI without requiring every development team to solve the fundamental problems of AI governance from scratch. The principles are clear. The platform primitives that enforce them are available. Developers bring their domain expertise (the ordering logic, the compliance rules, the business workflow) and the infrastructure handles the rest.
|
|
289
|
+
|
|
290
|
+
This is not a proprietary methodology reserved for a single vendor's internal use. It is a set of principles made accessible through platform design to every developer who builds on the infrastructure. The goal has never been to centralize AI capability, to hoard a technique and sell its outputs. The goal is to distribute it: to give every development team the tools to build AI applications that are safe, consistent, and trustworthy. Developers use engineering skills they already possess, on a foundation that evolves underneath them and lifts their applications forward.
|
|
291
|
+
|
|
292
|
+
The result is a foundation for the next generation of interactive applications. Developers bring their domain expertise and engineering skills. The platform provides the governance infrastructure. The model provides the natural language interface. Each component does what it is best at, bounded by clear, enforced separations that none of them can cross. The model is never in charge, yet it is never wasted. The developer is never fighting the model, only building the system around it. And the applications that emerge are something new: conversational, adaptive, and trustworthy in systems where correctness is not optional.
|
|
293
|
+
|
|
294
|
+
## Related documentation
|
|
295
|
+
|
|
296
|
+
For more information, see these documents:
|
|
297
|
+
|
|
298
|
+
- [PGI implementation guide](pgi_agent_guide.md): rules, a capability index, recipes and a tested reference implementation for building PGI agents with this SDK
|
|
299
|
+
- [Developer pain points](developer_pain_points.md): the problems developers meet when building voice agents, the mechanism that addresses each, and what the application still owns
|
|
300
|
+
- [Contexts and steps guide](contexts-guide.md): steps, per-step tools, navigation, history modes and gather questions
|
|
301
|
+
- [SWAIG reference](swaig-reference.md): tool results, platform actions, and the data each tool request carries, including `global_data`
|