@datalayer/agent-runtimes 1.5.4 → 1.5.7

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.
@@ -540,6 +540,33 @@ export interface AppPactConnectionSpec {
540
540
  export interface AppPactSpec {
541
541
  connections: AppPactConnectionSpec[];
542
542
  }
543
+ /** The most one purchase may cost at a merchant (AGENT_PROTOCOLS PI-22). */
544
+ export interface AppSpendLimitSpec {
545
+ /** As written: `50`, `12.50`. */
546
+ amount: string;
547
+ /** ISO 4217: `USD`. */
548
+ currency: string;
549
+ }
550
+ /**
551
+ * A merchant the application shops at for each person, over UCP or ACP
552
+ * (AGENT_PROTOCOLS PI-01). Test merchants only, every purchase asked of the
553
+ * person (decided 2026-10-13). Never a credential.
554
+ */
555
+ export interface AppCommerceMerchantSpec {
556
+ /** Stable within the application: `example-store`. */
557
+ id: string;
558
+ protocol: 'ucp' | 'acp';
559
+ /** The merchant's domain: `store.example`. */
560
+ merchant: string;
561
+ /** `read`: searches and reads; `write`: also fills a checkout and buys, each purchase asked. */
562
+ access: 'read' | 'write';
563
+ /** The most one purchase may cost: required for `write`. */
564
+ limit?: AppSpendLimitSpec;
565
+ }
566
+ /** UCP and ACP: the merchants it shops at for each person. */
567
+ export interface AppCommerceSpec {
568
+ merchants: AppCommerceMerchantSpec[];
569
+ }
543
570
  /**
544
571
  * An A2A extension the application's Agent Card advertises, beside the
545
572
  * runtime's own (AGENT_PROTOCOLS PR-02). Its params are public: never a
@@ -1145,6 +1172,8 @@ export interface AppSpec {
1145
1172
  pap?: AppPapSpec;
1146
1173
  /** PACT: the businesses it asks for each person (AGENT_PROTOCOLS PI-01). */
1147
1174
  pact?: AppPactSpec;
1175
+ /** UCP and ACP: the merchants it shops at for each person (AGENT_PROTOCOLS PI-01). */
1176
+ commerce?: AppCommerceSpec;
1148
1177
  /** A2A: the extensions its Agent Card advertises (AGENT_PROTOCOLS PR-02). */
1149
1178
  a2a?: AppA2ASpec;
1150
1179
  rules: AppRuleSpec[];
@@ -210,11 +210,57 @@ export interface SceneDeploymentSpec {
210
210
  addresses: Record<string, string>;
211
211
  }
212
212
  /** Specification for a scene: a team, staged. */
213
+ /** Somebody on a scripted scene: a person, an application, a company (PAP_DATALAYER X-02). */
214
+ export interface SceneActorSpec {
215
+ id: string;
216
+ /** The name the audience sees. */
217
+ name: string;
218
+ /** One emoji, drawn before the name. */
219
+ face: string;
220
+ /** What it is, in a few words. */
221
+ is: string;
222
+ }
223
+ /** What the audience reads on a scripted line: rows and sentences, never a credential. */
224
+ export interface SceneCardSpec {
225
+ kind: 'found' | 'sign-in' | 'approval' | 'done' | 'record';
226
+ title: string;
227
+ /** Its rows: each a label and a value. */
228
+ rows: [string, string][];
229
+ /** Its sentences. */
230
+ lines: string[];
231
+ }
232
+ /** The audience's turn on a scripted line: the scene waits for them. */
233
+ export interface SceneTurnSpec {
234
+ /** What saying yes is called. */
235
+ yes: string;
236
+ /** What saying no is called; empty when there is nothing to refuse. */
237
+ no: string;
238
+ /** What happens once they said no: the scene ends there. */
239
+ declined: string;
240
+ }
241
+ /** One line of a scripted scene. */
242
+ export interface SceneLineSpec {
243
+ /** Who acts: an actor's id. */
244
+ from: string;
245
+ /** To whom; empty when nobody is addressed. */
246
+ to: string;
247
+ /** What they say or do, in a sentence; in quotes when it is said. */
248
+ says: string;
249
+ card?: SceneCardSpec;
250
+ /** What happened underneath, in a visitor's words; empty when nothing is said. */
251
+ how: string;
252
+ turn?: SceneTurnSpec;
253
+ }
213
254
  export interface SceneSpec {
214
255
  /** The version of the spec itself: `loop.scene/v1`. */
215
256
  schema: string;
216
257
  id: string;
217
258
  version: string;
259
+ /**
260
+ * `team`: a team staged, live; `scripted`: actors and lines written out,
261
+ * played as written, with no team, cast or script (PAP_DATALAYER X-02).
262
+ */
263
+ kind: 'team' | 'scripted';
218
264
  /** The tab's name. */
219
265
  name: string;
220
266
  description: string;
@@ -238,4 +284,10 @@ export interface SceneSpec {
238
284
  setup: string[];
239
285
  /** The last rehearsal played on Datalayer, what *Live* is read from; none when never played. */
240
286
  played?: ScenePlayedSpec;
287
+ /** A scripted scene's actors; empty on one that stages a team. */
288
+ actors: SceneActorSpec[];
289
+ /** A scripted scene's lines, in order; empty on one that stages a team. */
290
+ lines: SceneLineSpec[];
291
+ /** A scripted scene: what of it runs on Datalayer today; empty on one that stages a team. */
292
+ live: string;
241
293
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datalayer/agent-runtimes",
3
- "version": "1.5.4",
3
+ "version": "1.5.7",
4
4
  "type": "module",
5
5
  "workspaces": [
6
6
  ".",
@@ -156,8 +156,8 @@ def load_specs(specs_dir: Path) -> tuple[list[dict[str, Any]], dict[str, Any]]:
156
156
  mode="json", by_alias=True
157
157
  ):
158
158
  spec.pop("pap")
159
- # PACT and A2A's extensions the same way (AGENT_PROTOCOLS PI-01, PR-02).
160
- for block in ("pact", "a2a"):
159
+ # PACT, commerce and A2A's extensions the same way (AGENT_PROTOCOLS PI-01, PR-02).
160
+ for block in ("pact", "commerce", "a2a"):
161
161
  if block in spec and spec[block] == type(getattr(app, block))().model_dump(
162
162
  mode="json", by_alias=True
163
163
  ):
@@ -88,10 +88,17 @@ def load_specs(specs_dir: Path) -> list[dict[str, Any]]:
88
88
  for identity in sorted(scenes):
89
89
  scene = scenes[identity]
90
90
  spec = scene.model_dump(mode="json", by_alias=True)
91
- spec["entry"] = scene.entry_of()
92
- spec["cast"] = [
93
- member.model_dump(mode="json", by_alias=True) for member in scene.cast_of()
94
- ]
91
+ # A scripted scene stages no team (PAP_DATALAYER X-02): no entry, no cast.
92
+ scripted = spec.get("kind") == "scripted"
93
+ spec["entry"] = "" if scripted else scene.entry_of()
94
+ spec["cast"] = (
95
+ []
96
+ if scripted
97
+ else [
98
+ member.model_dump(mode="json", by_alias=True)
99
+ for member in scene.cast_of()
100
+ ]
101
+ )
95
102
  for beat, data in zip(scene.script, spec["script"]):
96
103
  data["shows"] = [kind.value for kind in beat.shown]
97
104
  spec["setup"] = scenes_module.scene_setup(scene)