@datalayer/agent-runtimes 1.5.114 → 1.5.118

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.
@@ -61,6 +61,11 @@ export interface PauseResumeResponse {
61
61
  success: boolean;
62
62
  message: string;
63
63
  checkpoint_id: string | null;
64
+ /**
65
+ * The new runtime a resume launched, for the same agent and user: a light
66
+ * pause is resumed as a launch, under a uid of its own. Absent on a pause.
67
+ */
68
+ runtime_uid?: string;
64
69
  }
65
70
  /**
66
71
  * Optional body for the pause endpoint.
@@ -398,6 +398,8 @@ function parsePap(data) {
398
398
  signedOut: flag(company.signed_out, true),
399
399
  signInDisabled: flag(company.sign_in_disabled, false),
400
400
  publishSkills: flag(company.publish_skills, false),
401
+ webUnscoped: flag(company.web_unscoped, false),
402
+ webDisabled: flag(company.web_disabled, false),
401
403
  interfaces: enumsOf(company.interfaces, PAP_INTERFACES, PAP_DEFAULT_INTERFACES),
402
404
  scopes: records(company.scopes).map(parsePapCompanyScope),
403
405
  excludedTasks: records(company.excluded_tasks).map(task => ({
@@ -510,6 +512,8 @@ function dumpPap(pap) {
510
512
  .value('signed_out', pap.company.signedOut, true)
511
513
  .value('sign_in_disabled', pap.company.signInDisabled, false)
512
514
  .value('publish_skills', pap.company.publishSkills, false)
515
+ .value('web_unscoped', pap.company.webUnscoped, false)
516
+ .value('web_disabled', pap.company.webDisabled, false)
513
517
  .list('interfaces', pap.company.interfaces, [...PAP_DEFAULT_INTERFACES])
514
518
  .list('scopes', pap.company.scopes.map(dumpPapCompanyScope))
515
519
  .list('excluded_tasks', pap.company.excludedTasks.map(dumpPapExcludedTask))
@@ -6,6 +6,8 @@ export type DatalayerVisitors = {
6
6
  app: string;
7
7
  /** ai-inference, which mints the visitor's token. */
8
8
  inferenceUrl: string;
9
+ /** The catalogue Battle the token is played for, when it is (B4-01). */
10
+ battle?: string;
9
11
  };
10
12
  /** A visitor's id: what ai-inference accepts (8 to 64 letters, digits or dashes). */
11
13
  export declare function isVisitorId(value: string | null | undefined): value is string;
@@ -18,13 +20,30 @@ export type VisitorToken = {
18
20
  /** Epoch milliseconds: the token's own lifetime from now. */
19
21
  renewAt: number;
20
22
  };
21
- /** The body ai-inference is asked with. */
22
- export declare function visitorTokenRequest(app: string, visitor: string): {
23
- app: string;
23
+ /** The body ai-inference is asked with: the application, the visitor once there is one, the Battle when it is played for one. */
24
+ export declare function visitorTokenRequest(app: string, visitor: string, battle?: string): {
25
+ app?: string;
24
26
  visitor?: string;
27
+ battle?: string;
25
28
  };
26
- /** Mint a visitor's token for an application; throws with ai-inference's sentence. */
27
- export declare function fetchVisitorToken(inferenceUrl: string, app: string, visitor?: string, fetcher?: typeof fetch): Promise<VisitorToken>;
29
+ /** Mint a visitor's token for an application — played for a Battle when `battle` names one; throws with ai-inference's sentence. */
30
+ export declare function fetchVisitorToken(inferenceUrl: string, app: string, visitor?: string, fetcher?: typeof fetch, battle?: string): Promise<VisitorToken>;
31
+ /** A Battle's token for the page's players: its own budget at ai-inference, for one play. */
32
+ export type BattleToken = {
33
+ token: string;
34
+ visitor: string;
35
+ /** Epoch milliseconds: the token's own lifetime from now. */
36
+ expiresAt: number;
37
+ /** How long it was signed for, as the token declares. */
38
+ lifetimeMs: number;
39
+ };
40
+ /**
41
+ * Mint the token one play of a catalogue Battle is played with, by the
42
+ * visitor this tab keeps (B4-01): the players in the page call their models
43
+ * with it, its calls counted against the play's budget. Never renewed: a play
44
+ * is minutes, and the next play mints its own.
45
+ */
46
+ export declare function fetchBattleToken(inferenceUrl: string, battle: string, visitor?: string, fetcher?: typeof fetch): Promise<BattleToken>;
28
47
  /**
29
48
  * The visitor's token for an application while `visitors` is set: minted at
30
49
  * once and again before it runs out. `error` says why none could be had.
@@ -14,9 +14,16 @@
14
14
  * visitor is on the servers (turns a day, a session's minutes, a rate and a
15
15
  * ceiling for the day), not the life of a key.
16
16
  *
17
+ * A token may also name the catalogue Battle it is played for (B4-01): its
18
+ * model calls then count against that play's own budget at ai-inference,
19
+ * instead of the visitor's rate, and the runtime that plays a member of the
20
+ * Battle's scene reads the Battle from it (`fetchBattleToken`, and
21
+ * `DatalayerVisitors.battle` for the members).
22
+ *
17
23
  * @module apps/apps/visitorToken
18
24
  */
19
25
  import { useEffect, useState } from 'react';
26
+ import { tokenLifetimeMs } from '../../runtimes/browser/anonymousToken.js';
20
27
  /** The id this tab keeps for its visitor. */
21
28
  const VISITOR_KEY = 'datalayer-loop-visitor';
22
29
  /** Minted again this long before the token runs out. */
@@ -43,17 +50,21 @@ function keepVisitorId(visitor) {
43
50
  // A tab that keeps nothing is a new visitor at each token.
44
51
  }
45
52
  }
