@datalayer/agent-runtimes 1.3.39 → 1.3.40

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.
@@ -1100,6 +1100,12 @@ export default function ChatView({ workspace }) {
1100
1100
  // a new identity would resend the last suggestion.
1101
1101
  // eslint-disable-next-line react-hooks/exhaustive-deps
1102
1102
  }, [suggestion]);
1103
+ /*
1104
+ * An application's session checks who is calling (LOOP R-32, R-04): its
1105
+ * chat says so with the person's token. The embed hands its own.
1106
+ */
1107
+ const runsApp = Boolean(blueprintTurn?.createPayload?.app_spec);
1108
+ const iamToken = useIAMStore(state => state.token);
1103
1109
  const protocol = useMemo(() => inPage
1104
1110
  ? browserProtocolConfig({
1105
1111
  agentId: member?.specId ?? agentId,
@@ -1132,9 +1138,10 @@ export default function ChatView({ workspace }) {
1132
1138
  // (LOOP R-04): each thread a session, recorded under its uid,
1133
1139
  // run in the name the application runs in, and taking what the
1134
1140
  // page did besides the message — the same AG-UI events back.
1135
- endpoint: blueprintTurn?.createPayload?.app_spec
1141
+ endpoint: runsApp
1136
1142
  ? `${agentServerUrl}/api/v1/apps/agents/${encodeURIComponent(agentId)}/ag-ui/`
1137
1143
  : `${agentServerUrl}/api/v1/ag-ui/${agentId}/`,
1144
+ ...(runsApp && iamToken ? { authToken: iamToken } : {}),
1138
1145
  agentId,
1139
1146
  // `/api/v1/configure`, not `/api/v1/configure/config`: the hooks
1140
1147
  // strip one trailing `config`/`configure` segment to find the API
@@ -1152,6 +1159,8 @@ export default function ChatView({ workspace }) {
1152
1159
  blueprintTurn,
1153
1160
  activeModel,
1154
1161
  agentServerUrl,
1162
+ runsApp,
1163
+ iamToken,
1155
1164
  ]);
1156
1165
  /*
1157
1166
  * The model catalogue, and the builtin tools and skills the agent reports.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datalayer/agent-runtimes",
3
- "version": "1.3.39",
3
+ "version": "1.3.40",
4
4
  "type": "module",
5
5
  "workspaces": [
6
6
  ".",