@datalayer/agent-runtimes 1.5.110 → 1.5.114
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/datalayer-app-main.js +5 -5
- package/lib/apps/apps/appspec.js +4 -0
- package/lib/battles/verdict.d.ts +7 -1
- package/lib/battles/verdict.js +8 -2
- package/lib/examples/pap/PapCompanyDiscoveryView.js +2 -2
- package/lib/examples/pap/PapGuidedJourneyView.js +2 -2
- package/lib/examples/pap/PapSessionJwtView.js +1 -1
- package/lib/examples/pap/PapSessionLifecycleView.js +2 -2
- package/lib/examples/pap/traces/conversation-control.json +145 -0
- package/lib/examples/pap/traces/operations.json +177 -117
- package/lib/examples/pap/traces/two-companies.json +1 -1
- package/lib/specs/agents/agents.js +12 -0
- package/lib/specs/apps.js +16 -0
- package/lib/specs/appspecSchema.js +14 -2
- package/lib/specs/envvars.d.ts +1 -0
- package/lib/specs/envvars.js +11 -0
- package/lib/specs/modelProviders.d.ts +1 -0
- package/lib/specs/modelProviders.js +21 -0
- package/lib/specs/models.d.ts +2 -0
- package/lib/specs/models.js +16 -0
- package/lib/types/agentspecs.d.ts +11 -0
- package/lib/types/models.d.ts +7 -0
- package/package.json +2 -2
- package/scripts/codegen/generate_apps.py +2 -0
- package/scripts/codegen/generate_model_providers.py +5 -2
package/lib/apps/apps/appspec.js
CHANGED
|
@@ -396,6 +396,8 @@ function parsePap(data) {
|
|
|
396
396
|
company: {
|
|
397
397
|
enabled: flag(company.enabled, false),
|
|
398
398
|
signedOut: flag(company.signed_out, true),
|
|
399
|
+
signInDisabled: flag(company.sign_in_disabled, false),
|
|
400
|
+
publishSkills: flag(company.publish_skills, false),
|
|
399
401
|
interfaces: enumsOf(company.interfaces, PAP_INTERFACES, PAP_DEFAULT_INTERFACES),
|
|
400
402
|
scopes: records(company.scopes).map(parsePapCompanyScope),
|
|
401
403
|
excludedTasks: records(company.excluded_tasks).map(task => ({
|
|
@@ -506,6 +508,8 @@ function dumpPap(pap) {
|
|
|
506
508
|
.part('company', new Writer()
|
|
507
509
|
.value('enabled', pap.company.enabled, false)
|
|
508
510
|
.value('signed_out', pap.company.signedOut, true)
|
|
511
|
+
.value('sign_in_disabled', pap.company.signInDisabled, false)
|
|
512
|
+
.value('publish_skills', pap.company.publishSkills, false)
|
|
509
513
|
.list('interfaces', pap.company.interfaces, [...PAP_DEFAULT_INTERFACES])
|
|
510
514
|
.list('scopes', pap.company.scopes.map(dumpPapCompanyScope))
|
|
511
515
|
.list('excluded_tasks', pap.company.excludedTasks.map(dumpPapExcludedTask))
|
package/lib/battles/verdict.d.ts
CHANGED
|
@@ -73,5 +73,11 @@ export declare function secondsLeft(spec: BattleSpec, record: BattleRecord, now:
|
|
|
73
73
|
export declare function verdictOf(spec: BattleSpec, record: BattleRecord): BattleVerdict;
|
|
74
74
|
/** A record at the start of a Battle: every contestant started, nothing done. */
|
|
75
75
|
export declare function startRecord(spec: BattleSpec, startedAt: number): BattleRecord;
|
|
76
|
-
/**
|
|
76
|
+
/**
|
|
77
|
+
* Whether the Battle's own rule ends it now: a race once every contestant is
|
|
78
|
+
* done (the user, 7 November 2026: the slowest may be the one whose tests
|
|
79
|
+
* pass, so nobody is stopped on the first answer; the first done still
|
|
80
|
+
* ranks first), a game once the arena says so, a challenge once everyone is
|
|
81
|
+
* done. The clock ends any of them.
|
|
82
|
+
*/
|
|
77
83
|
export declare function ruleEnds(spec: BattleSpec, record: BattleRecord, arenaOver?: boolean): boolean;
|
package/lib/battles/verdict.js
CHANGED
|
@@ -109,11 +109,17 @@ export function startRecord(spec, startedAt) {
|
|
|
109
109
|
moves: [],
|
|
110
110
|
};
|
|
111
111
|
}
|
|
112
|
-
/**
|
|
112
|
+
/**
|
|
113
|
+
* Whether the Battle's own rule ends it now: a race once every contestant is
|
|
114
|
+
* done (the user, 7 November 2026: the slowest may be the one whose tests
|
|
115
|
+
* pass, so nobody is stopped on the first answer; the first done still
|
|
116
|
+
* ranks first), a game once the arena says so, a challenge once everyone is
|
|
117
|
+
* done. The clock ends any of them.
|
|
118
|
+
*/
|
|
113
119
|
export function ruleEnds(spec, record, arenaOver = false) {
|
|
114
120
|
switch (spec.referee.decidesBy) {
|
|
115
121
|
case 'first_done':
|
|
116
|
-
return record.contestants.
|
|
122
|
+
return record.contestants.every(contestant => contestant.doneAt !== undefined);
|
|
117
123
|
case 'score':
|
|
118
124
|
return arenaOver;
|
|
119
125
|
case 'measure':
|
|
@@ -39,7 +39,7 @@ const sampleCompany = (domain) => ({
|
|
|
39
39
|
],
|
|
40
40
|
extensions: { operations: { version: '1' } },
|
|
41
41
|
}),
|
|
42
|
-
// Direct and Device are what the issuer's grants say (
|
|
42
|
+
// Direct and Device are what the issuer's grants say (0.3 as published §3.2).
|
|
43
43
|
oauthMetadata: parseOAuthServerMetadata({
|
|
44
44
|
issuer: `https://auth.${domain}`,
|
|
45
45
|
token_endpoint: `https://auth.${domain}/token`,
|
|
@@ -80,6 +80,6 @@ const PapCompanyDiscoveryView = () => {
|
|
|
80
80
|
setError(cause instanceof Error ? cause.message : String(cause));
|
|
81
81
|
}
|
|
82
82
|
};
|
|
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 (
|
|
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
84
|
};
|
|
85
85
|
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 ·
|
|
31
|
+
{ label: 'Publishes', value: 'poppy.json · 0.3 as published' },
|
|
32
32
|
{ label: 'Returns', value: 'Company conversation agent' },
|
|
33
33
|
{ label: 'Sign-in', value: "Northstar's own page" },
|
|
34
34
|
],
|
|
@@ -256,7 +256,7 @@ const runJourney = async () => {
|
|
|
256
256
|
],
|
|
257
257
|
},
|
|
258
258
|
});
|
|
259
|
-
// Direct Sign-In is what the issuer's grants offer (
|
|
259
|
+
// Direct Sign-In is what the issuer's grants offer (0.3 as published §3.2).
|
|
260
260
|
parseOAuthServerMetadata({
|
|
261
261
|
issuer: 'https://auth.northstar.example',
|
|
262
262
|
token_endpoint: 'https://auth.northstar.example/oauth/token',
|
|
@@ -52,7 +52,7 @@ const PapSessionJwtView = () => {
|
|
|
52
52
|
urlBoundWithoutQueryOrFragment: claims.htu === 'https://api.company.example/orders',
|
|
53
53
|
accessTokenBound: typeof claims.ath === 'string',
|
|
54
54
|
namesItsSession: claims.sid === request.sid,
|
|
55
|
-
carriesItsDelegation: typeof header.
|
|
55
|
+
carriesItsDelegation: typeof header.poppy_dlg === 'string',
|
|
56
56
|
oneKeyPerUserId: header.kid !== part(other.reveal(), 0).kid,
|
|
57
57
|
jwtRedactedByDefault: first.toJSON() === '[REDACTED]',
|
|
58
58
|
jwtWithheldFromUiState: true,
|
|
@@ -21,7 +21,7 @@ const PapSessionLifecycleView = () => {
|
|
|
21
21
|
calls += 1;
|
|
22
22
|
jwts.push(new Headers(init?.headers).get('Poppy-Session') ?? '');
|
|
23
23
|
return calls === 1
|
|
24
|
-
? new Response(JSON.stringify({ error: '
|
|
24
|
+
? new Response(JSON.stringify({ error: 'session_ended' }), {
|
|
25
25
|
status: 400,
|
|
26
26
|
headers: { 'content-type': 'application/json' },
|
|
27
27
|
})
|
|
@@ -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 (
|
|
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] }));
|
|
85
85
|
};
|
|
86
86
|
export default PapSessionLifecycleView;
|
|
@@ -732,6 +732,151 @@
|
|
|
732
732
|
}
|
|
733
733
|
}
|
|
734
734
|
]
|
|
735
|
+
},
|
|
736
|
+
{
|
|
737
|
+
"title": "Manzanita asks for Ada",
|
|
738
|
+
"channel": "Company-first Direct Conversation",
|
|
739
|
+
"summary": "Manzanita's agent asks for the person with a user_requested event (a returns specialist wants to talk about the damaged jacket). Ada accepts: Atlas opens a Direct Conversation under the parent naming the event, with no message of its own, and Manzanita speaks first. Accepted again, the same conversation comes back (§8.10).",
|
|
740
|
+
"chat": [
|
|
741
|
+
{
|
|
742
|
+
"speaker": "manzanita",
|
|
743
|
+
"kind": "message",
|
|
744
|
+
"text": "A returns specialist would like to talk with you about the damaged jacket."
|
|
745
|
+
},
|
|
746
|
+
{
|
|
747
|
+
"speaker": "user",
|
|
748
|
+
"kind": "message",
|
|
749
|
+
"text": "Yes, put me through."
|
|
750
|
+
},
|
|
751
|
+
{
|
|
752
|
+
"speaker": "manzanita",
|
|
753
|
+
"kind": "message",
|
|
754
|
+
"text": "Hello Ada, this is the returns desk. What happened to the jacket?"
|
|
755
|
+
}
|
|
756
|
+
],
|
|
757
|
+
"views": {
|
|
758
|
+
"atlas": [
|
|
759
|
+
{
|
|
760
|
+
"label": "Company",
|
|
761
|
+
"value": "Manzanita Outfitters · discovery verified"
|
|
762
|
+
},
|
|
763
|
+
{
|
|
764
|
+
"label": "Session",
|
|
765
|
+
"value": "signed out · a Session JWT on every request"
|
|
766
|
+
},
|
|
767
|
+
{
|
|
768
|
+
"label": "Invitation",
|
|
769
|
+
"value": "user_requested evt_7 · accepted by Ada, never by the model"
|
|
770
|
+
},
|
|
771
|
+
{
|
|
772
|
+
"label": "Model sees",
|
|
773
|
+
"value": "Summaries and statuses, never a credential"
|
|
774
|
+
}
|
|
775
|
+
],
|
|
776
|
+
"manzanita": [
|
|
777
|
+
{
|
|
778
|
+
"label": "Verified client",
|
|
779
|
+
"value": "atlas.example/agent.json"
|
|
780
|
+
},
|
|
781
|
+
{
|
|
782
|
+
"label": "Conversation",
|
|
783
|
+
"value": "idle · agent · 7 events"
|
|
784
|
+
},
|
|
785
|
+
{
|
|
786
|
+
"label": "Direct conversation",
|
|
787
|
+
"value": "cnv_3 · opened by the company's first message"
|
|
788
|
+
},
|
|
789
|
+
{
|
|
790
|
+
"label": "Owner",
|
|
791
|
+
"value": "client_id + User ID (§8.2)"
|
|
792
|
+
}
|
|
793
|
+
]
|
|
794
|
+
},
|
|
795
|
+
"sequence": [
|
|
796
|
+
{
|
|
797
|
+
"kind": "http",
|
|
798
|
+
"from": "atlas",
|
|
799
|
+
"to": "manzanita",
|
|
800
|
+
"method": "POST",
|
|
801
|
+
"url": "https://manzanita.example/poppy/conversations?wait=0",
|
|
802
|
+
"status": 201,
|
|
803
|
+
"request": {
|
|
804
|
+
"headers": {
|
|
805
|
+
"content-type": "application/json",
|
|
806
|
+
"accept": "*/*",
|
|
807
|
+
"poppy-session": "‹Session JWT›"
|
|
808
|
+
},
|
|
809
|
+
"body": {
|
|
810
|
+
"parent_conversation_id": "cnv_1",
|
|
811
|
+
"user_requested_event_id": "evt_7"
|
|
812
|
+
}
|
|
813
|
+
},
|
|
814
|
+
"response": {
|
|
815
|
+
"headers": {
|
|
816
|
+
"content-type": "application/json"
|
|
817
|
+
},
|
|
818
|
+
"body": {
|
|
819
|
+
"conversation_id": "cnv_3",
|
|
820
|
+
"events": [
|
|
821
|
+
{
|
|
822
|
+
"id": "evt_1",
|
|
823
|
+
"created_at": "2026-11-07T09:05:00Z",
|
|
824
|
+
"type": "message",
|
|
825
|
+
"message": {
|
|
826
|
+
"id": "msg_9",
|
|
827
|
+
"author": {
|
|
828
|
+
"type": "agent",
|
|
829
|
+
"name": "Manzanita Outfitters"
|
|
830
|
+
},
|
|
831
|
+
"role": "company",
|
|
832
|
+
"text": "Hello Ada, this is the returns desk. What happened to the jacket?"
|
|
833
|
+
}
|
|
834
|
+
},
|
|
835
|
+
{
|
|
836
|
+
"id": "evt_2",
|
|
837
|
+
"created_at": "2026-11-07T09:05:00Z",
|
|
838
|
+
"type": "state",
|
|
839
|
+
"status": "idle",
|
|
840
|
+
"responder": "agent"
|
|
841
|
+
}
|
|
842
|
+
],
|
|
843
|
+
"cursor": "evt_2",
|
|
844
|
+
"has_more": false,
|
|
845
|
+
"status": "idle",
|
|
846
|
+
"responder": "agent"
|
|
847
|
+
}
|
|
848
|
+
}
|
|
849
|
+
},
|
|
850
|
+
{
|
|
851
|
+
"kind": "http",
|
|
852
|
+
"from": "atlas",
|
|
853
|
+
"to": "manzanita",
|
|
854
|
+
"method": "POST",
|
|
855
|
+
"url": "https://manzanita.example/poppy/conversations?wait=0",
|
|
856
|
+
"status": 201,
|
|
857
|
+
"request": {
|
|
858
|
+
"headers": {
|
|
859
|
+
"content-type": "application/json",
|
|
860
|
+
"accept": "*/*",
|
|
861
|
+
"poppy-session": "‹Session JWT›"
|
|
862
|
+
},
|
|
863
|
+
"body": {
|
|
864
|
+
"parent_conversation_id": "cnv_1",
|
|
865
|
+
"user_requested_event_id": "evt_7"
|
|
866
|
+
}
|
|
867
|
+
},
|
|
868
|
+
"response": {
|
|
869
|
+
"headers": {
|
|
870
|
+
"content-type": "application/json"
|
|
871
|
+
},
|
|
872
|
+
"body": {
|
|
873
|
+
"conversation_id": "cnv_3",
|
|
874
|
+
"status": "idle",
|
|
875
|
+
"responder": "agent"
|
|
876
|
+
}
|
|
877
|
+
}
|
|
878
|
+
}
|
|
879
|
+
]
|
|
735
880
|
}
|
|
736
881
|
]
|
|
737
882
|
}
|