@polpo-ai/channels 0.15.64 → 0.15.65
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/README.md +30 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -214,6 +214,36 @@ const handleTurn = createConversationChannelTurnHandler(serverDeps, {
|
|
|
214
214
|
});
|
|
215
215
|
```
|
|
216
216
|
|
|
217
|
+
Applications that map provider users to their own identity can resolve that
|
|
218
|
+
identity before Polpo selects an agent, creates a Session, or calls a model:
|
|
219
|
+
|
|
220
|
+
```ts
|
|
221
|
+
const handleTurn = createConversationChannelTurnHandler(serverDeps, {
|
|
222
|
+
agent: (turn) => resolveAgentForInstallation(turn.installationId),
|
|
223
|
+
resolveInvocation: async (turn) => {
|
|
224
|
+
const resolution = await resolveApplicationIdentity(turn);
|
|
225
|
+
if (resolution.kind === "pairing") {
|
|
226
|
+
return { disposition: "consume", reply: resolution.reply };
|
|
227
|
+
}
|
|
228
|
+
return {
|
|
229
|
+
disposition: "dispatch",
|
|
230
|
+
user: resolution.userId,
|
|
231
|
+
metadata: {
|
|
232
|
+
tenantId: resolution.tenantId,
|
|
233
|
+
siteId: resolution.siteId,
|
|
234
|
+
grant: resolution.grant,
|
|
235
|
+
},
|
|
236
|
+
};
|
|
237
|
+
},
|
|
238
|
+
});
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
`consume` returns directly to the provider and never enters model history.
|
|
242
|
+
`dispatch` supplies immutable trusted invocation identity to custom tools. The
|
|
243
|
+
resolver metadata is not copied into model-visible tool arguments or ordinary
|
|
244
|
+
Session metadata. A configured resolver must fail closed; do not fall back to
|
|
245
|
+
provider identity after resolver errors.
|
|
246
|
+
|
|
217
247
|
Chat SDK thread history is transport state. Polpo Sessions remain the canonical
|
|
218
248
|
conversation history used by the model.
|
|
219
249
|
|