46
- /** The body ai-inference is asked with. */
47
- export function visitorTokenRequest(app, visitor) {
48
- return isVisitorId(visitor) ? { app, visitor } : { app };
53
+ /** The body ai-inference is asked with: the application, the visitor once there is one, the Battle when it is played for one. */
54
+ export function visitorTokenRequest(app, visitor, battle = '') {
55
+ return {
56
+ ...(app ? { app } : {}),
57
+ ...(isVisitorId(visitor) ? { visitor } : {}),
58
+ ...(battle ? { battle } : {}),
59
+ };
49
60
  }
50
- /** Mint a visitor's token for an application; throws with ai-inference's sentence. */
51
- export async function fetchVisitorToken(inferenceUrl, app, visitor = keptVisitorId(), fetcher = fetch) {
61
+ /** Ask ai-inference for a token; throws with its sentence. The visitor it names is kept for the next one. */
62
+ async function mintVisitorToken(inferenceUrl, request, fetcher) {
52
63
  const base = inferenceUrl.replace(/\/+$/, '');
53
64
  const response = await fetcher(`${base}/api/ai-inference/v1/anonymous/token`, {
54
65
  method: 'POST',
55
66
  headers: { 'Content-Type': 'application/json' },
56
- body: JSON.stringify(visitorTokenRequest(app, visitor)),
67
+ body: JSON.stringify(request),
57
68
  });
58
69
  const body = (await response.json().catch(() => ({})));
59
70
  if (!response.ok || !body.token) {
@@ -63,6 +74,15 @@ export async function fetchVisitorToken(inferenceUrl, app, visitor = keptVisitor
63
74
  if (isVisitorId(body.visitor)) {
64
75
  keepVisitorId(body.visitor);
65
76
  }
77
+ return {
78
+ token: body.token,
79
+ visitor: body.visitor,
80
+ expires_in: body.expires_in,
81
+ };
82
+ }
83
+ /** Mint a visitor's token for an application — played for a Battle when `battle` names one; throws with ai-inference's sentence. */
84
+ export async function fetchVisitorToken(inferenceUrl, app, visitor = keptVisitorId(), fetcher = fetch, battle = '') {
85
+ const body = await mintVisitorToken(inferenceUrl, visitorTokenRequest(app, visitor, battle), fetcher);
66
86
  const lifetimeMs = Math.max(60_000, (body.expires_in ?? 300) * 1000);
67
87
  return {
68
88
  token: body.token,
@@ -70,6 +90,25 @@ export async function fetchVisitorToken(inferenceUrl, app, visitor = keptVisitor
70
90
  renewAt: Date.now() + lifetimeMs - MARGIN_MS,
71
91
  };
72
92
  }
93
+ /**
94
+ * Mint the token one play of a catalogue Battle is played with, by the
95
+ * visitor this tab keeps (B4-01): the players in the page call their models
96
+ * with it, its calls counted against the play's budget. Never renewed: a play
97
+ * is minutes, and the next play mints its own.
98
+ */
99
+ export async function fetchBattleToken(inferenceUrl, battle, visitor = keptVisitorId(), fetcher = fetch) {
100
+ if (!battle) {
101
+ throw new Error('A Battle token is minted for a Battle.');
102
+ }
103
+ const body = await mintVisitorToken(inferenceUrl, visitorTokenRequest('', visitor, battle), fetcher);
104
+ const lifetimeMs = tokenLifetimeMs(body.token, body.expires_in);
105
+ return {
106
+ token: body.token,
107
+ visitor: body.visitor ?? visitor,
108
+ expiresAt: Date.now() + lifetimeMs,
109
+ lifetimeMs,
110
+ };
111
+ }
73
112
  /**
74
113
  * The visitor's token for an application while `visitors` is set: minted at
75
114
  * once and again before it runs out. `error` says why none could be had.
@@ -78,6 +117,7 @@ export function useVisitorToken(visitors) {
78
117
  const [state, setState] = useState({});
79
118
  const app = visitors?.app;
80
119
  const inferenceUrl = visitors?.inferenceUrl;
120
+ const battle = visitors?.battle ?? '';
81
121
  useEffect(() => {
82
122
  if (!app || !inferenceUrl) {
83
123
  setState({});
@@ -86,7 +126,7 @@ export function useVisitorToken(visitors) {
86
126
  let cancelled = false;
87
127
  let timer;
88
128
  const mint = () => {
89
- fetchVisitorToken(inferenceUrl, app)
129
+ fetchVisitorToken(inferenceUrl, app, keptVisitorId(), fetch, battle)
90
130
  .then(minted => {
91
131
  if (cancelled) {
92
132
  return;
@@ -109,7 +149,7 @@ export function useVisitorToken(visitors) {
109
149
  clearTimeout(timer);
110
150
  }
111
151
  };
112
- }, [app, inferenceUrl]);
152
+ }, [app, inferenceUrl, battle]);
113
153
  return state;
114
154
  }
115
155
  /** What a token for an application at its address names: `at:<slug>`. */
@@ -27,7 +27,6 @@ const PapAgentIdentityView = () => {
27
27
  jwks_uri: `${new URL(requested).origin}/jwks.json`,
28
28
  redirect_uris: [`${new URL(requested).origin}/callback`],
29
29
  token_endpoint_auth_method: 'private_key_jwt',
30
- extensions: { memory: { version: '2' } },
31
30
  }),
32
31
  fetchJwks: async () => parseJsonWebKeySet({
33
32
  keys: [
@@ -13,7 +13,7 @@ const SAMPLE_DOMAIN = 'shop.example';
13
13
  const sampleCompany = (domain) => ({
14
14
  discoveryUrl: `https://${domain}/.well-known/poppy.json`,
15
15
  document: parseDiscoveryDocument({
16
- protocol_version: '0.3',
16
+ protocol_version: '0.4',
17
17
  organization: { name: 'Example Shop', domain },
18
18
  auth: {
19
19
  issuer: `https://auth.${domain}`,
@@ -37,9 +37,10 @@ const sampleCompany = (domain) => ({
37
37
  description: 'Read the catalogue',
38
38
  },
39
39
  ],
40
- extensions: { operations: { version: '1' } },
40
+ // Draft 0.4 §3.3: an entry per version it supports; a Session declares the one it implements.
41
+ extensions: { operations: [{ version: '1' }, { version: '2' }] },
41
42
  }),
42
- // Direct and Device are what the issuer's grants say (0.3 as published §3.2).
43
+ // Direct and Device are what the issuer's grants say (draft 0.4 §3.2).
43
44
  oauthMetadata: parseOAuthServerMetadata({
44
45
  issuer: `https://auth.${domain}`,
45
46
  token_endpoint: `https://auth.${domain}/token`,
@@ -80,6 +81,6 @@ const PapCompanyDiscoveryView = () => {
80
81
  setError(cause instanceof Error ? cause.message : String(cause));
81
82
  }
82
83
  };
83
- return (_jsxs(PapExamplePage, { eyebrow: "PAP \u00B7 Company discovery", title: "Discover capabilities, not credentials", description: "The PAP parser validates the discovery document and the issuer's metadata (0.3 as published); Agent Runtimes then projects them into a model-safe summary: the sign-ins the issuer's grants offer, the company's own scopes with their hints, and the domains its issuer protects. Change the sample domain to see issuer and discovery binding move together.", children: [_jsxs(Box, { display: "flex", flexDirection: "column", gap: 3, p: 3, border: "1px solid", borderColor: "border.default", borderRadius: 2, bg: "canvas.default", children: [_jsx(Text, { as: "label", sx: { fontWeight: 600 }, children: "Company DNS domain" }), _jsxs(Box, { display: "flex", gap: 2, children: [_jsx(TextInput, { block: true, value: domain, "aria-label": "Company DNS domain", onChange: event => setDomain(event.target.value) }), _jsx(Button, { variant: "primary", onClick: () => void inspect(), children: "Validate sample" })] }), _jsx(Text, { sx: { color: 'fg.muted', fontSize: 1 }, children: "The sample uses an injected Reactor-compatible transport. Production replaces it with DNS-pinned HTTPS discovery." }), error ? _jsx(Text, { sx: { color: 'danger.fg' }, children: error }) : null] }), summary ? (_jsx(PapResult, { title: "Safe company summary", value: summary })) : null] }));
84
+ return (_jsxs(PapExamplePage, { eyebrow: "PAP \u00B7 Company discovery", title: "Discover capabilities, not credentials", description: "The PAP parser validates the discovery document and the issuer's metadata (draft 0.4); Agent Runtimes then projects them into a model-safe summary: the sign-ins the issuer's grants offer, the company's own scopes with their hints, and the domains its issuer protects. Change the sample domain to see issuer and discovery binding move together.", children: [_jsxs(Box, { display: "flex", flexDirection: "column", gap: 3, p: 3, border: "1px solid", borderColor: "border.default", borderRadius: 2, bg: "canvas.default", children: [_jsx(Text, { as: "label", sx: { fontWeight: 600 }, children: "Company DNS domain" }), _jsxs(Box, { display: "flex", gap: 2, children: [_jsx(TextInput, { block: true, value: domain, "aria-label": "Company DNS domain", onChange: event => setDomain(event.target.value) }), _jsx(Button, { variant: "primary", onClick: () => void inspect(), children: "Validate sample" })] }), _jsx(Text, { sx: { color: 'fg.muted', fontSize: 1 }, children: "The sample uses an injected Reactor-compatible transport. Production replaces it with DNS-pinned HTTPS discovery." }), error ? _jsx(Text, { sx: { color: 'danger.fg' }, children: error }) : null] }), summary ? (_jsx(PapResult, { title: "Safe company summary", value: summary })) : null] }));
84
85
  };
85
86
  export default PapCompanyDiscoveryView;
@@ -28,7 +28,7 @@ const STEPS = [
28
28
  channel: 'Discovery',
29
29
  messages: conversationStart,
30
30
  facts: [
31
- { label: 'Publishes', value: 'poppy.json · 0.3 as published' },
31
+ { label: 'Publishes', value: 'poppy.json · draft 0.4' },
32
32
  { label: 'Returns', value: 'Company conversation agent' },
33
33
  { label: 'Sign-in', value: "Northstar's own page" },
34
34
  ],
@@ -38,7 +38,7 @@ const STEPS = [
38
38
  request: 'Accept: application/json',
39
39
  response: `200 OK
40
40
  {
41
- "protocol_version": "0.3",
41
+ "protocol_version": "0.4",
42
42
  "organization": { "name": "Northstar Outfitters" },
43
43
  "auth": {
44
44
  "issuer": "https://auth.northstar.example",
@@ -70,11 +70,12 @@ const STEPS = [
70
70
  target: 'https://api.northstar.example/poppy/conversations',
71
71
  detailLabel: 'Atlas → company agent',
72
72
  request: `Poppy-Session: [fresh JWT, naming the sid, signed with a delegated key]
73
+ Poppy-Version: 0.4
73
74
  Content-Type: application/json
74
75
 
75
76
  {
77
+ "id": "req_return",
76
78
  "message": {
77
- "id": "msg_return",
78
79
  "author": { "type": "agent" },
79
80
  "text": "The user wants to return a jacket."
80
81
  }
@@ -87,8 +88,10 @@ Content-Type: application/json
87
88
  "error": "insufficient_scope",
88
89
  "scope": "orders:read orders:return"
89
90
  }],
90
- "status": "idle",
91
- "responder": "agent"
91
+ "working": false,
92
+ "handoff": "none",
93
+ "responder": "agent",
94
+ "closed": false
92
95
  }`,
93
96
  },
94
97
  {
@@ -140,11 +143,12 @@ Location: https://atlas.example/oauth/callback
140
143
  detailLabel: 'Atlas ↔ company agent',
141
144
  request: `Authorization: Bearer [host-only access token]
142
145
  Poppy-Session: [fresh JWT]
146
+ Poppy-Version: 0.4
143
147
  Content-Type: application/json
144
148
 
145
149
  {
150
+ "id": "req_offer",
146
151
  "message": {
147
- "id": "msg_offer",
148
152
  "author": { "type": "agent" },
149
153
  "text": "The user has signed in. Continue the return request."
150
154
  }
@@ -159,8 +163,10 @@ Content-Type: application/json
159
163
  "text": "Choose an even exchange or refund."
160
164
  }
161
165
  }],
162
- "status": "idle",
163
- "responder": "agent"
166
+ "working": false,
167
+ "handoff": "none",
168
+ "responder": "agent",
169
+ "closed": false
164
170
  }`,
165
171
  },
166
172
  {
@@ -191,11 +197,12 @@ Content-Type: application/json
191
197
  detailLabel: 'Atlas ↔ company agent',
192
198
  request: `Authorization: Bearer [host-only access token]
193
199
  Poppy-Session: [fresh JWT]
200
+ Poppy-Version: 0.4
194
201
  Content-Type: application/json
195
202
 
196
203
  {
204
+ "id": "req_exchange_choice",
197
205
  "message": {
198
- "id": "msg_exchange_choice",
199
206
  "author": { "type": "agent" },
200
207
  "text": "The user chose the even exchange."
201
208
  }
@@ -210,7 +217,10 @@ Content-Type: application/json
210
217
  "text": "The exchange is arranged."
211
218
  }
212
219
  }],
213
- "status": "closed"
220
+ "working": false,
221
+ "handoff": "none",
222
+ "responder": "agent",
223
+ "closed": true
214
224
  }`,
215
225
  },
216
226
  ];
@@ -238,7 +248,7 @@ const companyReply = (response) => {
238
248
  */
239
249
  const runJourney = async () => {
240
250
  parseDiscoveryDocument({
241
- protocol_version: '0.3',
251
+ protocol_version: '0.4',
242
252
  organization: { name: 'Northstar Outfitters', domain: 'northstar.example' },
243
253
  auth: {
244
254
  issuer: 'https://auth.northstar.example',
@@ -256,7 +266,7 @@ const runJourney = async () => {
256
266
  ],
257
267
  },
258
268
  });
259
- // Direct Sign-In is what the issuer's grants offer (0.3 as published §3.2).
269
+ // Direct Sign-In is what the issuer's grants offer (draft 0.4 §3.2).
260
270
  parseOAuthServerMetadata({
261
271
  issuer: 'https://auth.northstar.example',
262
272
  token_endpoint: 'https://auth.northstar.example/oauth/token',
@@ -288,6 +298,7 @@ const runJourney = async () => {
288
298
  headers: { 'content-type': 'application/json' },
289
299
  });
290
300
  }
301
+ // The request's id is top-level, the message's own (draft 0.4 §8.3).
291
302
  const incoming = JSON.parse(String(init?.body ?? '{}'));
292
303
  return new Response(JSON.stringify({
293
304
  conversation_id: 'cnv_return',
@@ -301,14 +312,17 @@ const runJourney = async () => {
301
312
  author: { type: 'agent' },
302
313
  role: 'company',
303
314
  text: reply,
304
- context: { in_reply_to: incoming.message?.id ?? 'unknown' },
315
+ as_of_request: incoming.id,
305
316
  },
306
317
  },
307
318
  ],
308
319
  cursor: `cursor_${index + 1}`,
309
320
  has_more: false,
310
- status: index === replies.length - 1 ? 'closed' : 'idle',
321
+ // Draft 0.4 §8.7: the four state fields.
322
+ working: false,
323
+ handoff: 'none',
311
324
  responder: 'agent',
325
+ closed: index === replies.length - 1,
312
326
  }), {
313
327
  status: index === 0 ? 201 : 202,
314
328
  headers: { 'content-type': 'application/json' },
@@ -359,18 +373,18 @@ const runJourney = async () => {
359
373
  });
360
374
  const endpoint = 'https://api.northstar.example/poppy/conversations';
361
375
  const started = await conversations.start(endpoint, {
362
- id: conversations.generateMessageId(),
376
+ id: conversations.generateRequestId(),
363
377
  author: { type: 'agent' },
364
378
  text: conversationStart[0]?.text,
365
379
  }, requestOptions(false));
366
380
  const signInReply = companyReply(started);
367
381
  const offer = companyReply(await conversations.send(endpoint, 'cnv_return', {
368
- id: conversations.generateMessageId(),
382
+ id: conversations.generateRequestId(),
369
383
  author: { type: 'agent' },
370
384
  text: 'The user has signed in. Continue the return request.',
371
385
  }, requestOptions(true)));
372
386
  const confirmation = companyReply(await conversations.send(endpoint, 'cnv_return', {
373
- id: conversations.generateMessageId(),
387
+ id: conversations.generateRequestId(),
374
388
  author: { type: 'agent' },
375
389
  text: 'The user chose the even exchange.',
376
390
  }, requestOptions(true)));
@@ -81,6 +81,6 @@ const PapSessionLifecycleView = () => {
81
81
  reactor.stop();
82
82
  }
83
83
  };
84
- return (_jsxs(PapExamplePage, { eyebrow: "PAP \u00B7 Session", title: "Start and restart a Session without giving credentials to the agent", description: "This Reactor view drives the real PAP SessionClient and SessionFetchClient (0.3 as published) against a deterministic company transport. A Session is local: a random sid, and no request. Every request carries a fresh Poppy-Session JWT signed with a delegated key. Answered invalid_session, it starts again once, with a new sid and the same User ID. Only lifecycle evidence enters React state.", children: [_jsxs(Box, { display: "flex", alignItems: "center", justifyContent: "space-between", gap: 3, p: 3, border: "1px solid", borderColor: "border.default", borderRadius: 2, bg: "canvas.default", children: [_jsx(Text, { sx: { color: 'fg.muted' }, children: "Exercise start, the Session header and a restart entirely inside this host." }), _jsx(Button, { variant: "primary", onClick: () => void runLifecycle(), children: "Run lifecycle" })] }), error ? _jsx(Text, { sx: { color: 'danger.fg' }, children: error }) : null, summary ? (_jsx(PapResult, { title: "Safe Session evidence", value: summary })) : null] }));
84
+ return (_jsxs(PapExamplePage, { eyebrow: "PAP \u00B7 Session", title: "Start and restart a Session without giving credentials to the agent", description: "This Reactor view drives the real PAP SessionClient and SessionFetchClient (draft 0.4) against a deterministic company transport. A Session is local: a random sid, and no request. Every request carries a fresh Poppy-Session JWT signed with a delegated key and names its protocol version in Poppy-Version. Answered session_ended, it starts again once, with a new sid and the same User ID. Only lifecycle evidence enters React state.", children: [_jsxs(Box, { display: "flex", alignItems: "center", justifyContent: "space-between", gap: 3, p: 3, border: "1px solid", borderColor: "border.default", borderRadius: 2, bg: "canvas.default", children: [_jsx(Text, { sx: { color: 'fg.muted' }, children: "Exercise start, the Session header and a restart entirely inside this host." }), _jsx(Button, { variant: "primary", onClick: () => void runLifecycle(), children: "Run lifecycle" })] }), error ? _jsx(Text, { sx: { color: 'danger.fg' }, children: error }) : null, summary ? (_jsx(PapResult, { title: "Safe Session evidence", value: summary })) : null] }));
85
85
  };
86
86
  export default PapSessionLifecycleView;
@@ -3,7 +3,7 @@
3
3
  "title": "Refresh tokens",
4
4
  "description": "Refresh, rotation, narrowing, re-consent, and revocation of the refresh token Atlas holds for Ada at Manzanita, which never leaves the host's vault.",
5
5
  "generator": "examples/personal-agent-protocol/traces/generate.py",
6
- "sdk": "personal-agent-protocol 0.29.0",
6
+ "sdk": "personal-agent-protocol 0.32.0",
7
7
  "parties": [
8
8
  {
9
9
  "id": "user",
@@ -86,7 +86,7 @@
86
86
  "content-type": "application/json"
87
87
  },
88
88
  "body": {
89
- "protocol_version": "0.3",
89
+ "protocol_version": "0.4",
90
90
  "organization": {
91
91
  "name": "Manzanita Outfitters",
92
92
  "domain": "manzanita.example"
@@ -103,7 +103,8 @@
103
103
  "issuer": "https://manzanita.example",
104
104
  "scopes": {
105
105
  "orders:read": "See your orders, returns and exchanges",
106
- "orders:write": "Exchange or return items in your orders"
106
+ "orders:write": "Exchange or return items in your orders",
107
+ "poppy:browser-sign-in": "Use the website signed in, with the other access you approve"
107
108
  },
108
109
  "scope_hints": {
109
110
  "orders:read": {
@@ -138,25 +139,44 @@
138
139
  "url": "https://manzanita.example/poppy/excluded-tasks.json"
139
140
  },
140
141
  "extensions": {
141
- "operations": {
142
- "version": "2"
143
- },
144
- "mediated-sign-in": {
145
- "version": "1",
146
- "fields": [
147
- {
148
- "name": "email",
149
- "label": "Email",
150
- "secret": false
151
- },
152
- {
153
- "name": "password",
154
- "label": "Password",
155
- "secret": true
156
- }
157
- ],
158
- "scopes": ["orders:read", "orders:write"]
159
- }
142
+ "operations": [
143
+ {
144
+ "version": "2"
145
+ }
146
+ ],
147
+ "links": [
148
+ {
149
+ "version": "1"
150
+ }
151
+ ],
152
+ "disclosures": [
153
+ {
154
+ "version": "1"
155
+ }
156
+ ],
157
+ "ucp": [
158
+ {
159
+ "version": "1"
160
+ }
161
+ ],
162
+ "mediated-sign-in": [
163
+ {
164
+ "version": "1",
165
+ "fields": [
166
+ {
167
+ "name": "email",
168
+ "label": "Email",
169
+ "secret": false
170
+ },
171
+ {
172
+ "name": "password",
173
+ "label": "Password",
174
+ "secret": true
175
+ }
176
+ ],
177
+ "scopes": ["orders:read", "orders:write"]
178
+ }
179
+ ]
160
180
  }
161
181
  }
162
182
  }
@@ -180,7 +200,11 @@
180
200
  "body": {
181
201
  "resource": "https://manzanita.example",
182
202
  "authorization_servers": ["https://manzanita.example"],
183
- "scopes_supported": ["orders:read", "orders:write"],
203
+ "scopes_supported": [
204
+ "orders:read",
205
+ "orders:write",
206
+ "poppy:browser-sign-in"
207
+ ],
184
208
  "bearer_methods_supported": ["header"]
185
209
  }
186
210
  }
@@ -211,7 +235,12 @@
211
235
  "urn:ietf:params:oauth:grant-type:device_code",
212
236
  "https://personalagentprotocol.org/grant/mediated-sign-in"
213
237
  ],
214
- "scopes_supported": ["orders:read", "orders:write"],
238
+ "token_endpoint_auth_methods_supported": ["private_key_jwt"],
239
+ "scopes_supported": [
240
+ "orders:read",
241
+ "orders:write",
242
+ "poppy:browser-sign-in"
243
+ ],
215
244
  "protected_resources": [
216
245
  "https://manzanita.example",
217
246
  "https://manzanita.example/mcp"
@@ -344,12 +373,7 @@
344
373
  "client_name": "Atlas",
345
374
  "jwks_uri": "https://atlas.example/jwks.json",
346
375
  "redirect_uris": ["https://atlas.example/oauth/callback"],
347
- "token_endpoint_auth_method": "private_key_jwt",
348
- "extensions": {
349
- "operations": {
350
- "version": "2"
351
- }
352
- }
376
+ "token_endpoint_auth_method": "private_key_jwt"
353
377
  }
354
378
  }
355
379
  },