-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Fix changing of scene capabilities (#323)
* fix: Fix changing of scene capabilities * chore: @inworld/web-core 2.9.2-beta.0 * fix: Don't send loadScene if scene name is not changed * chore: @inworld/web-core 2.9.2-beta.1 * fix: Make name optional * chore: @inworld/web-core 2.9.2-beta.2 * chore: Upgade yarn * fix: Take into account main logs value * feat: Add capabilities tests * feat: Allow to get current connection capabilities * fix: Fix tests * chore: Update yarn.lock * fix: Add logs capability automatically * chore: @inworld/web-core 2.9.2-beta.4 --------- Co-authored-by: CI-inworld <[email protected]>
- Loading branch information
1 parent
6b03682
commit 977110b
Showing
23 changed files
with
1,344 additions
and
989 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
enableGlobalCache: true | ||
npmPublishAccess: public | ||
|
||
nodeLinker: node-modules | ||
yarnPath: .yarn/releases/yarn-4.3.0.cjs | ||
|
||
npmPublishAccess: public | ||
|
||
yarnPath: .yarn/releases/yarn-4.5.3.cjs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,5 +48,5 @@ | |
"ts-jest": "^29.1.2", | ||
"typescript": "^5.5.2" | ||
}, | ||
"packageManager": "yarn@4.3.0" | ||
"packageManager": "yarn@4.5.3" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
## [Unreleased] | ||
|
||
### Fixed | ||
|
||
- Fix changing of scene capabilities | ||
|
||
## [2.9.1] - 2024-12-03 | ||
|
||
### Added | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
75 changes: 75 additions & 0 deletions
75
packages/web-core/__tests__/entities/capability.entity.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
import { Capability } from '../../src/entities/capability.entity'; | ||
|
||
test('should convert empty capabilities to proto', () => { | ||
const proto = Capability.toProto({}); | ||
|
||
expect(proto).toEqual({ | ||
audio: true, | ||
debugInfo: false, | ||
emotions: false, | ||
interruptions: false, | ||
logs: true, | ||
logsWarning: true, | ||
logsInfo: true, | ||
logsDebug: false, | ||
logsInternal: false, | ||
multiAgent: true, | ||
multiModalActionPlanning: false, | ||
narratedActions: false, | ||
perceivedLatencyReport: true, | ||
phonemeInfo: false, | ||
pingPongReport: true, | ||
silenceEvents: false, | ||
}); | ||
}); | ||
|
||
test('should convert logsInfo capabilities to proto', () => { | ||
const capabilities = { | ||
logsWarning: false, | ||
logsInfo: true, | ||
logsDebug: false, | ||
logsInternal: false, | ||
}; | ||
|
||
const proto = Capability.toProto(capabilities); | ||
|
||
expect(proto.logs).toEqual(true); | ||
expect(proto.logsWarning).toEqual(false); | ||
expect(proto.logsInfo).toEqual(true); | ||
expect(proto.logsDebug).toEqual(false); | ||
expect(proto.logsInternal).toEqual(false); | ||
}); | ||
|
||
test('should convert logsDebug capabilities to proto', () => { | ||
const capabilities = { | ||
logsWarning: false, | ||
logsInfo: false, | ||
logsDebug: true, | ||
logsInternal: false, | ||
}; | ||
|
||
const proto = Capability.toProto(capabilities); | ||
|
||
expect(proto.logs).toEqual(true); | ||
expect(proto.logsWarning).toEqual(false); | ||
expect(proto.logsInfo).toEqual(false); | ||
expect(proto.logsDebug).toEqual(true); | ||
expect(proto.logsInternal).toEqual(false); | ||
}); | ||
|
||
test('should convert logsInternal capabilities to proto', () => { | ||
const capabilities = { | ||
logsWarning: false, | ||
logsInfo: false, | ||
logsDebug: false, | ||
logsInternal: true, | ||
}; | ||
|
||
const proto = Capability.toProto(capabilities); | ||
|
||
expect(proto.logs).toEqual(true); | ||
expect(proto.logsWarning).toEqual(false); | ||
expect(proto.logsInfo).toEqual(false); | ||
expect(proto.logsDebug).toEqual(false); | ||
expect(proto.logsInternal).toEqual(true); | ||
}); |
4 changes: 2 additions & 2 deletions
4
.../entities/emotion_behavior.entity.spec.ts → ...s/emotion/emotion_behavior.entity.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
.../entities/emotion_strength.entity.spec.ts → ...s/emotion/emotion_strength.entity.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
packages/web-core/__tests__/entities/packets/task.entity.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import { v4 } from 'uuid'; | ||
|
||
import { TaskEvent } from '../../../src/entities/packets/task.entity'; | ||
|
||
test('should get fields', () => { | ||
const name = v4(); | ||
const parameters = [ | ||
{ | ||
name: v4(), | ||
value: v4(), | ||
}, | ||
]; | ||
const task = new TaskEvent({ | ||
name, | ||
parameters, | ||
}); | ||
|
||
expect(task.name).toEqual(name); | ||
expect(task.parameters).toEqual(parameters); | ||
}); | ||
|
||
test('shoulf get fields without parameters', () => { | ||
const name = v4(); | ||
const task = new TaskEvent({ | ||
name, | ||
}); | ||
|
||
expect(task.name).toEqual(name); | ||
expect(task.parameters).toBeUndefined(); | ||
}); | ||
|
||
test('should convert from proto', () => { | ||
const proto = { | ||
name: v4(), | ||
parameters: [ | ||
{ | ||
name: v4(), | ||
value: v4(), | ||
}, | ||
], | ||
}; | ||
const packet = TaskEvent.fromProto(proto); | ||
|
||
expect(packet.name).toEqual(proto.name); | ||
expect(packet.parameters).toEqual(packet.parameters); | ||
}); | ||
|
||
test('should convert from proto without parameters', () => { | ||
const proto = { name: v4() }; | ||
const packet = TaskEvent.fromProto(proto); | ||
|
||
expect(packet.name).toEqual(proto.name); | ||
expect(packet.parameters).toBeUndefined(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.