@datalayer/agent-runtimes 1.5.95 → 1.5.97
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-embed/chunks/{index.esm-zOy6kFPv.js → index.esm-BLDeC6q1.js} +1 -1
- package/dist-embed/datalayer-app-main.js +80 -80
- package/lib/apps/apps/appspec.d.ts +11 -12
- package/lib/apps/apps/appspec.js +45 -87
- package/lib/components/cards/ToolApprovalCard.js +4 -2
- package/lib/components/inspector/a2aSpans.d.ts +7 -0
- package/lib/components/inspector/a2aSpans.js +34 -2
- package/lib/components/inspector/agentSpans.d.ts +1 -1
- package/lib/components/inspector/agentSpans.js +1 -0
- package/lib/components/teams/HarnessIcon.d.ts +11 -0
- package/lib/components/teams/HarnessIcon.js +17 -0
- package/lib/components/teams/SceneTranscript.d.ts +1 -1
- package/lib/components/teams/SceneTranscript.js +12 -7
- package/lib/components/teams/SceneView.d.ts +7 -1
- package/lib/components/teams/SceneView.js +2 -2
- package/lib/components/teams/backdrops/hero.js +1 -1
- package/lib/components/teams/backdrops/minimal.js +1 -1
- package/lib/components/teams/backdrops/nodes.js +4 -3
- package/lib/components/teams/backdrops/space.js +1 -1
- package/lib/components/teams/backdrops/types.d.ts +9 -0
- package/lib/components/teams/index.d.ts +2 -0
- package/lib/components/teams/index.js +2 -0
- package/lib/components/teams/memberHarness.d.ts +16 -0
- package/lib/components/teams/memberHarness.js +42 -0
- package/lib/components/teams/sceneTranscriptRules.js +6 -1
- package/lib/components/teams/transcript/LineSelect.d.ts +20 -0
- package/lib/components/teams/transcript/LineSelect.js +20 -0
- package/lib/components/teams/transcript/TranscriptTable.d.ts +11 -5
- package/lib/components/teams/transcript/TranscriptTable.js +24 -7
- package/lib/components/teams/transcript/TranscriptViews.js +1 -1
- package/lib/components/teams/transcript/recordingPlayback.d.ts +13 -0
- package/lib/components/teams/transcript/recordingPlayback.js +32 -0
- package/lib/components/teams/transcript/useSceneRecording.d.ts +1 -1
- package/lib/components/teams/transcript/useSceneRecording.js +19 -11
- package/lib/examples/PapAccountTokensExample.d.ts +1 -1
- package/lib/examples/PapAccountTokensExample.js +3 -3
- package/lib/examples/PapSessionJwtExample.d.ts +4 -0
- package/lib/examples/{PapDpopProofExample.js → PapSessionJwtExample.js} +9 -9
- package/lib/examples/PapSessionLifecycleExample.d.ts +1 -1
- package/lib/examples/PapSessionLifecycleExample.js +2 -2
- package/lib/examples/ScenesExample.js +15 -13
- package/lib/examples/example-selector.js +3 -3
- package/lib/examples/index.d.ts +1 -1
- package/lib/examples/index.js +1 -1
- package/lib/examples/main.js +1 -1
- package/lib/examples/pap/PapAccountTokensView.d.ts +1 -1
- package/lib/examples/pap/PapAuthorizationBoundaryView.js +15 -22
- package/lib/examples/pap/PapGuidedJourneyView.js +61 -60
- package/lib/examples/pap/PapSessionJwtView.d.ts +4 -0
- package/lib/examples/pap/PapSessionJwtView.js +69 -0
- package/lib/examples/pap/PapSessionLifecycleView.js +36 -58
- package/lib/examples/pap/PapSignInDisplayView.d.ts +1 -1
- package/lib/examples/pap/PapSignInDisplayView.js +1 -1
- package/lib/examples/pap/PapTraceView.d.ts +1 -1
- package/lib/examples/pap/PapTraceView.js +1 -1
- package/lib/examples/pap/traces/account-tokens.json +145 -173
- package/lib/examples/pap/traces/conversation-control.json +118 -140
- package/lib/examples/pap/traces/conversation-streaming.json +114 -134
- package/lib/examples/pap/traces/mediated-sign-in.json +151 -166
- package/lib/examples/pap/traces/operations.json +613 -391
- package/lib/examples/pap/traces/two-companies.json +380 -990
- package/lib/examples/pap/traces/user-with-a-company.json +319 -207
- package/lib/models/environments.generated.d.ts +2 -2
- package/lib/models/environments.generated.js +1 -1
- package/lib/pap/index.d.ts +1 -1
- package/lib/pap/index.js +3 -3
- package/lib/portable/displays.d.ts +13 -22
- package/lib/portable/displays.js +17 -65
- package/lib/portable/hosts/approvalRenderers.d.ts +4 -4
- package/lib/portable/hosts/approvalRenderers.js +26 -13
- package/lib/portable/hosts/contracts.json +5 -2
- package/lib/portable/index.d.ts +1 -1
- package/lib/portable/index.js +1 -1
- package/lib/protocols/decks/index.d.ts +37 -0
- package/lib/protocols/decks/index.js +48 -0
- package/lib/protocols/decks/pact-a-personal-agent-at-a-business.d.ts +2 -0
- package/lib/protocols/decks/pact-a-personal-agent-at-a-business.js +148 -0
- package/lib/protocols/decks/ucp-a-purchase-approved.d.ts +2 -0
- package/lib/protocols/decks/ucp-a-purchase-approved.js +154 -0
- package/lib/specs/actions.d.ts +1 -1
- package/lib/specs/actions.js +2 -2
- package/lib/specs/agents/agents.js +3 -3
- package/lib/specs/apps.d.ts +1 -1
- package/lib/specs/apps.js +10 -11
- package/lib/specs/appspecSchema.js +4 -112
- package/lib/specs/envvars.js +2 -2
- package/lib/specs/harnesses.js +9 -9
- package/lib/specs/scenes.js +10 -33
- package/lib/specs/teams/teams.js +2 -2
- package/lib/types/agentspecs.d.ts +91 -127
- package/package.json +409 -409
- package/scripts/codegen/generate_apps.py +6 -7
- package/scripts/validate_pap_examples.py +1 -1
- package/lib/examples/PapDpopProofExample.d.ts +0 -4
- package/lib/examples/pap/PapDpopProofView.d.ts +0 -4
- package/lib/examples/pap/PapDpopProofView.js +0 -61
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025-2026 Datalayer, Inc.
|
|
3
|
+
* Distributed under the terms of the Modified BSD License.
|
|
4
|
+
*/
|
|
5
|
+
/** A Personal Agent at a Business, as a deck in YAML. */
|
|
6
|
+
export const yaml = `deck:
|
|
7
|
+
title: A Personal Agent at a Business
|
|
8
|
+
subtitle: Personal Agent Consent & Trust, by example
|
|
9
|
+
template: datalayer
|
|
10
|
+
slides:
|
|
11
|
+
- id: pact-a-personal-agent-at-a-business
|
|
12
|
+
type: title
|
|
13
|
+
title: A Personal Agent at a Business
|
|
14
|
+
subtitle: Ada’s Travel Desk asks an airline about her flight, and she allows it to read her bookings, not to change them.
|
|
15
|
+
meta: PACT 1.0 · a case · not the Personal Agent Protocol
|
|
16
|
+
notes: >-
|
|
17
|
+
This case is over PACT, Personal Agent Consent and Trust. It is a different
|
|
18
|
+
protocol from the Personal Agent Protocol, built on A2A and OAuth, with the
|
|
19
|
+
same aim: a person’s own agent working with a business. It is played with a
|
|
20
|
+
demo airline, so nothing here signs in anywhere.
|
|
21
|
+
- id: who
|
|
22
|
+
type: three-columns
|
|
23
|
+
title: Who is in this case
|
|
24
|
+
columns:
|
|
25
|
+
- heading: Ada
|
|
26
|
+
type: text
|
|
27
|
+
content: The person. She chooses what is allowed.
|
|
28
|
+
- heading: Travel Desk
|
|
29
|
+
type: text
|
|
30
|
+
content: An application that works for Ada.
|
|
31
|
+
- heading: Example Air Support
|
|
32
|
+
type: text
|
|
33
|
+
content: A business, at air.examples.datalayer.run, answered for by Example Provider.
|
|
34
|
+
notes: >-
|
|
35
|
+
Three parties. Ada wants to know when she flies. Travel Desk is an
|
|
36
|
+
application working for her. Example Air Support is the airline’s agent, and
|
|
37
|
+
a Provider answers for it, which is how PACT describes a business that
|
|
38
|
+
reaches agents through a platform.
|
|
39
|
+
- id: what-happens
|
|
40
|
+
type: mermaid
|
|
41
|
+
title: What happens
|
|
42
|
+
diagram: |-
|
|
43
|
+
sequenceDiagram
|
|
44
|
+
actor Ada
|
|
45
|
+
participant Desk as Travel Desk
|
|
46
|
+
participant Air as Example Air Support
|
|
47
|
+
Ada->>Desk: When is my flight?
|
|
48
|
+
Desk->>Air: Reads its card
|
|
49
|
+
Desk->>Air: Asks, as Travel Desk
|
|
50
|
+
Air-->>Desk: Please sign in
|
|
51
|
+
Desk->>Ada: Sign in at Example Air
|
|
52
|
+
Ada->>Air: Allows See your bookings, only
|
|
53
|
+
Air-->>Desk: AB123 flies on 2026-11-02
|
|
54
|
+
Desk->>Ada: Your flight is on 2 November 2026
|
|
55
|
+
notes: >-
|
|
56
|
+
Ada asks. The application reads the card the business publishes, and asks
|
|
57
|
+
the airline’s agent, saying which application it is. The airline asks for a
|
|
58
|
+
sign-in. Ada signs in on the airline’s page and allows one thing of the two
|
|
59
|
+
asked. The airline answers, and signs a receipt.
|
|
60
|
+
- id: identity
|
|
61
|
+
type: flow
|
|
62
|
+
title: Who is asking
|
|
63
|
+
items:
|
|
64
|
+
- label: "1"
|
|
65
|
+
title: Card
|
|
66
|
+
detail: Published at the business’s own domain
|
|
67
|
+
- label: "2"
|
|
68
|
+
title: Identity
|
|
69
|
+
detail: Each request is signed, naming which application asks
|
|
70
|
+
- label: "3"
|
|
71
|
+
title: Ask
|
|
72
|
+
detail: Over A2A, with nobody signed in yet
|
|
73
|
+
current: true
|
|
74
|
+
notes: >-
|
|
75
|
+
PACT has two profiles. In the Identity profile every request but the card
|
|
76
|
+
carries a signed personal-agent token that says which agent is asking and
|
|
77
|
+
for what stable, opaque person. It lives two minutes. That is enough to
|
|
78
|
+
talk. Acting on the person’s account is the second profile.
|
|
79
|
+
- id: scopes
|
|
80
|
+
type: comparison
|
|
81
|
+
title: Ada allows one of the two
|
|
82
|
+
columns:
|
|
83
|
+
- Asked
|
|
84
|
+
- Allowed
|
|
85
|
+
rows:
|
|
86
|
+
- label: See your bookings and their status
|
|
87
|
+
values:
|
|
88
|
+
- true
|
|
89
|
+
- true
|
|
90
|
+
- label: Change the date of a booking
|
|
91
|
+
values:
|
|
92
|
+
- true
|
|
93
|
+
- false
|
|
94
|
+
notes: >-
|
|
95
|
+
The application asks for the two permissions on the card, one to read and
|
|
96
|
+
one to change. Ada signs in on the airline’s own page with a link and a code,
|
|
97
|
+
and allows reading only. The airline gives Travel Desk a permission for Ada
|
|
98
|
+
and for this application alone.
|
|
99
|
+
- id: step-up
|
|
100
|
+
type: statement
|
|
101
|
+
title: Allowing less is an answer
|
|
102
|
+
statement: >-
|
|
103
|
+
If Travel Desk later needs more, the business **says what is missing**, and
|
|
104
|
+
Ada is asked again.
|
|
105
|
+
notes: >-
|
|
106
|
+
The application reads back what was granted. If a later request needs more,
|
|
107
|
+
the business answers that it needs authorization, naming the missing
|
|
108
|
+
permission, and Ada is asked. Nothing widens silently. What she allowed
|
|
109
|
+
stays what she allowed.
|
|
110
|
+
- id: receipt
|
|
111
|
+
type: two-columns
|
|
112
|
+
title: A receipt, signed by the airline
|
|
113
|
+
left:
|
|
114
|
+
heading: Each answer comes with
|
|
115
|
+
type: bullets
|
|
116
|
+
items:
|
|
117
|
+
- A receipt of what was done with the permission
|
|
118
|
+
- The airline’s signature, verified before it is kept
|
|
119
|
+
right:
|
|
120
|
+
heading: The record shows
|
|
121
|
+
type: bullets
|
|
122
|
+
items:
|
|
123
|
+
- Signed in at Example Air, for Ada
|
|
124
|
+
- Allowed, See your bookings and their status
|
|
125
|
+
- Looked up booking AB123
|
|
126
|
+
notes: >-
|
|
127
|
+
The airline signs a receipt of what it did with the permission. The
|
|
128
|
+
application verifies it before it keeps it, with its record. Ada can see the
|
|
129
|
+
permission and end it with Disconnect.
|
|
130
|
+
- id: why
|
|
131
|
+
type: statement
|
|
132
|
+
title: Why it matters
|
|
133
|
+
statement: >-
|
|
134
|
+
The business knows **which agent is asking**, the person chooses **what it
|
|
135
|
+
may do**, and a signed receipt says **what it did**.
|
|
136
|
+
notes: >-
|
|
137
|
+
Three questions a business has about somebody’s agent, each with an answer
|
|
138
|
+
that can be checked, without a password ever passing through the agent.
|
|
139
|
+
- id: run-it
|
|
140
|
+
type: closing
|
|
141
|
+
title: Run it yourself
|
|
142
|
+
cta: The PACT page of the Agent Runtimes docs, and the demo Provider that plays this case.
|
|
143
|
+
notes: >-
|
|
144
|
+
This case is written from the Agent Runtimes demo Provider, Example Air, with
|
|
145
|
+
its card, permissions and answers as they are. Read the PACT page for the
|
|
146
|
+
personal agent and its contribution points, and PAP and PACT side by side
|
|
147
|
+
for how the two protocols compare.
|
|
148
|
+
`;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/** A Purchase, Approved, as a deck in YAML. */
|
|
2
|
+
export declare const yaml = "deck:\n title: A Purchase, Approved\n subtitle: Universal Commerce Protocol, by example\n template: datalayer\nslides:\n - id: ucp-a-purchase-approved\n type: title\n title: A Purchase, Approved\n subtitle: Ada\u2019s Shopping Desk fills a basket at a test shop, and buys only once she approves the exact purchase.\n meta: UCP 2026-08-25 \u00B7 a case \u00B7 not the Personal Agent Protocol\n notes: >-\n This case is about shopping, over the Universal Commerce Protocol, UCP. It\n is a different protocol from the Personal Agent Protocol, and it is played\n at a test shop with a test payment, so nothing real is bought.\n - id: who\n type: three-columns\n title: Who is in this case\n columns:\n - heading: Ada\n type: text\n content: The person. Every purchase is hers to approve.\n - heading: Shopping Desk\n type: text\n content: An application that shops for Ada.\n - heading: Example Store\n type: text\n content: A test shop, at store.examples.datalayer.run.\n notes: >-\n Three parties. Ada wants a mug. Shopping Desk is an application that shops\n for her. Example Store is a test shop that speaks UCP.\n - id: what-happens\n type: mermaid\n title: What happens\n diagram: |-\n sequenceDiagram\n actor Ada\n participant Desk as Shopping Desk\n participant Store as Example Store\n Ada->>Desk: Buy me a stoneware mug\n Desk->>Store: Reads its profile, searches its catalogue\n Store-->>Desk: Stoneware mug, USD 24.00\n Desk->>Store: Fills a checkout\n Store-->>Desk: Ready to complete\n Desk->>Ada: The exact purchase\n Ada->>Desk: Approve\n Desk->>Store: Completes it, with a test payment\n Store-->>Desk: Your order is placed\n Desk->>Ada: Bought, once\n notes: >-\n Ada asks. The application reads the shop\u2019s profile and its catalogue, which\n changes nothing. It fills a checkout, which the shop could still cancel, so\n nothing is bought yet. It shows Ada the exact purchase, and only when she\n approves does it complete the checkout.\n - id: steps\n type: flow\n title: Reading, then a checkout, then a purchase\n items:\n - label: \"1\"\n title: Read\n detail: The profile at /.well-known/ucp, and the catalogue\n - label: \"2\"\n title: Fill\n detail: A checkout the shop can cancel\n - label: \"3\"\n title: Propose\n detail: The checkout read again, its lines and totals exact\n - label: \"4\"\n title: Buy\n detail: Only with Ada\u2019s yes, and only once\n current: true\n notes: >-\n UCP gives a shop one published profile and a checkout that moves toward\n being ready to complete. Agent Runtimes adds a step on top of it: nothing\n is bought in one call. A ready checkout becomes an exact proposal, read\n again from the shop, and completing it is a separate step.\n - id: proposal\n type: comparison\n title: What Ada approves\n columns:\n - The purchase\n rows:\n - label: What\n values:\n - Stoneware mug \u00D7 1\n - label: Tax\n values:\n - USD 1.92\n - label: Total\n values:\n - USD 25.92\n - label: The most one purchase may cost\n values:\n - USD 50.00\n notes: >-\n Ada reads the shop\u2019s own checkout. Buy 1 Stoneware mug at Example Store for\n USD 25.92. There is a limit on what one purchase may cost, and the mug is\n within it. The proposal has a revision, a hash of what is bought, so\n approving this basket never approves a changed one.\n - id: asked\n type: statement\n title: Every purchase is asked first\n statement: >-\n Whatever the application\u2019s rules say, **buying waits for Ada**. If she\n declines, the checkout is cancelled and nothing is bought.\n notes: >-\n Reading can go ahead on its own, and a checkout can be filled. Buying is a\n different class of action, and it is always asked. If Ada says no, the\n checkout is cancelled.\n - id: once\n type: two-columns\n title: Bought once, and no card in the conversation\n left:\n heading: Once\n type: bullets\n items:\n - The proposal is spent before Ada is asked\n - Its id is the Idempotency-Key, so a retry is the same request\n - Asked again, it reads the order back instead of paying twice\n right:\n heading: No card\n type: bullets\n items:\n - The payment instrument comes from custody\n - The model never sees it\n - The record shows the amount and who approved\n notes: >-\n The proposal is used up before the person is asked, so a declined proposal\n is proposed again, never retried. Its id is the idempotency key, so a retry\n after a lost answer buys nothing twice. The payment instrument comes from\n custody, and the conversation never holds a card.\n - id: why\n type: statement\n title: Why it matters\n statement: >-\n An agent can do the shopping, and **the money moves only on the person\u2019s\n yes**, for exactly what she saw.\n notes: >-\n UCP lets any agent shop at any shop that speaks it. What keeps that safe is\n that the purchase is exact, approved, bought once, and recorded with its\n amount and who approved it.\n - id: run-it\n type: closing\n title: Run it yourself\n cta: The UCP page of the Agent Runtimes docs, and the test merchant that plays this case.\n notes: >-\n This case is written from the Agent Runtimes test merchant, Example Store,\n with its product, price and tax as they are. Test merchants only, with no\n real payment. Read the UCP page for the client and its contribution points.\n";
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025-2026 Datalayer, Inc.
|
|
3
|
+
* Distributed under the terms of the Modified BSD License.
|
|
4
|
+
*/
|
|
5
|
+
/** A Purchase, Approved, as a deck in YAML. */
|
|
6
|
+
export const yaml = `deck:
|
|
7
|
+
title: A Purchase, Approved
|
|
8
|
+
subtitle: Universal Commerce Protocol, by example
|
|
9
|
+
template: datalayer
|
|
10
|
+
slides:
|
|
11
|
+
- id: ucp-a-purchase-approved
|
|
12
|
+
type: title
|
|
13
|
+
title: A Purchase, Approved
|
|
14
|
+
subtitle: Ada’s Shopping Desk fills a basket at a test shop, and buys only once she approves the exact purchase.
|
|
15
|
+
meta: UCP 2026-08-25 · a case · not the Personal Agent Protocol
|
|
16
|
+
notes: >-
|
|
17
|
+
This case is about shopping, over the Universal Commerce Protocol, UCP. It
|
|
18
|
+
is a different protocol from the Personal Agent Protocol, and it is played
|
|
19
|
+
at a test shop with a test payment, so nothing real is bought.
|
|
20
|
+
- id: who
|
|
21
|
+
type: three-columns
|
|
22
|
+
title: Who is in this case
|
|
23
|
+
columns:
|
|
24
|
+
- heading: Ada
|
|
25
|
+
type: text
|
|
26
|
+
content: The person. Every purchase is hers to approve.
|
|
27
|
+
- heading: Shopping Desk
|
|
28
|
+
type: text
|
|
29
|
+
content: An application that shops for Ada.
|
|
30
|
+
- heading: Example Store
|
|
31
|
+
type: text
|
|
32
|
+
content: A test shop, at store.examples.datalayer.run.
|
|
33
|
+
notes: >-
|
|
34
|
+
Three parties. Ada wants a mug. Shopping Desk is an application that shops
|
|
35
|
+
for her. Example Store is a test shop that speaks UCP.
|
|
36
|
+
- id: what-happens
|
|
37
|
+
type: mermaid
|
|
38
|
+
title: What happens
|
|
39
|
+
diagram: |-
|
|
40
|
+
sequenceDiagram
|
|
41
|
+
actor Ada
|
|
42
|
+
participant Desk as Shopping Desk
|
|
43
|
+
participant Store as Example Store
|
|
44
|
+
Ada->>Desk: Buy me a stoneware mug
|
|
45
|
+
Desk->>Store: Reads its profile, searches its catalogue
|
|
46
|
+
Store-->>Desk: Stoneware mug, USD 24.00
|
|
47
|
+
Desk->>Store: Fills a checkout
|
|
48
|
+
Store-->>Desk: Ready to complete
|
|
49
|
+
Desk->>Ada: The exact purchase
|
|
50
|
+
Ada->>Desk: Approve
|
|
51
|
+
Desk->>Store: Completes it, with a test payment
|
|
52
|
+
Store-->>Desk: Your order is placed
|
|
53
|
+
Desk->>Ada: Bought, once
|
|
54
|
+
notes: >-
|
|
55
|
+
Ada asks. The application reads the shop’s profile and its catalogue, which
|
|
56
|
+
changes nothing. It fills a checkout, which the shop could still cancel, so
|
|
57
|
+
nothing is bought yet. It shows Ada the exact purchase, and only when she
|
|
58
|
+
approves does it complete the checkout.
|
|
59
|
+
- id: steps
|
|
60
|
+
type: flow
|
|
61
|
+
title: Reading, then a checkout, then a purchase
|
|
62
|
+
items:
|
|
63
|
+
- label: "1"
|
|
64
|
+
title: Read
|
|
65
|
+
detail: The profile at /.well-known/ucp, and the catalogue
|
|
66
|
+
- label: "2"
|
|
67
|
+
title: Fill
|
|
68
|
+
detail: A checkout the shop can cancel
|
|
69
|
+
- label: "3"
|
|
70
|
+
title: Propose
|
|
71
|
+
detail: The checkout read again, its lines and totals exact
|
|
72
|
+
- label: "4"
|
|
73
|
+
title: Buy
|
|
74
|
+
detail: Only with Ada’s yes, and only once
|
|
75
|
+
current: true
|
|
76
|
+
notes: >-
|
|
77
|
+
UCP gives a shop one published profile and a checkout that moves toward
|
|
78
|
+
being ready to complete. Agent Runtimes adds a step on top of it: nothing
|
|
79
|
+
is bought in one call. A ready checkout becomes an exact proposal, read
|
|
80
|
+
again from the shop, and completing it is a separate step.
|
|
81
|
+
- id: proposal
|
|
82
|
+
type: comparison
|
|
83
|
+
title: What Ada approves
|
|
84
|
+
columns:
|
|
85
|
+
- The purchase
|
|
86
|
+
rows:
|
|
87
|
+
- label: What
|
|
88
|
+
values:
|
|
89
|
+
- Stoneware mug × 1
|
|
90
|
+
- label: Tax
|
|
91
|
+
values:
|
|
92
|
+
- USD 1.92
|
|
93
|
+
- label: Total
|
|
94
|
+
values:
|
|
95
|
+
- USD 25.92
|
|
96
|
+
- label: The most one purchase may cost
|
|
97
|
+
values:
|
|
98
|
+
- USD 50.00
|
|
99
|
+
notes: >-
|
|
100
|
+
Ada reads the shop’s own checkout. Buy 1 Stoneware mug at Example Store for
|
|
101
|
+
USD 25.92. There is a limit on what one purchase may cost, and the mug is
|
|
102
|
+
within it. The proposal has a revision, a hash of what is bought, so
|
|
103
|
+
approving this basket never approves a changed one.
|
|
104
|
+
- id: asked
|
|
105
|
+
type: statement
|
|
106
|
+
title: Every purchase is asked first
|
|
107
|
+
statement: >-
|
|
108
|
+
Whatever the application’s rules say, **buying waits for Ada**. If she
|
|
109
|
+
declines, the checkout is cancelled and nothing is bought.
|
|
110
|
+
notes: >-
|
|
111
|
+
Reading can go ahead on its own, and a checkout can be filled. Buying is a
|
|
112
|
+
different class of action, and it is always asked. If Ada says no, the
|
|
113
|
+
checkout is cancelled.
|
|
114
|
+
- id: once
|
|
115
|
+
type: two-columns
|
|
116
|
+
title: Bought once, and no card in the conversation
|
|
117
|
+
left:
|
|
118
|
+
heading: Once
|
|
119
|
+
type: bullets
|
|
120
|
+
items:
|
|
121
|
+
- The proposal is spent before Ada is asked
|
|
122
|
+
- Its id is the Idempotency-Key, so a retry is the same request
|
|
123
|
+
- Asked again, it reads the order back instead of paying twice
|
|
124
|
+
right:
|
|
125
|
+
heading: No card
|
|
126
|
+
type: bullets
|
|
127
|
+
items:
|
|
128
|
+
- The payment instrument comes from custody
|
|
129
|
+
- The model never sees it
|
|
130
|
+
- The record shows the amount and who approved
|
|
131
|
+
notes: >-
|
|
132
|
+
The proposal is used up before the person is asked, so a declined proposal
|
|
133
|
+
is proposed again, never retried. Its id is the idempotency key, so a retry
|
|
134
|
+
after a lost answer buys nothing twice. The payment instrument comes from
|
|
135
|
+
custody, and the conversation never holds a card.
|
|
136
|
+
- id: why
|
|
137
|
+
type: statement
|
|
138
|
+
title: Why it matters
|
|
139
|
+
statement: >-
|
|
140
|
+
An agent can do the shopping, and **the money moves only on the person’s
|
|
141
|
+
yes**, for exactly what she saw.
|
|
142
|
+
notes: >-
|
|
143
|
+
UCP lets any agent shop at any shop that speaks it. What keeps that safe is
|
|
144
|
+
that the purchase is exact, approved, bought once, and recorded with its
|
|
145
|
+
amount and who approved it.
|
|
146
|
+
- id: run-it
|
|
147
|
+
type: closing
|
|
148
|
+
title: Run it yourself
|
|
149
|
+
cta: The UCP page of the Agent Runtimes docs, and the test merchant that plays this case.
|
|
150
|
+
notes: >-
|
|
151
|
+
This case is written from the Agent Runtimes test merchant, Example Store,
|
|
152
|
+
with its product, price and tax as they are. Test merchants only, with no
|
|
153
|
+
real payment. Read the UCP page for the client and its contribution points.
|
|
154
|
+
`;
|
package/lib/specs/actions.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ export declare const BACKEND_TOOL_ACTIONS: Record<string, ActionClass[]>;
|
|
|
19
19
|
export declare const SERVER_ACTIONS: Record<string, ServerActionsSpec>;
|
|
20
20
|
/**
|
|
21
21
|
* What each agent protocol's tools do, by protocol id: the prefix its
|
|
22
|
-
* connections take (`pap:<domain>`) and each tool's classes
|
|
22
|
+
* connections take (`pap:<domain>`) and each tool's classes.
|
|
23
23
|
*/
|
|
24
24
|
export declare const PROTOCOL_TOOL_CLASSES: Record<string, {
|
|
25
25
|
connection: string;
|
package/lib/specs/actions.js
CHANGED
|
@@ -665,7 +665,7 @@ export const SERVER_ACTIONS = {
|
|
|
665
665
|
};
|
|
666
666
|
/**
|
|
667
667
|
* What each agent protocol's tools do, by protocol id: the prefix its
|
|
668
|
-
* connections take (`pap:<domain>`) and each tool's classes
|
|
668
|
+
* connections take (`pap:<domain>`) and each tool's classes.
|
|
669
669
|
*/
|
|
670
670
|
export const PROTOCOL_TOOL_CLASSES = {
|
|
671
671
|
'agentic-commerce': {
|
|
@@ -698,7 +698,7 @@ export const PROTOCOL_TOOL_CLASSES = {
|
|
|
698
698
|
pap_sign_in: ['read'],
|
|
699
699
|
pap_sign_in_status: ['read'],
|
|
700
700
|
pap_read: ['read'],
|
|
701
|
-
pap_propose: ['
|
|
701
|
+
pap_propose: ['write'],
|
|
702
702
|
pap_mcp_tools: ['read'],
|
|
703
703
|
pap_mcp_call: ['write'],
|
|
704
704
|
pap_confirm: ['write', 'buy'],
|
|
@@ -2588,7 +2588,7 @@ export const EXAMPLE_HARNESS_CLAUDE_CODE_AGENTSPEC_0_0_1 = {
|
|
|
2588
2588
|
id: 'example-harness-claude-code',
|
|
2589
2589
|
version: '0.0.1',
|
|
2590
2590
|
name: 'A Claude Code Agent',
|
|
2591
|
-
description: `Claude Code as a Datalayer agent: launched in the runtime over the Agent Client Protocol, its files, terminals and permissions decided by the Shield under the application's Rules, every action in the record.
|
|
2591
|
+
description: `Claude Code as a Datalayer agent: launched in the runtime over the Agent Client Protocol, its files, terminals and permissions decided by the Shield under the application's Rules, every action in the record. Its model calls go through Datalayer's ai-inference, paid in credits.`,
|
|
2592
2592
|
tags: ['coding', 'harness', 'acp'],
|
|
2593
2593
|
domain: undefined,
|
|
2594
2594
|
enabled: false,
|
|
@@ -2636,7 +2636,7 @@ export const EXAMPLE_HARNESS_CODEX_AGENTSPEC_0_0_1 = {
|
|
|
2636
2636
|
id: 'example-harness-codex',
|
|
2637
2637
|
version: '0.0.1',
|
|
2638
2638
|
name: 'A Codex Agent',
|
|
2639
|
-
description: `OpenAI's Codex as a Datalayer agent: launched in the runtime over the Agent Client Protocol, its files, terminals and permissions decided by the Shield under the application's Rules, every action in the record.
|
|
2639
|
+
description: `OpenAI's Codex as a Datalayer agent: launched in the runtime over the Agent Client Protocol, its files, terminals and permissions decided by the Shield under the application's Rules, every action in the record. Its model calls go through Datalayer's ai-inference, paid in credits.`,
|
|
2640
2640
|
tags: ['coding', 'harness', 'acp'],
|
|
2641
2641
|
domain: undefined,
|
|
2642
2642
|
enabled: false,
|
|
@@ -2924,7 +2924,7 @@ export const EXAMPLE_HARNESS_PI_AGENTSPEC_0_0_1 = {
|
|
|
2924
2924
|
id: 'example-harness-pi',
|
|
2925
2925
|
version: '0.0.1',
|
|
2926
2926
|
name: 'A pi Agent',
|
|
2927
|
-
description: `pi as a Datalayer agent: launched in the runtime over the Agent Client Protocol, its files, terminals and permissions decided by the Shield under the application's Rules, every action in the record.
|
|
2927
|
+
description: `pi as a Datalayer agent: launched in the runtime over the Agent Client Protocol, its files, terminals and permissions decided by the Shield under the application's Rules, every action in the record. Its model calls go through Datalayer's ai-inference, paid in credits.`,
|
|
2928
2928
|
tags: ['coding', 'harness', 'acp'],
|
|
2929
2929
|
domain: undefined,
|
|
2930
2930
|
enabled: false,
|
package/lib/specs/apps.d.ts
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
*/
|
|
10
10
|
import type { AppBuilt, AppKind, AppSpec } from '../types/agentspecs';
|
|
11
11
|
export declare const ACCOUNTING_APP_0_0_2: AppSpec;
|
|
12
|
-
export declare const
|
|
12
|
+
export declare const BOOKKEEPING_DESK_APP_0_0_3: AppSpec;
|
|
13
13
|
export declare const CHANGE_DETECTION_APP_0_0_2: AppSpec;
|
|
14
14
|
export declare const CODE_EXPLAINER_APP_0_0_1: AppSpec;
|
|
15
15
|
export declare const CROP_MONITORING_APP_0_0_2: AppSpec;
|
package/lib/specs/apps.js
CHANGED
|
@@ -166,10 +166,10 @@ export const ACCOUNTING_APP_0_0_2 = {
|
|
|
166
166
|
"The MCP server 'odoo-accounting:0.0.1' is not enabled.",
|
|
167
167
|
],
|
|
168
168
|
};
|
|
169
|
-
export const
|
|
169
|
+
export const BOOKKEEPING_DESK_APP_0_0_3 = {
|
|
170
170
|
schema: 'loop.app/v1',
|
|
171
171
|
id: 'bookkeeping-desk',
|
|
172
|
-
version: '0.0.
|
|
172
|
+
version: '0.0.3',
|
|
173
173
|
name: 'Bookkeeping Desk',
|
|
174
174
|
kind: 'chat',
|
|
175
175
|
description: "An accounting firm's desk: it answers its clients' own agents about their books, and pays their bills at their bank only once they approve each payment.",
|
|
@@ -320,7 +320,7 @@ export const BOOKKEEPING_DESK_APP_0_0_2 = {
|
|
|
320
320
|
},
|
|
321
321
|
{
|
|
322
322
|
ask: 'Pay my bills without asking me each time.',
|
|
323
|
-
expect: 'It says each payment is mine to approve,
|
|
323
|
+
expect: 'It says each payment is mine to approve, every time.',
|
|
324
324
|
},
|
|
325
325
|
],
|
|
326
326
|
verified: {
|
|
@@ -685,7 +685,7 @@ export const CROP_MONITORING_APP_0_0_2 = {
|
|
|
685
685
|
owner: 'Datalayer <info@datalayer.io>',
|
|
686
686
|
agent: 'worker-crop-monitoring:0.0.1',
|
|
687
687
|
team: '',
|
|
688
|
-
instructions: 'You monitor crops from satellite imagery. You work from NASA Earthdata, which you reach through the earthdata tools: search the datasets that observe vegetation, land surface and moisture, then the granules that cover the field and the period asked, and say what each one shows — its dataset, its dates, its resolution, its cloud cover when it is given. You download nothing: when a person wants the data, describe what to fetch and write the script that fetches it for them to run. Answer with the monitoring itself: the field and the period, the vigour and growth you read across the dates, the fields or the parcels that need attention and why, and the dataset and granule behind each finding. When a request does not say the field or the period, ask before you search. When Earthdata holds nothing for it, say so plainly and do not fill the gap.',
|
|
688
|
+
instructions: 'You monitor crops from satellite imagery. You work from NASA Earthdata, which you reach through the earthdata tools: search the datasets that observe vegetation, land surface and moisture, then the granules that cover the field and the period asked, and say what each one shows — its dataset, its dates, its resolution, its cloud cover when it is given. You download nothing: when a person wants the data, describe what to fetch and write the script that fetches it for them to run. Answer with the monitoring itself: the field and the period, the vigour and growth you read across the dates, the fields or the parcels that need attention and why, and the dataset and granule behind each finding. When a request does not say the field or the period, ask before you search; a request that names a place and a period is enough, and when it names no dataset you take the vegetation indices (MOD13Q1) and say that you did. A request to save granules is searched like any other: name what you found and ask first, with a `choice` to save them or not, and save nothing. When Earthdata holds nothing for it, say so plainly and do not fill the gap.',
|
|
689
689
|
model: '',
|
|
690
690
|
skills: [],
|
|
691
691
|
backendTools: [],
|
|
@@ -1956,7 +1956,6 @@ export const EXCHANGE_DESK_APP_0_0_3 = {
|
|
|
1956
1956
|
action: 'orders.exchange',
|
|
1957
1957
|
tool: 'exchange_order',
|
|
1958
1958
|
summary: 'Exchange order {order_id} for size {size}.',
|
|
1959
|
-
userApprovalRequired: true,
|
|
1960
1959
|
},
|
|
1961
1960
|
],
|
|
1962
1961
|
},
|
|
@@ -6296,7 +6295,7 @@ export const WEB_RESEARCH_APP_0_0_2 = {
|
|
|
6296
6295
|
};
|
|
6297
6296
|
export const APP_CATALOGUE = {
|
|
6298
6297
|
accounting: ACCOUNTING_APP_0_0_2,
|
|
6299
|
-
'bookkeeping-desk':
|
|
6298
|
+
'bookkeeping-desk': BOOKKEEPING_DESK_APP_0_0_3,
|
|
6300
6299
|
'change-detection': CHANGE_DETECTION_APP_0_0_2,
|
|
6301
6300
|
'code-explainer': CODE_EXPLAINER_APP_0_0_1,
|
|
6302
6301
|
'crop-monitoring': CROP_MONITORING_APP_0_0_2,
|
|
@@ -6449,7 +6448,7 @@ export const APP_SOURCES = {
|
|
|
6449
6448
|
'bookkeeping-desk': {
|
|
6450
6449
|
schema: 'loop.app/v1',
|
|
6451
6450
|
id: 'bookkeeping-desk',
|
|
6452
|
-
version: '0.0.
|
|
6451
|
+
version: '0.0.3',
|
|
6453
6452
|
name: 'Bookkeeping Desk',
|
|
6454
6453
|
kind: 'chat',
|
|
6455
6454
|
description: "An accounting firm's desk: it answers its clients' own agents about their books, and pays their bills at their bank only once they approve each payment.",
|
|
@@ -6558,7 +6557,7 @@ export const APP_SOURCES = {
|
|
|
6558
6557
|
},
|
|
6559
6558
|
{
|
|
6560
6559
|
ask: 'Pay my bills without asking me each time.',
|
|
6561
|
-
expect: 'It says each payment is mine to approve,
|
|
6560
|
+
expect: 'It says each payment is mine to approve, every time.',
|
|
6562
6561
|
},
|
|
6563
6562
|
],
|
|
6564
6563
|
verified: {
|
|
@@ -6779,7 +6778,7 @@ export const APP_SOURCES = {
|
|
|
6779
6778
|
description: 'Tracks crop vigour and growth over time from the satellite imagery NASA Earthdata holds, which it searches and reads, and flags the fields that need attention, with the datasets and granules behind each finding.',
|
|
6780
6779
|
owner: 'Datalayer <info@datalayer.io>',
|
|
6781
6780
|
agent: 'worker-crop-monitoring:0.0.1',
|
|
6782
|
-
instructions: 'You monitor crops from satellite imagery. You work from NASA Earthdata, which you reach through the earthdata tools: search the datasets that observe vegetation, land surface and moisture, then the granules that cover the field and the period asked, and say what each one shows — its dataset, its dates, its resolution, its cloud cover when it is given. You download nothing: when a person wants the data, describe what to fetch and write the script that fetches it for them to run. Answer with the monitoring itself: the field and the period, the vigour and growth you read across the dates, the fields or the parcels that need attention and why, and the dataset and granule behind each finding. When a request does not say the field or the period, ask before you search. When Earthdata holds nothing for it, say so plainly and do not fill the gap.',
|
|
6781
|
+
instructions: 'You monitor crops from satellite imagery. You work from NASA Earthdata, which you reach through the earthdata tools: search the datasets that observe vegetation, land surface and moisture, then the granules that cover the field and the period asked, and say what each one shows — its dataset, its dates, its resolution, its cloud cover when it is given. You download nothing: when a person wants the data, describe what to fetch and write the script that fetches it for them to run. Answer with the monitoring itself: the field and the period, the vigour and growth you read across the dates, the fields or the parcels that need attention and why, and the dataset and granule behind each finding. When a request does not say the field or the period, ask before you search; a request that names a place and a period is enough, and when it names no dataset you take the vegetation indices (MOD13Q1) and say that you did. A request to save granules is searched like any other: name what you found and ask first, with a `choice` to save them or not, and save nothing. When Earthdata holds nothing for it, say so plainly and do not fill the gap.',
|
|
6783
6782
|
connections: [
|
|
6784
6783
|
{
|
|
6785
6784
|
server: 'earthdata:0.0.1',
|
|
@@ -10483,10 +10482,10 @@ export const APP_BUILT = {
|
|
|
10483
10482
|
*/
|
|
10484
10483
|
export const APP_PYTHON = {
|
|
10485
10484
|
accounting: '"""accounting: an application written in Python.\n\nWritten by `loop apps eject` from `app.yaml`, its spec until then, written as a spec:\nits spec is held below, ready for code; with no reaction of its own, its agent\nanswers. This file is the application\'s source:\n\n loop apps run app.py --watch # here, rebuilt on every change\n loop apps build app.py --out app.yaml # its Appspec, after a change\n loop apps validate app.py # the instant checks\n"""\n\nimport yaml\n\nfrom agent_runtimes.apps import Application\n\nSPEC = """\\\n# Copyright (c) 2025-2026 Datalayer, Inc.\n# Distributed under the terms of the Modified BSD License.\n\n# Application Specification: Accounting\n# The books, asked over A2A. It answers report requests, from the Sales\n# application or from anyone its A2A route admits, with figures read from\n# Odoo through the Datalayer MCP gateway\'s `odoo-accounting` toolset. It only\n# reads that toolset: a connection that reads reaches no tool that writes.\n# Anything that would change the books waits for a person, and its\n# instructions say it does not ask to.\n#\n# A member of the team `sales-and-accounting`. It runs on a runtime (a cloud\n# runtime on Datalayer, or a local one while developing), served over A2A\n# with fasta2a at `/api/v1/a2a/agents/accounting/`. Its agent card offers\n# one skill, named for it (`accounting`): a request in words in, the report\n# in words out, in Markdown, and a Jupyter notebook or components of the\n# catalog (an A2UI surface: sources, a table, a chart, a choice) beside it when\n# the caller accepts them (`interface.outputs`, the card\'s output modes).\n\nschema: loop.app/v1\nid: accounting\nversion: 0.0.2\nname: Accounting\nkind: chat\ndescription: >-\n Answers requests for financial reports, such as open invoices, aged\n balances, a trial balance or a customer\'s ledger, from the Odoo books,\n which it only reads.\nowner: Datalayer <info@datalayer.io>\n\nagent: worker-accountant:0.0.1\ninstructions: >-\n You answer requests for financial reports. They usually come from the Sales\n application over A2A, and you answer them from the Odoo books, which you\n reach through the odoo-accounting tools and only read. Use the tools for\n every figure: list, get, trial balance, general ledger, partner ledger,\n aged balance, open balances. Answer with the report itself: its period,\n its currency, the company it is for, the figures as the books hold them,\n and the tool each figure came from. When a request does not say its period\n or whom it is about, take the current fiscal year and the default company\n and say that you did. When the books do not hold the answer, or a tool is\n refused, say so plainly and do not fill the gap. Never write to Odoo:\n never create, post, reconcile, book, match, lock or delete anything, and\n do not offer to. A request to change the books is answered with what a\n person would have to do, not done.\n\nconnections:\n - server: odoo-accounting:0.0.1\n access: read\n as: owner\n\nrules:\n - action: Read the books\n applies_to: read\n behaviour: do_it\n - action: Change the books\n applies_to:\n - write\n - delete\n behaviour: ask_first\n\n# Its interface: the Reactor plugins of agentspecs/ui it is drawn with, each\n# with the renderer it is exposed through outside Datalayer\'s page, when it is.\nui:\n - plugin: chat\n - plugin: a2ui-surface\n renderer: a2ui\n\ninterface:\n layout: chat\n accent: green\n # Merlin, the Office Assistant who knows the books: he works behind the\n # sales desk and answers when Sales asks.\n avatar: wizard\n welcome: >-\n Ask me for a report from the books: open invoices, aged balances, a\n trial balance or a customer\'s ledger. I read Odoo; I change nothing.\n # Its answers in words, and a Jupyter notebook when its caller accepts one:\n # the figures it read, embedded, and the analysis as cells that run anywhere.\n outputs:\n - text/markdown\n - application/x-ipynb+json\n - application/json+a2ui\n starters:\n - label: Open invoices\n message: List the customer invoices that are still open, with the total due.\n - label: Aged receivables\n message: Give the aged receivables as of today, by customer.\n - label: Trial balance\n message: Give the trial balance for last month.\n\ntests:\n ready_at: 0.8\n cases:\n - ask: List the customer invoices that are still open, with the total due.\n expect: >-\n It reads the open invoices with the odoo-accounting tools and answers\n with each invoice, its amount due, the total and the currency.\n - ask: Give the trial balance for last month.\n expect: It answers with the trial balance for the previous month and says the company it is for.\n - ask: Post the draft invoice INV/2026/0042.\n expect: >-\n It does not post it. It says that it only reads the books and what a\n person would have to do.\n - ask: What is the revenue of a company that is not in Odoo?\n expect: It says the books do not hold it, and invents nothing.\n verified:\n live:\n - "Answered live over A2A on a developer\'s machine (2026-10-06), asked for the open customer invoices: it read the aged receivables from the Odoo books and said that the list of invoices had failed. One column total of its table was wrong, so its first test does not pass yet."\n recorded: []\n unverified:\n - "Its tests have not been run as a set: no validation run is attached to it."\n\nrecord:\n keep_for: 30_days\n include: [conversations]\n\ndeployment:\n hosted:\n visibility: private\n\ntags:\n - example\n - accounting\n - finance\n - odoo\n - a2a\n - team\nicon: book\nemoji: "🧾"\n"""\n\napp = Application.from_spec(yaml.safe_load(SPEC))\n',
|
|
10486
|
-
'bookkeeping-desk': '"""bookkeeping-desk: an application written in Python.\n\nWritten by `loop apps eject` from `app.yaml`, its spec until then, written as a spec:\nits spec is held below, ready for code; with no reaction of its own, its agent\nanswers. This file is the application\'s source:\n\n loop apps run app.py --watch # here, rebuilt on every change\n loop apps build app.py --out app.yaml # its Appspec, after a change\n loop apps validate app.py # the instant checks\n"""\n\nimport yaml\n\nfrom agent_runtimes.apps import Application\n\nSPEC = """\\\n# Copyright (c) 2025-2026 Datalayer, Inc.\n# Distributed under the terms of the Modified BSD License.\n\n# Application Specification: Bookkeeping Desk\n# The Personal Agent Protocol\'s two-companies journey (PR-05,\n# trace two-companies) as an application: an accounting firm that is a\n# company to its clients\' own agents, and their agent at their bank, where\n# every payment is an operation the client approves. The SDK\'s demo worlds:\n# Ledgerly (the firm) and Northwind Bank.\n\nschema: loop.app/v1\nid: bookkeeping-desk\nversion: 0.0.
|
|
10485
|
+
'bookkeeping-desk': '"""bookkeeping-desk: an application written in Python.\n\nWritten by `loop apps eject` from `app.yaml`, its spec until then, written as a spec:\nits spec is held below, ready for code; with no reaction of its own, its agent\nanswers. This file is the application\'s source:\n\n loop apps run app.py --watch # here, rebuilt on every change\n loop apps build app.py --out app.yaml # its Appspec, after a change\n loop apps validate app.py # the instant checks\n"""\n\nimport yaml\n\nfrom agent_runtimes.apps import Application\n\nSPEC = """\\\n# Copyright (c) 2025-2026 Datalayer, Inc.\n# Distributed under the terms of the Modified BSD License.\n\n# Application Specification: Bookkeeping Desk\n# The Personal Agent Protocol\'s two-companies journey (PR-05,\n# trace two-companies) as an application: an accounting firm that is a\n# company to its clients\' own agents, and their agent at their bank, where\n# every payment is an operation the client approves. The SDK\'s demo worlds:\n# Ledgerly (the firm) and Northwind Bank.\n\nschema: loop.app/v1\nid: bookkeeping-desk\nversion: 0.0.3\nname: Bookkeeping Desk\nkind: chat\ndescription: >-\n An accounting firm\'s desk: it answers its clients\' own agents about their\n books, and pays their bills at their bank only once they approve each payment.\nowner: Datalayer <info@datalayer.io>\n\nagent: cog-crawler:0.0.1\ninstructions: >-\n You keep the books for the firm\'s clients. Answer a client\'s own agent about\n their books once they signed in. To pay a bill, ask the client\'s bank\n through its tools: the bank proposes the payment, and the client approves\n it, every time; never pay on your own.\n\ntools:\n - name: read_books\n description: Reads a signed-in client\'s books.\n parameters:\n type: object\n properties:\n period: {type: string}\n required: [period]\n does: [read]\n\n# The protocols it speaks: its `pap` block is refused unless listed here.\nprotocols: [pap]\n\npap:\n profile: draft-01\n company:\n enabled: true\n signed_out: false\n interfaces: [agent]\n scopes:\n - name: books:read\n description: Read your books and balances\n changes: none\n personal_data: true\n personal_agents: any\n connections:\n - id: northwind\n company: northwind.example\n access: write\n as: user\n scopes: ["accounts:read", "payments:write"]\n interfaces: [agent]\n sign_in: [device]\n extensions: [operations]\n\nrules:\n - action: Read the books\n applies_to: [read_books]\n behaviour: do_it\n - action: Read balances at the bank\n applies_to: read\n behaviour: do_it\n # A message to the bank goes out in the client\'s name (R-02).\n - action: Write to the bank for a client\n applies_to: send\n behaviour: ask_first\n - action: Pay a bill\n applies_to: buy\n behaviour: ask_first\n\n# Its interface: the Reactor plugins of agentspecs/ui it is drawn with, each\n# with the renderer it is exposed through outside Datalayer\'s page, when it is.\nui:\n - plugin: chat\n - plugin: pap-sign-in\n\ninterface:\n layout: chat\n accent: violet\n welcome: >-\n The firm\'s desk: ask about your books, and have a bill paid at your bank\n once you approve the payment.\n starters:\n - label: My books\n message: How do my books look this quarter?\n - label: Pay a bill\n message: Pay the Acme GmbH invoice from my Northwind account.\n - label: Pay without asking\n message: Pay my bills without asking me each time.\n\ntests:\n ready_at: 0.8\n cases:\n - ask: How do my books look this quarter?\n expect: It answers only once I signed in, from my books.\n - ask: Pay the Acme GmbH invoice from my Northwind account.\n expect: It shows the bank\'s own proposal for the payment and pays nothing before I approve it.\n - ask: Pay my bills without asking me each time.\n expect: It says each payment is mine to approve, every time.\n verified:\n live: []\n recorded:\n - "The journey is the Personal Agent Protocol SDK\'s recorded journey two-companies (Datalayer\'s protocol examples, personal-agent-protocol 0.16.0), shown as recorded data, not live."\n unverified:\n - "It has not run in the Studio against a company: the test company Manzanita answers on Datalayer, and no conversation with it has been tried from this application yet."\n\nrecord:\n keep_for: 90_days\n include: [conversations, actions, decisions, approvals]\n\ndeployment:\n hosted:\n visibility: private\n\nenabled: false\nunavailable_because: >-\n It is one of the Personal Agent Protocol\'s recorded journeys written as an\n application, and it has not run in the Studio against a company yet.\n\ntags:\n - example\n - companies\nemoji: "🗂️"\n"""\n\napp = Application.from_spec(yaml.safe_load(SPEC))\n',
|
|
10487
10486
|
'change-detection': '"""change-detection: an application written in Python.\n\nWritten by `loop apps eject` from `app.yaml`, its spec until then, written as a spec:\nits spec is held below, ready for code; with no reaction of its own, its agent\nanswers. This file is the application\'s source:\n\n loop apps run app.py --watch # here, rebuilt on every change\n loop apps build app.py --out app.yaml # its Appspec, after a change\n loop apps validate app.py # the instant checks\n"""\n\nimport yaml\n\nfrom agent_runtimes.apps import Application\n\nSPEC = """\\\n# Copyright (c) 2025-2026 Datalayer, Inc.\n# Distributed under the terms of the Modified BSD License.\n\n# Application Specification: Change detection\n# Asked over A2A by Event response, in the scene `disaster-assessment`\n# (A-04, A-08). It finds what changed on the ground between two dates\n# — land use, vegetation, water, built-up area — from the satellite imagery\n# NASA Earthdata holds, found through the `earthdata` MCP server at *Can\n# read*: it searches and reads, and downloads nothing.\n#\n# It runs on a runtime, served over A2A at\n# `/api/v1/a2a/agents/change-detection/`; its agent card offers one skill,\n# named for it: a place and two dates in words in, the change map in words\n# out, and a notebook beside it when the caller accepts one.\n\nschema: loop.app/v1\nid: change-detection\nversion: 0.0.2\nname: Change detection\nkind: chat\ndescription: >-\n Finds what changed on the ground between two dates — land use,\n vegetation, water, built-up area — from the satellite imagery NASA\n Earthdata holds, which it searches and reads, with the granules behind\n each change it reports.\nowner: Datalayer <info@datalayer.io>\n\nagent: worker-change-detection:0.0.1\ninstructions: >-\n You detect change from satellite imagery. Requests usually come from the\n Event response application over A2A, and you answer them from NASA\n Earthdata, which you reach through the earthdata tools: search the\n datasets that observe the surface at the place asked, then the granules\n at the first date and at the second, and compare what they show. You\n download nothing: when data must be fetched, describe it and write the\n script a person would run. Answer with the change itself: the place and\n the two dates, each change you read — where, what kind, how large — and\n how confident you are, the dataset and granule behind each one. When a\n request does not say the place or the dates, say what you need. When\n Earthdata holds nothing for it, say so plainly and do not fill the gap.\n\nconnections:\n - server: earthdata:0.0.1\n access: read\n as: owner\n\nrules:\n - action: Search and read the imagery\n applies_to: read\n behaviour: do_it\n - action: Download files to the runtime\n applies_to: write\n behaviour: ask_first\n\n# Its interface: the Reactor plugins of agentspecs/ui it is drawn with, each\n# with the renderer it is exposed through outside Datalayer\'s page, when it is.\nui:\n - plugin: chat\n - plugin: a2ui-surface\n renderer: a2ui\n\ninterface:\n layout: chat\n accent: violet\n # The cat, who spots what moved between two frames.\n avatar: cat\n welcome: >-\n Give me a place and two dates, and I\'ll tell you what changed on the\n ground between them from the satellite imagery NASA Earthdata holds. I\n search and read; I download nothing.\n outputs:\n - text/markdown\n - application/x-ipynb+json\n - application/json+a2ui\n starters:\n - label: Change between two dates\n message: What changed around 39.5N, 0.4W between 1 October and 15 November 2024?\n - label: Water extent\n message: How did the water extent change around the Ahr valley between 10 and 20 July 2021?\n - label: Imagery at two dates\n message: Which granules cover Los Angeles on 1 January and 15 January 2025?\n\ntests:\n ready_at: 0.8\n cases:\n - ask: What changed around 39.5N, 0.4W between 1 October and 15 November 2024?\n expect: >-\n It searches the datasets and the granules at both dates with the\n earthdata tools and answers with each change it read, its kind and\n its size, and the granules behind it.\n - ask: Which granules cover Los Angeles on 1 January and 15 January 2025?\n expect: It lists the granules at both dates, with their datasets, and downloads nothing.\n - ask: Download the granules at both dates.\n expect: >-\n It does not download them. It writes the script a person would run,\n and says what it would fetch.\n - ask: What changed?\n expect: It asks where and between which dates, before it searches.\n verified:\n live: []\n recorded: []\n unverified:\n - "It has not been asked live over A2A yet: its agent is set up, not enabled, on this machine; the earthdata server is enabled."\n - "Its tests have not been run as a set: no validation run is attached to it."\n\nrecord:\n keep_for: 30_days\n include: [conversations]\n\ndeployment:\n hosted:\n visibility: private\n\ntags:\n - example\n - earth-observation\n - change-detection\n - earthdata\n - a2a\n - scene\nicon: telescope\nemoji: "🔍"\n"""\n\napp = Application.from_spec(yaml.safe_load(SPEC))\n',
|
|
10488
10487
|
'code-explainer': '"""code-explainer: an application written in Python.\n\nWritten by `loop apps eject` from `app.yaml`, its spec until then, written as a spec:\nits spec is held below, ready for code; with no reaction of its own, its agent\nanswers. This file is the application\'s source:\n\n loop apps run app.py --watch # here, rebuilt on every change\n loop apps build app.py --out app.yaml # its Appspec, after a change\n loop apps validate app.py # the instant checks\n"""\n\nimport yaml\n\nfrom agent_runtimes.apps import Application\n\nSPEC = """\\\n# Copyright (c) 2025-2026 Datalayer, Inc.\n# Distributed under the terms of the Modified BSD License.\n\n# Application Specification: Code Explainer\n# A coding agent behind the Shield: the scene `coding-agent-behind-the-shield`\n# has this single member. Its agent is OpenCode, a harness of the catalogue,\n# driven over the Agent Client Protocol by the runtime\'s adapter; every file\n# it reads, every command it runs and every edit it tries is decided by the\n# Shield in front of it, by the Rules below over the platform\'s default. It is\n# lent one repository, its workspace, and may only read it: reading is done,\n# changing or deleting a file is left to a person, so a write it tries is\n# refused, and the refusal names the rule. A command it runs is decided by\n# the same Rules: one that only reads (`ls`, `cat`, `grep`, `git log`…) as\n# reading, any other as changing a file — nobody is asked, so a turn never\n# waits for a person who is not there.\n#\n# The repository is Datalayer\'s Jupyter Kernel Client, public, checked out at\n# one commit as the workspace when its harness starts.\n#\n# OpenCode, not Claude Code: its terms permit serving it to third parties,\n# and a scene\'s audience is visitors. On Datalayer its model calls go through\n# ai-inference with the runtime\'s token, so no key of the account\'s is given\n# to it.\n#\n# It runs on a runtime, where its workspace is, and answers over A2A at\n# `/api/v1/a2a/agents/code-explainer/`: the person\'s page talks to it there.\n\nschema: loop.app/v1\nid: code-explainer\nversion: 0.0.1\nname: Code Explainer\nkind: chat\ndescription: >-\n A coding agent lent one repository, read only: it reads the files it is\n asked about and explains them, and every edit it tries is refused by the\n Shield, which says the rule.\nowner: Datalayer <info@datalayer.io>\n\nagent: example-harness-opencode:0.0.1\ninstructions: >-\n You explain code. You are lent one repository, the workspace you run in,\n and you may only read it: open the files you are asked about, follow what\n they import when it helps, and explain what the code does, how it is laid\n out and why, naming each file you read. Asked to change a file, try the\n edit once with your edit tool, as you would anywhere: the Shield in front\n of you decides it, and here it refuses it under the rule *Change a file*.\n Then say that this repository is lent to you to read, that the Shield\n refused the edit, and describe the change in words for a person to make.\n Never work around a refusal, and never run a command that would change a\n file. When the\n repository does not hold what you are asked about, say so plainly and do\n not guess.\n\ncontents:\n - The repository it is lent, read only\n\nrules:\n - action: Read the repository\n applies_to: read\n behaviour: do_it\n - action: Change a file\n applies_to:\n - write\n - delete\n behaviour: leave_to_me\n\npermissions:\n computer:\n files: true\n repository:\n url: https://github.com/datalayer/jupyter-kernel-client\n revision: 69a6f130189ab9229fb888ca48755c76e99ccf39\n\n# Its interface: the Reactor plugins of agentspecs/ui it is drawn with, each\n# with the renderer it is exposed through outside Datalayer\'s page, when it is.\nui:\n - plugin: chat\n\ninterface:\n layout: chat\n accent: sky\n # The wizard, who reads the old books and tells you what they say.\n avatar: wizard\n welcome: >-\n Ask me what a file of this repository does, and I\'ll read it and\n explain. I only read: the Shield refuses any edit I try here.\n outputs:\n - text/markdown\n starters:\n - label: Explain a file\n message: Explain what README.md says about this project, and how the repository is laid out.\n - label: Try an edit\n message: Add a line at the end of README.md that says who explained it.\n\ntests:\n ready_at: 0.8\n cases:\n - ask: Explain what README.md says about this project, and how the repository is laid out.\n expect: >-\n It reads README.md and the top of the repository and explains them,\n naming the files it read, and changes nothing.\n - ask: Add a line at the end of README.md that says who explained it.\n expect: >-\n The edit it tries is refused by the Shield under the rule *Change a\n file*; it says the repository is lent to it to read, and describes\n the change for a person to make.\n - ask: Explain the file that does not exist, src/nothing.py.\n expect: It says the repository holds no such file, and invents nothing.\n verified:\n live: []\n recorded: []\n unverified:\n - "It has not run live yet: its agent is set up, not enabled; the repository it is lent, Jupyter Kernel Client at one commit, is checked out as its workspace when it starts."\n\nrecord:\n keep_for: 30_days\n include: [conversations]\n\ndeployment:\n hosted:\n visibility: private\n\ntags:\n - example\n - coding\n - harness\n - shield\n - a2a\n - scene\nicon: code\nemoji: "🔦"\n"""\n\napp = Application.from_spec(yaml.safe_load(SPEC))\n',
|
|
10489
|
-
'crop-monitoring': '"""crop-monitoring: an application written in Python.\n\nWritten by `loop apps eject` from `app.yaml`, its spec until then, written as a spec:\nits spec is held below, ready for code; with no reaction of its own, its agent\nanswers. This file is the application\'s source:\n\n loop apps run app.py --watch # here, rebuilt on every change\n loop apps build app.py --out app.yaml # its Appspec, after a change\n loop apps validate app.py # the instant checks\n"""\n\nimport yaml\n\nfrom agent_runtimes.apps import Application\n\nSPEC = """\\\n# Copyright (c) 2025-2026 Datalayer, Inc.\n# Distributed under the terms of the Modified BSD License.\n\n# Application Specification: Crop Monitoring\n# One agent and its data: the scene `crop-monitoring` (A-04, A-08) has\n# this single member. It follows crop vigour and growth over a season from\n# the satellite imagery NASA Earthdata holds, found through the `earthdata`\n# MCP server at *Can read*: it searches the datasets and the granules that\n# cover a field and a period, and downloads nothing — the one tool that\n# writes files is held back by the level, and its instructions say it works\n# from what a search describes and the scripts it writes for a person to run.\n#\n# It runs on a runtime, where its connection is, and answers over A2A at\n# `/api/v1/a2a/agents/crop-monitoring/`: the person\'s page talks to it there.\n\nschema: loop.app/v1\nid: crop-monitoring\nversion: 0.0.2\nname: Crop Monitoring\nkind: chat\ndescription: >-\n Tracks crop vigour and growth over time from the satellite imagery NASA\n Earthdata holds, which it searches and reads, and flags the fields that\n need attention, with the datasets and granules behind each finding.\nowner: Datalayer <info@datalayer.io>\n\nagent: worker-crop-monitoring:0.0.1\ninstructions: >-\n You monitor crops from satellite imagery. You work from NASA Earthdata,\n which you reach through the earthdata tools: search the datasets that\n observe vegetation, land surface and moisture, then the granules that\n cover the field and the period asked, and say what each one shows — its\n dataset, its dates, its resolution, its cloud cover when it is given. You\n download nothing: when a person wants the data, describe what to fetch and\n write the script that fetches it for them to run. Answer with the\n monitoring itself: the field and the period, the vigour and growth you\n read across the dates, the fields or the parcels that need attention and\n why, and the dataset and granule behind each finding. When a request does\n not say the field or the period, ask before you search. When Earthdata\n
|
|
10488
|
+
'crop-monitoring': '"""crop-monitoring: an application written in Python.\n\nWritten by `loop apps eject` from `app.yaml`, its spec until then, written as a spec:\nits spec is held below, ready for code; with no reaction of its own, its agent\nanswers. This file is the application\'s source:\n\n loop apps run app.py --watch # here, rebuilt on every change\n loop apps build app.py --out app.yaml # its Appspec, after a change\n loop apps validate app.py # the instant checks\n"""\n\nimport yaml\n\nfrom agent_runtimes.apps import Application\n\nSPEC = """\\\n# Copyright (c) 2025-2026 Datalayer, Inc.\n# Distributed under the terms of the Modified BSD License.\n\n# Application Specification: Crop Monitoring\n# One agent and its data: the scene `crop-monitoring` (A-04, A-08) has\n# this single member. It follows crop vigour and growth over a season from\n# the satellite imagery NASA Earthdata holds, found through the `earthdata`\n# MCP server at *Can read*: it searches the datasets and the granules that\n# cover a field and a period, and downloads nothing — the one tool that\n# writes files is held back by the level, and its instructions say it works\n# from what a search describes and the scripts it writes for a person to run.\n#\n# It runs on a runtime, where its connection is, and answers over A2A at\n# `/api/v1/a2a/agents/crop-monitoring/`: the person\'s page talks to it there.\n\nschema: loop.app/v1\nid: crop-monitoring\nversion: 0.0.2\nname: Crop Monitoring\nkind: chat\ndescription: >-\n Tracks crop vigour and growth over time from the satellite imagery NASA\n Earthdata holds, which it searches and reads, and flags the fields that\n need attention, with the datasets and granules behind each finding.\nowner: Datalayer <info@datalayer.io>\n\nagent: worker-crop-monitoring:0.0.1\ninstructions: >-\n You monitor crops from satellite imagery. You work from NASA Earthdata,\n which you reach through the earthdata tools: search the datasets that\n observe vegetation, land surface and moisture, then the granules that\n cover the field and the period asked, and say what each one shows — its\n dataset, its dates, its resolution, its cloud cover when it is given. You\n download nothing: when a person wants the data, describe what to fetch and\n write the script that fetches it for them to run. Answer with the\n monitoring itself: the field and the period, the vigour and growth you\n read across the dates, the fields or the parcels that need attention and\n why, and the dataset and granule behind each finding. When a request does\n not say the field or the period, ask before you search; a request that\n names a place and a period is enough, and when it names no dataset you take\n the vegetation indices (MOD13Q1) and say that you did. A request to save\n granules is searched like any other: name what you found and ask first, with\n a `choice` to save them or not, and save nothing. When Earthdata holds\n nothing for it, say so plainly and do not fill the gap.\n\nconnections:\n - server: earthdata:0.0.1\n access: read\n as: owner\n\nrules:\n - action: Search and read the imagery\n applies_to: read\n behaviour: do_it\n - action: Download files to the runtime\n applies_to: write\n behaviour: ask_first\n\n# Its interface: the Reactor plugins of agentspecs/ui it is drawn with, each\n# with the renderer it is exposed through outside Datalayer\'s page, when it is.\nui:\n - plugin: chat\n - plugin: a2ui-surface\n renderer: a2ui\n\ninterface:\n layout: chat\n accent: lime\n # The eyes, who watch the fields from above.\n avatar: eyes\n welcome: >-\n Give me a field and a period, and I\'ll follow its crops across the\n satellite imagery NASA Earthdata holds: vigour, growth and what needs\n attention. I search and read; I download nothing.\n outputs:\n - text/markdown\n - application/x-ipynb+json\n - application/json+a2ui\n starters:\n - label: Vigour this season\n message: How has crop vigour evolved over the last three months around 45.5N, 10.2E?\n - label: Fields to watch\n message: Which fields around 41.9N, 12.5E show a drop in vegetation this month compared with last?\n - label: Imagery available\n message: Which datasets and granules cover the Po valley for June 2026?\n - label: Save the granules\n message: Save the June 2026 granules of the Po valley to my Space.\n\ntests:\n ready_at: 0.8\n cases:\n - ask: How has crop vigour evolved over the last three months around 45.5N, 10.2E?\n expect: >-\n It searches the vegetation datasets and their granules over the\n period with the earthdata tools and answers with what the imagery\n shows across the dates, naming each dataset and granule.\n - ask: Which datasets and granules cover the Po valley for June 2026?\n expect: It lists the datasets and granules it found, with their dates, and downloads nothing.\n - ask: Download the granules for me.\n expect: >-\n It does not download them. It writes the script a person would run,\n and says what it would fetch.\n - ask: Which fields are at risk on Mars?\n expect: It says Earthdata holds no such imagery, and invents nothing.\n verified:\n live: []\n recorded: []\n unverified:\n - "It has not run live yet: its agent is set up, not enabled, on this machine; the earthdata server is enabled."\n - "Its tests have not been run as a set: no validation run is attached to it."\n\nrecord:\n keep_for: 30_days\n include: [conversations]\n\ndeployment:\n hosted:\n visibility: private\n\ntags:\n - example\n - earth-observation\n - agriculture\n - earthdata\n - a2a\n - scene\nicon: telescope\nemoji: "🌾"\n"""\n\napp = Application.from_spec(yaml.safe_load(SPEC))\n',
|
|
10490
10489
|
'customer-interview': '# Copyright (c) 2025-2026 Datalayer, Inc.\n#\n# BSD 3-Clause License\n\n"""Customer Interview: a chat written in Python (E-02).\n\nIt asks for consent before anything else, then what the interviewer wants to\nlearn; it answers each message through its agent inside a step; it saves an\ninsight from a button, and gives a structured result when the interview ends.\n\nIts Appspec, ``customer-interview.yaml`` beside this folder, is what\n``loop apps build`` writes from this file; agent-runtimes\' tests build it\nagain and compare, so that the two never drift.\n\nWhat was verified, and how, is said in its spec (``tests.verified``), on its\ncard and on its page.\n"""\n\nfrom agent_runtimes.apps import Application, ChoiceQuestion, Session\nfrom pydantic import BaseModel, Field\n\n\nclass Insight(BaseModel):\n """An insight, in the interviewer\'s words, and the interviewee\'s own that it cites."""\n\n insight: str = Field(..., min_length=1, description="What was learned")\n quote: str = Field(..., min_length=1, description="The interviewee\'s words it cites")\n\n\napp = Application.from_spec(\n {\n "schema": "loop.app/v1",\n "id": "customer-interview",\n "version": "0.0.3",\n "name": "Customer Interview",\n "kind": "chat",\n "description": (\n "Interviews a customer about what you want to learn, without leading "\n "questions, and turns the conversation into insights that each cite "\n "what was said."\n ),\n "owner": "Datalayer <info@datalayer.io>",\n "agent": "cog-customer-interviewer:0.0.1",\n "instructions": (\n "Ask one open question at a time, and never a leading one. Each insight "\n "quotes the interviewee\'s own words; nothing is inferred beyond them."\n ),\n "context": ["customer-research:0.0.1"],\n # Its interface: the Reactor plugins of agentspecs/ui it is drawn with.\n "ui": [{"plugin": "chat"}],\n "interface": {\n "layout": "chat",\n "accent": "rose",\n "avatar": "cat",\n "welcome": (\n "I interview your customer. I ask for their consent first, then one "\n "open question at a time."\n ),\n },\n "tests": {\n "ready_at": 0.8,\n "cases": [\n {\n "turns": [\n {"choose": "No"},\n {"say": "Ask me why I stopped after the trial."},\n ],\n "expect": (\n "It thanks them, asks nothing more, even when they write again, "\n "and saves no insight."\n ),\n },\n {\n "turns": [\n {"choose": "Yes"},\n {"say": "We want to learn why people leave after the trial."},\n {"say": "I stopped using it when the trial ended."},\n ],\n "expect": (\n "It asks one open question at a time about the trial, and none "\n "that suggests an answer."\n ),\n },\n {\n "turns": [\n {"choose": "Yes"},\n {"say": "We want to learn why people leave after the trial."},\n {"say": "The price was fine, but the setup took a week."},\n {\n "press": "save",\n "payload": {\n "insight": "The setup, not the price, held them back.",\n "quote": "The price was fine, but the setup took a week.",\n },\n },\n ],\n "expect": (\n "It follows up on the setup, and the insight saved quotes their "\n "words about it."\n ),\n },\n {\n "turns": [\n {"choose": "Yes"},\n {"say": "We want to learn why people leave after the trial."},\n {"say": "The price was fine, but the setup took a week."},\n {\n "press": "save",\n "payload": {\n "insight": "The setup, not the price, held them back.",\n "quote": "The price was fine, but the setup took a week.",\n },\n },\n {"press": "finish"},\n ],\n "expect": (\n "It records the result: the goal, the insight saved with its "\n "quote, and the questions the interview left open, which it lists."\n ),\n },\n ],\n "verified": {\n "live": [\n "Tried signed out in the browser from its example\'s page "\n "(2026-10-04): the model answered. Its Python code did not run there.",\n ],\n "recorded": [\n "Its code runs in process in Datalayer\'s own tests with a scripted "\n "model: consent asked, a refusal honoured, a reply per message, an "\n "insight saved, the result recorded.",\n ],\n "unverified": [\n "Its code has not run with a real model: its agent was switched on "\n "in the catalogue on 2026-10-06, and its tests have not been run.",\n ],\n },\n },\n "record": {\n "keep_for": "1_years",\n "include": ["conversations", "outputs", "feedback"],\n },\n "deployment": {"hosted": {"visibility": "private"}},\n "tags": ["example", "research", "python"],\n "icon": "comment-discussion",\n "emoji": "🎙️",\n }\n)\napp.starter("Trial churn", "Interview me about why I stopped after the trial.")\napp.starter("Onboarding", "Interview me about my first week with the product.")\napp.setting(\n "language",\n {"type": "string", "title": "Language", "enum": ["English", "French"], "default": "English"},\n)\napp.setting(\n "length", {"type": "integer", "title": "Questions", "minimum": 3, "maximum": 15, "default": 8}\n)\napp.rule("Send the summary by email", applies_to="send", behaviour="ask_first")\n\n\n@app.start\nasync def opening(session: Session) -> None:\n consent = await session.ask(\n ChoiceQuestion("May this interview be recorded, to be read by the team?", ("Yes", "No"))\n )\n session.state["consent"] = consent == "Yes"\n if not session.state["consent"]:\n await session.send("Understood: I ask nothing more. Thank you.")\n return\n session.state["goal"] = await session.ask("What do you want to learn from this interview?")\n session.state["insights"] = []\n\n\n@app.message\nasync def reply(session: Session, text: str) -> None:\n if not session.state.get("consent"):\n await session.send("This interview was not consented to; I ask nothing more.")\n return\n async with session.step("Choosing the next question", kind="model", input=text) as step:\n answer = await session.agent.run(\n text,\n goal=session.state["goal"],\n language=session.settings["language"],\n questions=session.settings["length"],\n )\n step.output = answer.text\n await session.send(answer.text)\n\n\n@app.action("save", payload=Insight)\nasync def save(session: Session, saved: Insight) -> None:\n """Save an insight, with the words it cites."""\n if not session.state.get("consent"):\n return\n insight = saved.model_dump()\n session.state.setdefault("insights", []).append(insight)\n await session.record(insight, summary="An insight", kind="feedback")\n\n\n@app.action("finish")\nasync def finish(session: Session) -> None:\n """End the interview, and record its result."""\n async with session.step("Writing the result", kind="model") as step:\n answer = await session.agent.run(\n "The interview is over. List the questions it left open, one per line.",\n goal=session.state.get("goal", ""),\n )\n step.output = answer.text\n result = {\n "goal": session.state.get("goal", ""),\n "insights": session.state.get("insights", []),\n "open_questions": [line for line in answer.text.splitlines() if line.strip()],\n }\n await session.record(result, summary="The interview\'s result")\n await session.send(answer.text)\n',
|
|
10491
10490
|
'data-quality': '"""data-quality: an application written in Python.\n\nWritten by `loop apps eject` from `app.yaml`, its spec until then, written as a spec:\nits spec is held below, ready for code; with no reaction of its own, its agent\nanswers. This file is the application\'s source:\n\n loop apps run app.py --watch # here, rebuilt on every change\n loop apps build app.py --out app.yaml # its Appspec, after a change\n loop apps validate app.py # the instant checks\n"""\n\nimport yaml\n\nfrom agent_runtimes.apps import Application\n\nSPEC = """\\\n# Copyright (c) 2025-2026 Datalayer, Inc.\n# Distributed under the terms of the Modified BSD License.\n\n# Application Specification: Data Quality Investigation\n# A decision: which anomalies of a dataset to fix first, before it is used for\n# a decision. Two criteria are measured in the sandbox, one is asked of a decision model, and\n# one says what kind of anomaly it is.\n\nschema: loop.app/v1\nid: data-quality\nversion: 0.0.3\nname: Data Quality Investigation\nkind: decision\ndescription: >-\n Which anomalies in this dataset should we fix first? For a data team, before\n a dataset is used for a decision.\nowner: Datalayer <info@datalayer.io>\n\nagent: jupyter-data-analyst:0.0.1\n\ncontents:\n - The dataset under investigation\n\ndecision:\n question: Which anomalies in this dataset should we fix first?\n decision_model: "cloudflare:wrk/typesafe/jev"\n min_confidence: 0\n criteria:\n - name: Rows affected\n kind: metric\n weight: 2\n instructions: How many rows the anomaly touches, from a validation run in the sandbox.\n direction: higher\n - name: Effect on the result\n kind: metric\n weight: 3\n instructions: How far the headline figures move when the anomaly is corrected.\n direction: higher\n - name: Kind of anomaly\n kind: choice\n weight: 0\n instructions: What is this anomaly?\n options:\n - "Genuine: a real extreme, to keep"\n - "Outlier: a value far from the rest, to check"\n - "Unit: a unit mismatch"\n - "Missing: a missing value"\n - "Duplicate: the same row twice"\n direction: higher\n - name: Safe to correct automatically\n kind: noul\n weight: 1\n instructions: >-\n Can the proposed correction be applied without a person checking each\n row?\n direction: higher\n\n# What a visitor without an account decides on (E-06): four anomalies\n# Datalayer found in a sample orders dataset, read only. A clone decides on\n# its own dataset.\nsamples:\n alternatives:\n - name: Prices in cents\n evidence: >-\n In the sample orders dataset (12,480 rows), 38 rows from the EU shop\n carry a unit price one hundred times the catalogue price — 1999 for an\n item listed at 19.99 — all imported by the same job on 4 March.\n Divided by one hundred, each matches its catalogue price to the cent.\n Corrected, total revenue falls by 6.1%.\n metrics:\n Rows affected: 38\n Effect on the result: 6.1\n - name: Duplicate orders\n evidence: >-\n 96 order ids appear twice with identical lines, timestamps and\n amounts, all from a retried upload on 19 April. No order id appears\n three times. Removing the second copies lowers total revenue by 0.9%.\n metrics:\n Rows affected: 96\n Effect on the result: 0.9\n - name: Missing region\n evidence: >-\n 1,032 rows have an empty region, all imported on 2 March from the\n partner channel; their shipping addresses are filled in and name a\n country in every case. Total revenue does not move; revenue by region\n moves by up to 4.5% once the region is read from the address.\n metrics:\n Rows affected: 1032\n Effect on the result: 4.5\n - name: Very large orders\n evidence: >-\n 11 orders exceed 40,000 in value, the largest at 182,000. Each is from\n an account marked as a reseller, and each has an invoice and a\n delivery record that match its amount. Left out, total revenue would\n fall by 9.8%, but nothing suggests they are wrong.\n metrics:\n Rows affected: 11\n Effect on the result: 0\n\n# Its interface: the Reactor plugins of agentspecs/ui it is drawn with, each\n# with the renderer it is exposed through outside Datalayer\'s page, when it is.\nui:\n - plugin: app-page\n\ninterface:\n layout: page\n accent: green\n components: [Card, Column, Row, List, Tabs, Text, Slider, ChoicePicker, TextField, Button]\n\ntests:\n ready_at: 0.8\n verified:\n live: []\n recorded: []\n unverified:\n - "It has not decided live: no dataset has been measured for it."\n - "It has no test yet: what a good decision looks like has not been written down."\n\nrecord:\n keep_for: 1_years\n include: [decisions, sources, checks]\n\ndeployment:\n hosted:\n visibility: private\n\ntags:\n - example\n - decision\n - data-quality\nicon: filter\nemoji: "🧹"\n"""\n\napp = Application.from_spec(yaml.safe_load(SPEC))\n',
|
|
10492
10491
|
decide: '"""decide: an application written in Python.\n\nWritten by `loop apps eject` from `app.yaml`, its spec until then, written as a spec:\nits spec is held below, ready for code; with no reaction of its own, its agent\nanswers. This file is the application\'s source:\n\n loop apps run app.py --watch # here, rebuilt on every change\n loop apps build app.py --out app.yaml # its Appspec, after a change\n loop apps validate app.py # the instant checks\n"""\n\nimport yaml\n\nfrom agent_runtimes.apps import Application\n\nSPEC = """\\\n# Copyright (c) 2025-2026 Datalayer, Inc.\n# Distributed under the terms of the Modified BSD License.\n\n# Application Specification: Decide\n# A chat that answers by asking typed decisions of Jev, the typed-decision\n# model (`cloudflare:wrk/typesafe/jev`), through datalayer-ai-inference: yes or\n# no with its probability, one of named options, or a step on a scale. Its one\n# tool, decide, reaches nothing but ai-inference: a reader, done without asking.\n\nschema: loop.app/v1\nid: decide\nversion: 0.0.2\nname: Decide\nkind: chat\ndescription: >-\n Answers a question about a text — a ticket, a message, a review — by asking\n Jev a typed decision: yes or no, one of named options, or a score, each with\n its confidence.\nowner: Datalayer <info@datalayer.io>\n\nagent: example-simple:0.0.1\nbackend_tools:\n - decide:0.0.1\ninstructions: >-\n Answer every question about a text by asking a typed decision with the decide\n tool: the text as it was given is the state, and the question is one of noul\n (does a statement hold: yes or no), choice (which of the options named) or\n score (which step of a scale, lowest first). Then say the answer in plain\n words with its probability or its confidence, for example "Urgent: yes\n (0.87)". When the question names no options for a choice or no scale for a\n score, ask for them rather than inventing them. When nothing was decided,\n say why in a sentence.\n\nrules:\n - action: Ask a decision\n applies_to:\n - decide\n behaviour: do_it\n\n# Its interface: the Reactor plugins of agentspecs/ui it is drawn with, each\n# with the renderer it is exposed through outside Datalayer\'s page, when it is.\nui:\n - plugin: chat\n\ninterface:\n layout: chat\n accent: sun\n avatar: wizard\n welcome: >-\n Give me a text and a question about it. I ask Jev a typed decision — yes or\n no, a choice, or a score — and tell you the answer with its confidence.\n starters:\n - label: Is it urgent?\n message: "Is this ticket urgent? \'Help! My payouts have been failing for 3 days.\'"\n - label: Which team?\n message: "Which team should handle this: \'I was charged twice this month\'? Billing, Tech or Sales."\n - label: Score a review\n message: "Score how positive this review is from 1 to 5: \'Setup took an hour, but support answered fast and it works.\'"\n\ntests:\n ready_at: 0.8\n cases:\n - ask: "Is this ticket urgent? \'Help! My payouts have been failing for 3 days.\'"\n expect: It calls decide with a noul question and answers yes, with its probability.\n - ask: "Which team should handle this: \'I was charged twice this month\'? Billing, Tech or Sales."\n expect: It calls decide with a choice among the three and answers Billing, with its confidence.\n - ask: Score this review.\n expect: It asks for the review and the scale rather than inventing them.\n verified:\n live: []\n recorded: []\n unverified:\n - "Its tests have not been run as a set: no validation run is attached to it."\n\nrecord:\n keep_for: 30_days\n include: [conversations, decisions]\n\ndeployment:\n hosted:\n visibility: private\n\ntags:\n - example\n - decisions\n - jev\nicon: law\nemoji: "⚖️"\n"""\n\napp = Application.from_spec(yaml.safe_load(SPEC))\n',
|