@coasys/ad4m 0.10.1-rc8 → 0.10.1-rc9-dev

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 CHANGED
@@ -14275,15 +14275,16 @@ class AIClient {
14275
14275
  const decompressed = JSON.parse(pako.inflate(compressed, { to: 'string' }));
14276
14276
  return decompressed;
14277
14277
  }
14278
- async openTranscriptionStream(modelId, streamCallback) {
14278
+ async openTranscriptionStream(modelId, streamCallback, params) {
14279
14279
  const { aiOpenTranscriptionStream } = unwrapApolloResult(await __classPrivateFieldGet$3(this, _AIClient_apolloClient, "f").mutate({
14280
14280
  mutation: gql `
14281
- mutation AiOpenTranscriptionStream($modelId: String!) {
14282
- aiOpenTranscriptionStream(modelId: $modelId)
14281
+ mutation AiOpenTranscriptionStream($modelId: String!, $params: VoiceActivityParamsInput) {
14282
+ aiOpenTranscriptionStream(modelId: $modelId, params: $params)
14283
14283
  }
14284
14284
  `,
14285
14285
  variables: {
14286
- modelId
14286
+ modelId,
14287
+ params
14287
14288
  }
14288
14289
  }));
14289
14290
  const subscription = __classPrivateFieldGet$3(this, _AIClient_apolloClient, "f").subscribe({
@@ -15539,7 +15540,7 @@ type Mutation {
15539
15540
  aiCloseTranscriptionStream(streamId: String!): String!
15540
15541
  aiEmbed(modelId: String!, text: String!): String!
15541
15542
  aiFeedTranscriptionStream(audio: [Float!]!, streamId: String!): String!
15542
- aiOpenTranscriptionStream(modelId: String!): String!
15543
+ aiOpenTranscriptionStream(modelId: String!, params: VoiceActivityParamsInput): String!
15543
15544
  aiPrompt(prompt: String!, taskId: String!): String!
15544
15545
  aiRemoveModel(modelId: String!): Boolean!
15545
15546
  aiRemoveTask(taskId: String!): AITask!
@@ -15754,6 +15755,14 @@ type TriggeredNotification {
15754
15755
  perspectiveId: String!
15755
15756
  triggerMatch: String!
15756
15757
  }
15758
+
15759
+ input VoiceActivityParamsInput {
15760
+ endThreshold: Float
15761
+ endWindow: Float
15762
+ startThreshold: Float
15763
+ startWindow: Float
15764
+ timeBeforeSpeech: Float
15765
+ }
15757
15766
  `;
15758
15767
 
15759
15768
  function formatList(list) {
package/lib/index.js CHANGED
@@ -14271,15 +14271,16 @@ class AIClient {
14271
14271
  const decompressed = JSON.parse(pako.inflate(compressed, { to: 'string' }));
14272
14272
  return decompressed;
14273
14273
  }
14274
- async openTranscriptionStream(modelId, streamCallback) {
14274
+ async openTranscriptionStream(modelId, streamCallback, params) {
14275
14275
  const { aiOpenTranscriptionStream } = unwrapApolloResult(await __classPrivateFieldGet$3(this, _AIClient_apolloClient, "f").mutate({
14276
14276
  mutation: gql `
14277
- mutation AiOpenTranscriptionStream($modelId: String!) {
14278
- aiOpenTranscriptionStream(modelId: $modelId)
14277
+ mutation AiOpenTranscriptionStream($modelId: String!, $params: VoiceActivityParamsInput) {
14278
+ aiOpenTranscriptionStream(modelId: $modelId, params: $params)
14279
14279
  }
14280
14280
  `,
14281
14281
  variables: {
14282
- modelId
14282
+ modelId,
14283
+ params
14283
14284
  }
14284
14285
  }));
14285
14286
  const subscription = __classPrivateFieldGet$3(this, _AIClient_apolloClient, "f").subscribe({
@@ -15535,7 +15536,7 @@ type Mutation {
15535
15536
  aiCloseTranscriptionStream(streamId: String!): String!
15536
15537
  aiEmbed(modelId: String!, text: String!): String!
15537
15538
  aiFeedTranscriptionStream(audio: [Float!]!, streamId: String!): String!
15538
- aiOpenTranscriptionStream(modelId: String!): String!
15539
+ aiOpenTranscriptionStream(modelId: String!, params: VoiceActivityParamsInput): String!
15539
15540
  aiPrompt(prompt: String!, taskId: String!): String!
15540
15541
  aiRemoveModel(modelId: String!): Boolean!
15541
15542
  aiRemoveTask(taskId: String!): AITask!
@@ -15750,6 +15751,14 @@ type TriggeredNotification {
15750
15751
  perspectiveId: String!
15751
15752
  triggerMatch: String!
15752
15753
  }
15754
+
15755
+ input VoiceActivityParamsInput {
15756
+ endThreshold: Float
15757
+ endWindow: Float
15758
+ startThreshold: Float
15759
+ startWindow: Float
15760
+ timeBeforeSpeech: Float
15761
+ }
15753
15762
  `;
15754
15763
 
15755
15764
  function formatList(list) {
@@ -20,7 +20,13 @@ export declare class AIClient {
20
20
  modelLoadingStatus(model: string): Promise<AIModelLoadingStatus>;
21
21
  prompt(taskId: string, prompt: string): Promise<string>;
22
22
  embed(modelId: string, text: string): Promise<Array<number>>;
23
- openTranscriptionStream(modelId: string, streamCallback: (text: string) => void): Promise<string>;
23
+ openTranscriptionStream(modelId: string, streamCallback: (text: string) => void, params?: {
24
+ startThreshold?: number;
25
+ startWindow?: number;
26
+ endThreshold?: number;
27
+ endWindow?: number;
28
+ timeBeforeSpeech?: number;
29
+ }): Promise<string>;
24
30
  closeTranscriptionStream(streamId: string): Promise<void>;
25
31
  feedTranscriptionStream(streamId: string, audio: Float32Array): Promise<void>;
26
32
  }
@@ -279,15 +279,16 @@ export class AIClient {
279
279
  const decompressed = JSON.parse(pako.inflate(compressed, { to: 'string' }));
280
280
  return decompressed;
281
281
  }
282
- async openTranscriptionStream(modelId, streamCallback) {
282
+ async openTranscriptionStream(modelId, streamCallback, params) {
283
283
  const { aiOpenTranscriptionStream } = unwrapApolloResult(await __classPrivateFieldGet(this, _AIClient_apolloClient, "f").mutate({
284
284
  mutation: gql `
285
- mutation AiOpenTranscriptionStream($modelId: String!) {
286
- aiOpenTranscriptionStream(modelId: $modelId)
285
+ mutation AiOpenTranscriptionStream($modelId: String!, $params: VoiceActivityParamsInput) {
286
+ aiOpenTranscriptionStream(modelId: $modelId, params: $params)
287
287
  }
288
288
  `,
289
289
  variables: {
290
- modelId
290
+ modelId,
291
+ params
291
292
  }
292
293
  }));
293
294
  const subscription = __classPrivateFieldGet(this, _AIClient_apolloClient, "f").subscribe({
@@ -47,6 +47,13 @@ export declare class ModelInput {
47
47
  local?: LocalModelInput;
48
48
  modelType: ModelType;
49
49
  }
50
+ export declare class VoiceActivityParamsInput {
51
+ startThreshold?: number;
52
+ startWindow?: number;
53
+ endThreshold?: number;
54
+ endWindow?: number;
55
+ timeBeforeSpeech?: number;
56
+ }
50
57
  export default class AIResolver {
51
58
  aiGetModels(): Model[];
52
59
  aiAddModel(model: ModelInput): string;
@@ -61,7 +68,7 @@ export default class AIResolver {
61
68
  aiModelLoadingStatus(model: string): AIModelLoadingStatus;
62
69
  aiPrompt(taskId: string, input: string): string;
63
70
  aiEmbed(modelId: string, text: string): string;
64
- aiOpenTranscriptionStream(modelId: string): string;
71
+ aiOpenTranscriptionStream(modelId: string, params?: VoiceActivityParamsInput): string;
65
72
  aiCloseTranscriptionStream(streamId: string): boolean;
66
73
  aiFeedTranscriptionStream(streamId: string, audio: number[], pubSub: any): boolean;
67
74
  aiTranscriptionText(streamId: string): string;
@@ -189,6 +189,32 @@ ModelInput = __decorate([
189
189
  InputType()
190
190
  ], ModelInput);
191
191
  export { ModelInput };
192
+ let VoiceActivityParamsInput = class VoiceActivityParamsInput {
193
+ };
194
+ __decorate([
195
+ Field(() => Float, { nullable: true }),
196
+ __metadata("design:type", Number)
197
+ ], VoiceActivityParamsInput.prototype, "startThreshold", void 0);
198
+ __decorate([
199
+ Field(() => Float, { nullable: true }),
200
+ __metadata("design:type", Number)
201
+ ], VoiceActivityParamsInput.prototype, "startWindow", void 0);
202
+ __decorate([
203
+ Field(() => Float, { nullable: true }),
204
+ __metadata("design:type", Number)
205
+ ], VoiceActivityParamsInput.prototype, "endThreshold", void 0);
206
+ __decorate([
207
+ Field(() => Float, { nullable: true }),
208
+ __metadata("design:type", Number)
209
+ ], VoiceActivityParamsInput.prototype, "endWindow", void 0);
210
+ __decorate([
211
+ Field(() => Float, { nullable: true }),
212
+ __metadata("design:type", Number)
213
+ ], VoiceActivityParamsInput.prototype, "timeBeforeSpeech", void 0);
214
+ VoiceActivityParamsInput = __decorate([
215
+ InputType()
216
+ ], VoiceActivityParamsInput);
217
+ export { VoiceActivityParamsInput };
192
218
  let AIResolver = class AIResolver {
193
219
  aiGetModels() {
194
220
  return [
@@ -281,7 +307,7 @@ let AIResolver = class AIResolver {
281
307
  const compressedString = base64js.fromByteArray(compressed);
282
308
  return compressedString;
283
309
  }
284
- aiOpenTranscriptionStream(modelId) {
310
+ aiOpenTranscriptionStream(modelId, params) {
285
311
  return "streamId";
286
312
  }
287
313
  aiCloseTranscriptionStream(streamId) {
@@ -392,8 +418,9 @@ __decorate([
392
418
  __decorate([
393
419
  Mutation(() => String),
394
420
  __param(0, Arg("modelId")),
421
+ __param(1, Arg("params", () => VoiceActivityParamsInput, { nullable: true })),
395
422
  __metadata("design:type", Function),
396
- __metadata("design:paramtypes", [String]),
423
+ __metadata("design:paramtypes", [String, VoiceActivityParamsInput]),
397
424
  __metadata("design:returntype", String)
398
425
  ], AIResolver.prototype, "aiOpenTranscriptionStream", null);
399
426
  __decorate([
@@ -314,7 +314,7 @@ type Mutation {
314
314
  aiCloseTranscriptionStream(streamId: String!): String!
315
315
  aiEmbed(modelId: String!, text: String!): String!
316
316
  aiFeedTranscriptionStream(audio: [Float!]!, streamId: String!): String!
317
- aiOpenTranscriptionStream(modelId: String!): String!
317
+ aiOpenTranscriptionStream(modelId: String!, params: VoiceActivityParamsInput): String!
318
318
  aiPrompt(prompt: String!, taskId: String!): String!
319
319
  aiRemoveModel(modelId: String!): Boolean!
320
320
  aiRemoveTask(taskId: String!): AITask!
@@ -529,3 +529,11 @@ type TriggeredNotification {
529
529
  perspectiveId: String!
530
530
  triggerMatch: String!
531
531
  }
532
+
533
+ input VoiceActivityParamsInput {
534
+ endThreshold: Float
535
+ endWindow: Float
536
+ startThreshold: Float
537
+ startWindow: Float
538
+ timeBeforeSpeech: Float
539
+ }
@@ -310,7 +310,7 @@ type Mutation {
310
310
  aiCloseTranscriptionStream(streamId: String!): String!
311
311
  aiEmbed(modelId: String!, text: String!): String!
312
312
  aiFeedTranscriptionStream(audio: [Float!]!, streamId: String!): String!
313
- aiOpenTranscriptionStream(modelId: String!): String!
313
+ aiOpenTranscriptionStream(modelId: String!, params: VoiceActivityParamsInput): String!
314
314
  aiPrompt(prompt: String!, taskId: String!): String!
315
315
  aiRemoveModel(modelId: String!): Boolean!
316
316
  aiRemoveTask(taskId: String!): AITask!
@@ -525,4 +525,12 @@ type TriggeredNotification {
525
525
  perspectiveId: String!
526
526
  triggerMatch: String!
527
527
  }
528
+
529
+ input VoiceActivityParamsInput {
530
+ endThreshold: Float
531
+ endWindow: Float
532
+ startThreshold: Float
533
+ startWindow: Float
534
+ timeBeforeSpeech: Float
535
+ }
528
536
  `
package/package.json CHANGED
@@ -5,7 +5,6 @@
5
5
  "module": "lib/index.js",
6
6
  "types": "lib/src/index.d.ts",
7
7
  "type": "module",
8
- "private": false,
9
8
  "scripts": {
10
9
  "build": "patch-package && tsc && pnpm run buildSchema && pnpm run bundle",
11
10
  "buildSchema": "node --es-module-specifier-resolution=node lib/src/buildSchema.js",
@@ -69,5 +68,5 @@
69
68
  "graphql@15.7.2": "patches/graphql@15.7.2.patch"
70
69
  }
71
70
  },
72
- "version": "0.10.1-rc8"
71
+ "version": "0.10.1-rc9-dev"
73
72
  }
@@ -293,15 +293,26 @@ export class AIClient {
293
293
  return decompressed;
294
294
  }
295
295
 
296
- async openTranscriptionStream(modelId: string, streamCallback: (text: string) => void): Promise<string> {
296
+ async openTranscriptionStream(
297
+ modelId: string,
298
+ streamCallback: (text: string) => void,
299
+ params?: {
300
+ startThreshold?: number;
301
+ startWindow?: number;
302
+ endThreshold?: number;
303
+ endWindow?: number;
304
+ timeBeforeSpeech?: number;
305
+ }
306
+ ): Promise<string> {
297
307
  const { aiOpenTranscriptionStream } = unwrapApolloResult(await this.#apolloClient.mutate({
298
308
  mutation: gql`
299
- mutation AiOpenTranscriptionStream($modelId: String!) {
300
- aiOpenTranscriptionStream(modelId: $modelId)
309
+ mutation AiOpenTranscriptionStream($modelId: String!, $params: VoiceActivityParamsInput) {
310
+ aiOpenTranscriptionStream(modelId: $modelId, params: $params)
301
311
  }
302
312
  `,
303
313
  variables: {
304
- modelId
314
+ modelId,
315
+ params
305
316
  }
306
317
  }));
307
318
 
@@ -127,6 +127,24 @@ export class ModelInput {
127
127
  modelType: ModelType;
128
128
  }
129
129
 
130
+ @InputType()
131
+ export class VoiceActivityParamsInput {
132
+ @Field(() => Float, { nullable: true })
133
+ startThreshold?: number;
134
+
135
+ @Field(() => Float, { nullable: true })
136
+ startWindow?: number;
137
+
138
+ @Field(() => Float, { nullable: true })
139
+ endThreshold?: number;
140
+
141
+ @Field(() => Float, { nullable: true })
142
+ endWindow?: number;
143
+
144
+ @Field(() => Float, { nullable: true })
145
+ timeBeforeSpeech?: number;
146
+ }
147
+
130
148
  @Resolver()
131
149
  export default class AIResolver {
132
150
  @Query(returns => [Model])
@@ -319,7 +337,8 @@ export default class AIResolver {
319
337
 
320
338
  @Mutation(() => String)
321
339
  aiOpenTranscriptionStream(
322
- @Arg("modelId") modelId: string
340
+ @Arg("modelId") modelId: string,
341
+ @Arg("params", () => VoiceActivityParamsInput, { nullable: true }) params?: VoiceActivityParamsInput
323
342
  ): string {
324
343
  return "streamId"
325
344
  }
package/yarn-error.log ADDED
@@ -0,0 +1,90 @@
1
+ Arguments:
2
+ /Users/nicolasluck/.nvm/versions/node/v18.16.1/bin/node /Users/nicolasluck/.nvm/versions/node/v18.16.1/bin/yarn install
3
+
4
+ PATH:
5
+ /Users/nicolasluck/Library/pnpm:/Users/nicolasluck/.nvm/versions/node/v18.16.1/bin:/Library/Frameworks/Python.framework/Versions/3.11/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Library/Apple/usr/bin:/usr/local/MacGPG2/bin:/Users/nicolasluck/.cargo/bin
6
+
7
+ Yarn version:
8
+ 1.22.19
9
+
10
+ Node version:
11
+ 18.16.1
12
+
13
+ Platform:
14
+ darwin arm64
15
+
16
+ Trace:
17
+ Error: ENOENT: no such file or directory, copyfile '/Users/nicolasluck/Library/Caches/Yarn/v6/npm-has-flag-3.0.0-b5d454dc2199ae225699f3467e5a07f3b955bafd-integrity/node_modules/has-flag/index.js' -> '/Users/nicolasluck/Coasys/code/ad4m/node_modules/@changesets/cli/node_modules/has-flag/index.js'
18
+
19
+ npm manifest:
20
+ {
21
+ "name": "@coasys/ad4m",
22
+ "description": "*The Agent-Centric Distributed Application Meta-ontology* or just: *Agent-Centric DApp Meta-ontology* * A new meta-ontology for interoperable, decentralized application design * A spanning-layer to enable seamless integration between Holochain DNAs, blockchains, linked-data structures/ontologies and centralized back-ends * The basis for turning distinct, monolithic and siloed apps into a global, open and interoperable sense-making network",
23
+ "main": "lib/index.cjs",
24
+ "module": "lib/index.js",
25
+ "types": "lib/src/index.d.ts",
26
+ "type": "module",
27
+ "private": true,
28
+ "scripts": {
29
+ "build": "patch-package && tsc && pnpm run buildSchema && pnpm run bundle",
30
+ "buildSchema": "node --es-module-specifier-resolution=node lib/src/buildSchema.js",
31
+ "bundle": "rollup -c rollup.config.js",
32
+ "test": "jest --forceExit"
33
+ },
34
+ "repository": {
35
+ "type": "git",
36
+ "url": "git+https://github.com/perspect3vism/ad4m.git"
37
+ },
38
+ "author": {
39
+ "name": "Nicolas Luck",
40
+ "email": "nicolas@lucksus.eu"
41
+ },
42
+ "contributors": [
43
+ {
44
+ "name": "Joshua Parkin",
45
+ "email": "joshuadparkin@gmail.com"
46
+ }
47
+ ],
48
+ "license": "CAL-1.0",
49
+ "bugs": {
50
+ "url": "https://github.com/perspect3vism/ad4m/issues"
51
+ },
52
+ "homepage": "https://ad4m.dev",
53
+ "dependencies": {
54
+ "@apollo/client": "3.7.10",
55
+ "@holochain/client": "0.16.0",
56
+ "@types/jest": "^26.0.14",
57
+ "class-validator": "^0.13.1",
58
+ "express": "4.18.2",
59
+ "graphql": "15.7.2",
60
+ "reflect-metadata": "^0.1.13",
61
+ "type-graphql": "1.1.1"
62
+ },
63
+ "devDependencies": {
64
+ "@apollo/server": "^4.9.4",
65
+ "@rollup/plugin-alias": "^3.1.5",
66
+ "@rollup/plugin-commonjs": "^20.0.0",
67
+ "@rollup/plugin-node-resolve": "^13.0.4",
68
+ "concat-md": "^0.5.0",
69
+ "cross-fetch": "^3.1.4",
70
+ "graphql-ws": "5.12.0",
71
+ "honkit": "^4.0.0",
72
+ "jest": "^26.6.0",
73
+ "patch-package": "^8.0.0",
74
+ "rollup": "^2.56.3",
75
+ "ts-jest": "^26.5.6",
76
+ "typescript": "^4.6.2",
77
+ "ws": "8.13.0",
78
+ "@types/node": "*",
79
+ "@types/yargs": "*"
80
+ },
81
+ "patchedDependencies": {},
82
+ "version": "0.9.1-prerelease"
83
+
84
+ }
85
+
86
+ yarn manifest:
87
+ No manifest
88
+
89
+ Lockfile:
90
+ No lockfile