openvibers/openvibe.codes Commits
Pass Live's current agent step to the Dock (#407)
Changes
@@@ -17,7 +17,7 @@"iovalkey": "^0.4.0","openvibe-contracts": "https://codeload.github.com/OpenVibers/OpenVibe.Contracts/tar.gz/refs/tags/v0.406.0","openvibe-sdk": "https://codeload.github.com/OpenVibers/OpenVibe.SDK/tar.gz/refs/tags/v0.147.0",-- "openvibe-shared": "https://codeload.github.com/OpenVibers/OpenVibe.Shared/tar.gz/refs/tags/v4.206.0",++ "openvibe-shared": "https://codeload.github.com/OpenVibers/OpenVibe.Shared/tar.gz/refs/tags/v4.209.0","pg": "^8.23.0","yaml": "^2.9.1"},@@@ -1275,9 +1275,9 @@}},"node_modules/openvibe-shared": {-- "version": "4.206.0",-- "resolved": "https://codeload.github.com/OpenVibers/OpenVibe.Shared/tar.gz/refs/tags/v4.206.0",-- "integrity": "sha512-mvkdGKmdYXDDV380k0DvdSVmBkg5tjYrw1La9BwNwp87NnR3mNlUCDDgAZTbyP1KyVGuK/zLodiM7bNV61zXfg==",++ "version": "4.209.0",++ "resolved": "https://codeload.github.com/OpenVibers/OpenVibe.Shared/tar.gz/refs/tags/v4.209.0",++ "integrity": "sha512-gtsRDo9r2t/7AHQQEViVVByWRmT+16bCzIC2LSuFnfdoM+P5IrtesQc60xjoRR5umrzoSNEEQlVFE4WdNpc0bg==","license": "MIT","dependencies": {"clean-css": "^5.3.3",@@@ -32,7 +32,7 @@"iovalkey": "^0.4.0","openvibe-contracts": "https://codeload.github.com/OpenVibers/OpenVibe.Contracts/tar.gz/refs/tags/v0.406.0","openvibe-sdk": "https://codeload.github.com/OpenVibers/OpenVibe.SDK/tar.gz/refs/tags/v0.147.0",-- "openvibe-shared": "https://codeload.github.com/OpenVibers/OpenVibe.Shared/tar.gz/refs/tags/v4.206.0",++ "openvibe-shared": "https://codeload.github.com/OpenVibers/OpenVibe.Shared/tar.gz/refs/tags/v4.209.0","pg": "^8.23.0","yaml": "^2.9.1"},@@@ -98,6 +98,10 @@ function createAgentView({ config, sso, actorLimits, fetchImpl = (...a) => fetchstate: row.state,title: row.title,task: row.task && typeof row.task === 'object' ? row.task : null,++ // Live's S2 list already includes the newest step. Older Live deployments omit it.++ current_step: row.current_step && typeof row.current_step.title === 'string'++ ? { title: row.current_step.title.slice(0, 120), status: ['started', 'passed', 'failed', 'skipped'].includes(row.current_step.status) ? row.current_step.status : 'started' }++ : null,curtain: { up: !!(row.curtain && row.curtain.up) },viewers: Number(row.viewers) || 0,worked_seconds: Number(row.worked_seconds) || 0,@@@ -75,7 +75,7 @@ const STREAM = (o = {}) => ({});await check('the live stream comes with the embed, its ticket minted here, and the person\'s own token to Live', async () => {-- live.streams = [STREAM({ state: 'ended', last_frame_url: 'https://openvibe.live/x' }), STREAM()];++ live.streams = [STREAM({ state: 'ended', last_frame_url: 'https://openvibe.live/x' }), STREAM({ current_step: { title: 'Run the checkout tests', status: 'started' } })];live.authorizations.length = 0; // this check's calls only (a token's iat is the second it was minted)const token = t.network.userToken(ada);const res = await t.get('/api/v1/me/agent-view', { bearer: token });@@@ -85,6 +85,7 @@ const STREAM = (o = {}) => ({assert.strictEqual(a.state, 'live');assert.strictEqual(a.title, 'Fix the flaky upload test');assert.deepStrictEqual(a.task, STREAM().task);++ assert.deepStrictEqual(a.current_step, { title: 'Run the checkout tests', status: 'started' });assert.deepStrictEqual([a.viewers, a.worked_seconds], [2, 720]);assert.strictEqual(a.embed_url, `https://openvibe.live/embed/agent/${LIVE_ID}?vt=wvt_the_view_ticket`);assert.strictEqual(a.page_url, `https://openvibe.live/@ada/agents/${LIVE_ID}`);
@@ -17,7 +17,7 @@
@@ -17,7 +17,7 @@
"iovalkey": "^0.4.0",
"iovalkey": "^0.4.0",
"openvibe-contracts": "https://codeload.github.com/OpenVibers/OpenVibe.Contracts/tar.gz/refs/tags/v0.406.0",
"openvibe-contracts": "https://codeload.github.com/OpenVibers/OpenVibe.Contracts/tar.gz/refs/tags/v0.406.0",
"openvibe-sdk": "https://codeload.github.com/OpenVibers/OpenVibe.SDK/tar.gz/refs/tags/v0.147.0",
"openvibe-sdk": "https://codeload.github.com/OpenVibers/OpenVibe.SDK/tar.gz/refs/tags/v0.147.0",
- "openvibe-shared": "https://codeload.github.com/OpenVibers/OpenVibe.Shared/tar.gz/refs/tags/v4.206.0",
+ "openvibe-shared": "https://codeload.github.com/OpenVibers/OpenVibe.Shared/tar.gz/refs/tags/v4.209.0",
"pg": "^8.23.0",
"pg": "^8.23.0",
"yaml": "^2.9.1"
"yaml": "^2.9.1"
},
},
@@ -1275,9 +1275,9 @@
@@ -1275,9 +1275,9 @@
}
}
},
},
"node_modules/openvibe-shared": {
"node_modules/openvibe-shared": {
- "version": "4.206.0",
- "resolved": "https://codeload.github.com/OpenVibers/OpenVibe.Shared/tar.gz/refs/tags/v4.206.0",
- "integrity": "sha512-mvkdGKmdYXDDV380k0DvdSVmBkg5tjYrw1La9BwNwp87NnR3mNlUCDDgAZTbyP1KyVGuK/zLodiM7bNV61zXfg==",
+ "version": "4.209.0",
+ "resolved": "https://codeload.github.com/OpenVibers/OpenVibe.Shared/tar.gz/refs/tags/v4.209.0",
+ "integrity": "sha512-gtsRDo9r2t/7AHQQEViVVByWRmT+16bCzIC2LSuFnfdoM+P5IrtesQc60xjoRR5umrzoSNEEQlVFE4WdNpc0bg==",
"license": "MIT",
"license": "MIT",
"dependencies": {
"dependencies": {
"clean-css": "^5.3.3",
"clean-css": "^5.3.3",
@@ -32,7 +32,7 @@
@@ -32,7 +32,7 @@
"iovalkey": "^0.4.0",
"iovalkey": "^0.4.0",
"openvibe-contracts": "https://codeload.github.com/OpenVibers/OpenVibe.Contracts/tar.gz/refs/tags/v0.406.0",
"openvibe-contracts": "https://codeload.github.com/OpenVibers/OpenVibe.Contracts/tar.gz/refs/tags/v0.406.0",
"openvibe-sdk": "https://codeload.github.com/OpenVibers/OpenVibe.SDK/tar.gz/refs/tags/v0.147.0",
"openvibe-sdk": "https://codeload.github.com/OpenVibers/OpenVibe.SDK/tar.gz/refs/tags/v0.147.0",
- "openvibe-shared": "https://codeload.github.com/OpenVibers/OpenVibe.Shared/tar.gz/refs/tags/v4.206.0",
+ "openvibe-shared": "https://codeload.github.com/OpenVibers/OpenVibe.Shared/tar.gz/refs/tags/v4.209.0",
"pg": "^8.23.0",
"pg": "^8.23.0",
"yaml": "^2.9.1"
"yaml": "^2.9.1"
},
},
@@ -98,6 +98,10 @@ function createAgentView({ config, sso, actorLimits, fetchImpl = (...a) => fetch
@@ -98,6 +98,10 @@ function createAgentView({ config, sso, actorLimits, fetchImpl = (...a) => fetch
state: row.state,
state: row.state,
title: row.title,
title: row.title,
task: row.task && typeof row.task === 'object' ? row.task : null,
task: row.task && typeof row.task === 'object' ? row.task : null,
+ // Live's S2 list already includes the newest step. Older Live deployments omit it.
+ current_step: row.current_step && typeof row.current_step.title === 'string'
+ ? { title: row.current_step.title.slice(0, 120), status: ['started', 'passed', 'failed', 'skipped'].includes(row.current_step.status) ? row.current_step.status : 'started' }
+ : null,
curtain: { up: !!(row.curtain && row.curtain.up) },
curtain: { up: !!(row.curtain && row.curtain.up) },
viewers: Number(row.viewers) || 0,
viewers: Number(row.viewers) || 0,
worked_seconds: Number(row.worked_seconds) || 0,
worked_seconds: Number(row.worked_seconds) || 0,
@@ -75,7 +75,7 @@ const STREAM = (o = {}) => ({
@@ -75,7 +75,7 @@ const STREAM = (o = {}) => ({
});
});
await check('the live stream comes with the embed, its ticket minted here, and the person\'s own token to Live', async () => {
await check('the live stream comes with the embed, its ticket minted here, and the person\'s own token to Live', async () => {
- live.streams = [STREAM({ state: 'ended', last_frame_url: 'https://openvibe.live/x' }), STREAM()];
+ live.streams = [STREAM({ state: 'ended', last_frame_url: 'https://openvibe.live/x' }), STREAM({ current_step: { title: 'Run the checkout tests', status: 'started' } })];
live.authorizations.length = 0; // this check's calls only (a token's iat is the second it was minted)
live.authorizations.length = 0; // this check's calls only (a token's iat is the second it was minted)
const token = t.network.userToken(ada);
const token = t.network.userToken(ada);
const res = await t.get('/api/v1/me/agent-view', { bearer: token });
const res = await t.get('/api/v1/me/agent-view', { bearer: token });
@@ -85,6 +85,7 @@ const STREAM = (o = {}) => ({
@@ -85,6 +85,7 @@ const STREAM = (o = {}) => ({
assert.strictEqual(a.state, 'live');
assert.strictEqual(a.state, 'live');
assert.strictEqual(a.title, 'Fix the flaky upload test');
assert.strictEqual(a.title, 'Fix the flaky upload test');
assert.deepStrictEqual(a.task, STREAM().task);
assert.deepStrictEqual(a.task, STREAM().task);
+ assert.deepStrictEqual(a.current_step, { title: 'Run the checkout tests', status: 'started' });
assert.deepStrictEqual([a.viewers, a.worked_seconds], [2, 720]);
assert.deepStrictEqual([a.viewers, a.worked_seconds], [2, 720]);
assert.strictEqual(a.embed_url, `https://openvibe.live/embed/agent/${LIVE_ID}?vt=wvt_the_view_ticket`);
assert.strictEqual(a.embed_url, `https://openvibe.live/embed/agent/${LIVE_ID}?vt=wvt_the_view_ticket`);
assert.strictEqual(a.page_url, `https://openvibe.live/@ada/agents/${LIVE_ID}`);
assert.strictEqual(a.page_url, `https://openvibe.live/@ada/agents/${LIVE_ID}`);