@coasys/ad4m 0.10.1-rc9-dev → 0.10.1-release-candidate-2
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/lib/index.cjs +3179 -811
- package/lib/index.js +3171 -807
- package/lib/src/Literal.js +4 -1
- package/lib/src/ai/AIClient.d.ts +1 -1
- package/lib/src/ai/AIClient.js +6 -6
- package/lib/src/ai/AIResolver.d.ts +1 -1
- package/lib/src/ai/AIResolver.js +7 -4
- package/lib/src/index.d.ts +4 -3
- package/lib/src/index.js +4 -3
- package/lib/src/model/Ad4mModel.d.ts +609 -0
- package/lib/src/model/Ad4mModel.js +1048 -0
- package/lib/src/{subject → model}/Subject.d.ts +2 -2
- package/lib/src/{subject → model}/Subject.js +18 -18
- package/lib/src/model/decorators.d.ts +502 -0
- package/lib/src/model/decorators.js +683 -0
- package/lib/src/neighbourhood/NeighbourhoodClient.d.ts +2 -2
- package/lib/src/neighbourhood/NeighbourhoodClient.js +16 -10
- package/lib/src/neighbourhood/NeighbourhoodProxy.d.ts +2 -2
- package/lib/src/neighbourhood/NeighbourhoodProxy.js +4 -4
- package/lib/src/neighbourhood/NeighbourhoodProxy.test.d.ts +1 -0
- package/lib/src/neighbourhood/NeighbourhoodProxy.test.js +31 -0
- package/lib/src/neighbourhood/NeighbourhoodResolver.d.ts +2 -2
- package/lib/src/neighbourhood/NeighbourhoodResolver.js +6 -4
- package/lib/src/perspectives/PerspectiveClient.d.ts +18 -11
- package/lib/src/perspectives/PerspectiveClient.js +116 -49
- package/lib/src/perspectives/PerspectiveProxy.d.ts +471 -54
- package/lib/src/perspectives/PerspectiveProxy.js +579 -64
- package/lib/src/perspectives/PerspectiveResolver.d.ts +23 -9
- package/lib/src/perspectives/PerspectiveResolver.js +140 -46
- package/lib/src/runtime/RuntimeClient.d.ts +5 -1
- package/lib/src/runtime/RuntimeClient.js +48 -0
- package/lib/src/runtime/RuntimeResolver.d.ts +24 -0
- package/lib/src/runtime/RuntimeResolver.js +117 -0
- package/lib/src/schema.gql +25 -11
- package/lib/src/typeDefs.js +25 -11
- package/package.json +2 -1
- package/src/Literal.ts +4 -1
- package/src/ai/AIClient.ts +6 -6
- package/src/ai/AIResolver.ts +6 -3
- package/src/index.ts +4 -3
- package/src/model/Ad4mModel.ts +1206 -0
- package/src/{subject → model}/Subject.ts +16 -16
- package/src/{subject/SDNADecorators.ts → model/decorators.ts} +384 -50
- package/src/neighbourhood/NeighbourhoodClient.ts +16 -10
- package/src/neighbourhood/NeighbourhoodProxy.test.ts +45 -0
- package/src/neighbourhood/NeighbourhoodProxy.ts +4 -4
- package/src/neighbourhood/NeighbourhoodResolver.ts +2 -2
- package/src/perspectives/PerspectiveClient.ts +122 -51
- package/src/perspectives/PerspectiveProxy.ts +642 -77
- package/src/perspectives/PerspectiveResolver.ts +126 -23
- package/src/runtime/RuntimeClient.ts +52 -1
- package/src/runtime/RuntimeResolver.ts +77 -0
- package/lib/src/subject/SDNADecorators.d.ts +0 -188
- package/lib/src/subject/SDNADecorators.js +0 -360
- package/lib/src/subject/SubjectEntity.d.ts +0 -110
- package/lib/src/subject/SubjectEntity.js +0 -288
- package/src/subject/SubjectEntity.ts +0 -336
- package/yarn-error.log +0 -90
- /package/lib/src/{subject → model}/util.d.ts +0 -0
- /package/lib/src/{subject → model}/util.js +0 -0
- /package/src/{subject → model}/util.ts +0 -0
package/lib/src/Literal.js
CHANGED
|
@@ -34,7 +34,7 @@ export class Literal {
|
|
|
34
34
|
toUrl() {
|
|
35
35
|
if (__classPrivateFieldGet(this, _Literal_url, "f") && !__classPrivateFieldGet(this, _Literal_literal, "f"))
|
|
36
36
|
return __classPrivateFieldGet(this, _Literal_url, "f");
|
|
37
|
-
if (!__classPrivateFieldGet(this, _Literal_url, "f") &&
|
|
37
|
+
if (!__classPrivateFieldGet(this, _Literal_url, "f") && (__classPrivateFieldGet(this, _Literal_literal, "f") === undefined || __classPrivateFieldGet(this, _Literal_literal, "f") === "" || __classPrivateFieldGet(this, _Literal_literal, "f") === null))
|
|
38
38
|
throw new Error("Can't turn empty Literal into URL");
|
|
39
39
|
let encoded;
|
|
40
40
|
switch (typeof __classPrivateFieldGet(this, _Literal_literal, "f")) {
|
|
@@ -44,6 +44,9 @@ export class Literal {
|
|
|
44
44
|
case 'number':
|
|
45
45
|
encoded = `number:${encodeRFC3986URIComponent(__classPrivateFieldGet(this, _Literal_literal, "f"))}`;
|
|
46
46
|
break;
|
|
47
|
+
case 'boolean':
|
|
48
|
+
encoded = `boolean:${encodeRFC3986URIComponent(__classPrivateFieldGet(this, _Literal_literal, "f"))}`;
|
|
49
|
+
break;
|
|
47
50
|
case 'object':
|
|
48
51
|
encoded = `json:${encodeRFC3986URIComponent(JSON.stringify(__classPrivateFieldGet(this, _Literal_literal, "f")))}`;
|
|
49
52
|
break;
|
package/lib/src/ai/AIClient.d.ts
CHANGED
|
@@ -28,5 +28,5 @@ export declare class AIClient {
|
|
|
28
28
|
timeBeforeSpeech?: number;
|
|
29
29
|
}): Promise<string>;
|
|
30
30
|
closeTranscriptionStream(streamId: string): Promise<void>;
|
|
31
|
-
feedTranscriptionStream(
|
|
31
|
+
feedTranscriptionStream(streamIds: string | string[], audio: Float32Array): Promise<void>;
|
|
32
32
|
}
|
package/lib/src/ai/AIClient.js
CHANGED
|
@@ -324,19 +324,19 @@ export class AIClient {
|
|
|
324
324
|
}
|
|
325
325
|
return aiCloseTranscriptionStream;
|
|
326
326
|
}
|
|
327
|
-
async feedTranscriptionStream(
|
|
328
|
-
const {
|
|
327
|
+
async feedTranscriptionStream(streamIds, audio) {
|
|
328
|
+
const { aiFeedTranscriptionStream } = unwrapApolloResult(await __classPrivateFieldGet(this, _AIClient_apolloClient, "f").mutate({
|
|
329
329
|
mutation: gql `
|
|
330
|
-
mutation AiFeedTranscriptionStream($
|
|
331
|
-
aiFeedTranscriptionStream(
|
|
330
|
+
mutation AiFeedTranscriptionStream($streamIds: [String!]!, $audio: [Float!]!) {
|
|
331
|
+
aiFeedTranscriptionStream(streamIds: $streamIds, audio: $audio)
|
|
332
332
|
}
|
|
333
333
|
`,
|
|
334
334
|
variables: {
|
|
335
|
-
|
|
335
|
+
streamIds: Array.isArray(streamIds) ? streamIds : [streamIds],
|
|
336
336
|
audio: audio
|
|
337
337
|
}
|
|
338
338
|
}));
|
|
339
|
-
return
|
|
339
|
+
return aiFeedTranscriptionStream;
|
|
340
340
|
}
|
|
341
341
|
}
|
|
342
342
|
_AIClient_apolloClient = new WeakMap(), _AIClient_transcriptionSubscriptions = new WeakMap();
|
|
@@ -70,6 +70,6 @@ export default class AIResolver {
|
|
|
70
70
|
aiEmbed(modelId: string, text: string): string;
|
|
71
71
|
aiOpenTranscriptionStream(modelId: string, params?: VoiceActivityParamsInput): string;
|
|
72
72
|
aiCloseTranscriptionStream(streamId: string): boolean;
|
|
73
|
-
aiFeedTranscriptionStream(
|
|
73
|
+
aiFeedTranscriptionStream(streamIds: string[], audio: number[], pubSub: any): boolean;
|
|
74
74
|
aiTranscriptionText(streamId: string): string;
|
|
75
75
|
}
|
package/lib/src/ai/AIResolver.js
CHANGED
|
@@ -313,8 +313,11 @@ let AIResolver = class AIResolver {
|
|
|
313
313
|
aiCloseTranscriptionStream(streamId) {
|
|
314
314
|
return true;
|
|
315
315
|
}
|
|
316
|
-
aiFeedTranscriptionStream(
|
|
317
|
-
|
|
316
|
+
aiFeedTranscriptionStream(streamIds, audio, pubSub) {
|
|
317
|
+
// Publish for each stream ID
|
|
318
|
+
for (const streamId of streamIds) {
|
|
319
|
+
pubSub.publish(AI_TRANSCRIPTION_TEXT_TOPIC, { streamId });
|
|
320
|
+
}
|
|
318
321
|
return true;
|
|
319
322
|
}
|
|
320
323
|
aiTranscriptionText(streamId) {
|
|
@@ -432,11 +435,11 @@ __decorate([
|
|
|
432
435
|
], AIResolver.prototype, "aiCloseTranscriptionStream", null);
|
|
433
436
|
__decorate([
|
|
434
437
|
Mutation(() => String),
|
|
435
|
-
__param(0, Arg("
|
|
438
|
+
__param(0, Arg("streamIds", type => [String])),
|
|
436
439
|
__param(1, Arg("audio", () => [Float])),
|
|
437
440
|
__param(2, PubSub()),
|
|
438
441
|
__metadata("design:type", Function),
|
|
439
|
-
__metadata("design:paramtypes", [
|
|
442
|
+
__metadata("design:paramtypes", [Array, Array, Object]),
|
|
440
443
|
__metadata("design:returntype", Boolean)
|
|
441
444
|
], AIResolver.prototype, "aiFeedTranscriptionStream", null);
|
|
442
445
|
__decorate([
|
package/lib/src/index.d.ts
CHANGED
|
@@ -19,14 +19,15 @@ export * from "./perspectives/PerspectiveProxy";
|
|
|
19
19
|
export * from "./perspectives/PerspectiveDiff";
|
|
20
20
|
export * from "./perspectives/LinkQuery";
|
|
21
21
|
export * from "./SmartLiteral";
|
|
22
|
-
export * from "./
|
|
23
|
-
export * from "./
|
|
22
|
+
export * from "./model/decorators";
|
|
23
|
+
export * from "./model/Subject";
|
|
24
24
|
export * from "./neighbourhood/Neighbourhood";
|
|
25
25
|
export * from "./neighbourhood/NeighbourhoodProxy";
|
|
26
26
|
export * from "./typeDefs";
|
|
27
27
|
export * from "./DID";
|
|
28
28
|
export * from "./utils";
|
|
29
|
-
export * from './subject/SubjectEntity';
|
|
30
29
|
export * from "./agent/AgentClient";
|
|
31
30
|
export * from "./ai/AIClient";
|
|
32
31
|
export * from "./ai/Tasks";
|
|
32
|
+
export * from "./runtime/RuntimeResolver";
|
|
33
|
+
export * from './model/Ad4mModel';
|
package/lib/src/index.js
CHANGED
|
@@ -19,14 +19,15 @@ export * from "./perspectives/PerspectiveProxy";
|
|
|
19
19
|
export * from "./perspectives/PerspectiveDiff";
|
|
20
20
|
export * from "./perspectives/LinkQuery";
|
|
21
21
|
export * from "./SmartLiteral";
|
|
22
|
-
export * from "./
|
|
23
|
-
export * from "./
|
|
22
|
+
export * from "./model/decorators";
|
|
23
|
+
export * from "./model/Subject";
|
|
24
24
|
export * from "./neighbourhood/Neighbourhood";
|
|
25
25
|
export * from "./neighbourhood/NeighbourhoodProxy";
|
|
26
26
|
export * from "./typeDefs";
|
|
27
27
|
export * from "./DID";
|
|
28
28
|
export * from "./utils";
|
|
29
|
-
export * from './subject/SubjectEntity';
|
|
30
29
|
export * from "./agent/AgentClient";
|
|
31
30
|
export * from "./ai/AIClient";
|
|
32
31
|
export * from "./ai/Tasks";
|
|
32
|
+
export * from "./runtime/RuntimeResolver";
|
|
33
|
+
export * from './model/Ad4mModel';
|