@livekit/agents 0.4.6 → 0.5.0

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.
Files changed (197) hide show
  1. package/README.md +17 -0
  2. package/dist/audio.cjs +77 -0
  3. package/dist/audio.cjs.map +1 -0
  4. package/dist/audio.js +48 -37
  5. package/dist/audio.js.map +1 -1
  6. package/dist/cli.cjs +131 -0
  7. package/dist/cli.cjs.map +1 -0
  8. package/dist/cli.js +96 -122
  9. package/dist/cli.js.map +1 -1
  10. package/dist/generator.cjs +36 -0
  11. package/dist/generator.cjs.map +1 -0
  12. package/dist/generator.js +8 -22
  13. package/dist/generator.js.map +1 -1
  14. package/dist/http_server.cjs +72 -0
  15. package/dist/http_server.cjs.map +1 -0
  16. package/dist/http_server.d.ts +1 -1
  17. package/dist/http_server.js +44 -47
  18. package/dist/http_server.js.map +1 -1
  19. package/dist/index.cjs +78 -0
  20. package/dist/index.cjs.map +1 -0
  21. package/dist/index.js +26 -28
  22. package/dist/index.js.map +1 -1
  23. package/dist/ipc/job_executor.cjs +33 -0
  24. package/dist/ipc/job_executor.cjs.map +1 -0
  25. package/dist/ipc/job_executor.js +7 -4
  26. package/dist/ipc/job_executor.js.map +1 -1
  27. package/dist/ipc/job_main.cjs +147 -0
  28. package/dist/ipc/job_main.cjs.map +1 -0
  29. package/dist/ipc/job_main.d.ts +1 -1
  30. package/dist/ipc/job_main.js +103 -103
  31. package/dist/ipc/job_main.js.map +1 -1
  32. package/dist/ipc/message.cjs +17 -0
  33. package/dist/ipc/message.cjs.map +1 -0
  34. package/dist/ipc/message.js +0 -1
  35. package/dist/ipc/message.js.map +1 -1
  36. package/dist/ipc/proc_job_executor.cjs +174 -0
  37. package/dist/ipc/proc_job_executor.cjs.map +1 -0
  38. package/dist/ipc/proc_job_executor.js +130 -126
  39. package/dist/ipc/proc_job_executor.js.map +1 -1
  40. package/dist/ipc/proc_pool.cjs +126 -0
  41. package/dist/ipc/proc_pool.cjs.map +1 -0
  42. package/dist/ipc/proc_pool.js +93 -96
  43. package/dist/ipc/proc_pool.js.map +1 -1
  44. package/dist/job.cjs +230 -0
  45. package/dist/job.cjs.map +1 -0
  46. package/dist/job.js +195 -198
  47. package/dist/job.js.map +1 -1
  48. package/dist/llm/chat_context.cjs +131 -0
  49. package/dist/llm/chat_context.cjs.map +1 -0
  50. package/dist/llm/chat_context.js +98 -86
  51. package/dist/llm/chat_context.js.map +1 -1
  52. package/dist/llm/function_context.cjs +103 -0
  53. package/dist/llm/function_context.cjs.map +1 -0
  54. package/dist/llm/function_context.js +72 -81
  55. package/dist/llm/function_context.js.map +1 -1
  56. package/dist/llm/function_context.test.cjs +218 -0
  57. package/dist/llm/function_context.test.cjs.map +1 -0
  58. package/dist/llm/function_context.test.js +209 -210
  59. package/dist/llm/function_context.test.js.map +1 -1
  60. package/dist/llm/index.cjs +43 -0
  61. package/dist/llm/index.cjs.map +1 -0
  62. package/dist/llm/index.js +22 -6
  63. package/dist/llm/index.js.map +1 -1
  64. package/dist/llm/llm.cjs +76 -0
  65. package/dist/llm/llm.cjs.map +1 -0
  66. package/dist/llm/llm.js +48 -42
  67. package/dist/llm/llm.js.map +1 -1
  68. package/dist/log.cjs +57 -0
  69. package/dist/log.cjs.map +1 -0
  70. package/dist/log.js +27 -26
  71. package/dist/log.js.map +1 -1
  72. package/dist/multimodal/agent_playout.cjs +228 -0
  73. package/dist/multimodal/agent_playout.cjs.map +1 -0
  74. package/dist/multimodal/agent_playout.d.ts +1 -1
  75. package/dist/multimodal/agent_playout.js +193 -180
  76. package/dist/multimodal/agent_playout.js.map +1 -1
  77. package/dist/multimodal/index.cjs +25 -0
  78. package/dist/multimodal/index.cjs.map +1 -0
  79. package/dist/multimodal/index.js +2 -5
  80. package/dist/multimodal/index.js.map +1 -1
  81. package/dist/multimodal/multimodal_agent.cjs +404 -0
  82. package/dist/multimodal/multimodal_agent.cjs.map +1 -0
  83. package/dist/multimodal/multimodal_agent.d.ts +1 -1
  84. package/dist/multimodal/multimodal_agent.js +351 -330
  85. package/dist/multimodal/multimodal_agent.js.map +1 -1
  86. package/dist/pipeline/agent_output.cjs +172 -0
  87. package/dist/pipeline/agent_output.cjs.map +1 -0
  88. package/dist/pipeline/agent_output.js +136 -138
  89. package/dist/pipeline/agent_output.js.map +1 -1
  90. package/dist/pipeline/agent_playout.cjs +169 -0
  91. package/dist/pipeline/agent_playout.cjs.map +1 -0
  92. package/dist/pipeline/agent_playout.js +126 -136
  93. package/dist/pipeline/agent_playout.js.map +1 -1
  94. package/dist/pipeline/human_input.cjs +158 -0
  95. package/dist/pipeline/human_input.cjs.map +1 -0
  96. package/dist/pipeline/human_input.js +124 -125
  97. package/dist/pipeline/human_input.js.map +1 -1
  98. package/dist/pipeline/index.cjs +31 -0
  99. package/dist/pipeline/index.cjs.map +1 -0
  100. package/dist/pipeline/index.js +8 -4
  101. package/dist/pipeline/index.js.map +1 -1
  102. package/dist/pipeline/pipeline_agent.cjs +642 -0
  103. package/dist/pipeline/pipeline_agent.cjs.map +1 -0
  104. package/dist/pipeline/pipeline_agent.js +595 -651
  105. package/dist/pipeline/pipeline_agent.js.map +1 -1
  106. package/dist/pipeline/speech_handle.cjs +128 -0
  107. package/dist/pipeline/speech_handle.cjs.map +1 -0
  108. package/dist/pipeline/speech_handle.js +102 -100
  109. package/dist/pipeline/speech_handle.js.map +1 -1
  110. package/dist/plugin.cjs +46 -0
  111. package/dist/plugin.cjs.map +1 -0
  112. package/dist/plugin.js +20 -20
  113. package/dist/plugin.js.map +1 -1
  114. package/dist/stt/index.cjs +38 -0
  115. package/dist/stt/index.cjs.map +1 -0
  116. package/dist/stt/index.js +13 -5
  117. package/dist/stt/index.js.map +1 -1
  118. package/dist/stt/stream_adapter.cjs +87 -0
  119. package/dist/stt/stream_adapter.cjs.map +1 -0
  120. package/dist/stt/stream_adapter.js +58 -55
  121. package/dist/stt/stream_adapter.js.map +1 -1
  122. package/dist/stt/stt.cjs +98 -0
  123. package/dist/stt/stt.cjs.map +1 -0
  124. package/dist/stt/stt.js +63 -98
  125. package/dist/stt/stt.js.map +1 -1
  126. package/dist/tokenize/basic/basic.cjs +98 -0
  127. package/dist/tokenize/basic/basic.cjs.map +1 -0
  128. package/dist/tokenize/basic/basic.js +56 -45
  129. package/dist/tokenize/basic/basic.js.map +1 -1
  130. package/dist/tokenize/basic/hyphenator.cjs +425 -0
  131. package/dist/tokenize/basic/hyphenator.cjs.map +1 -0
  132. package/dist/tokenize/basic/hyphenator.js +66 -82
  133. package/dist/tokenize/basic/hyphenator.js.map +1 -1
  134. package/dist/tokenize/basic/index.cjs +35 -0
  135. package/dist/tokenize/basic/index.cjs.map +1 -0
  136. package/dist/tokenize/basic/index.js +7 -4
  137. package/dist/tokenize/basic/index.js.map +1 -1
  138. package/dist/tokenize/basic/paragraph.cjs +57 -0
  139. package/dist/tokenize/basic/paragraph.cjs.map +1 -0
  140. package/dist/tokenize/basic/paragraph.js +30 -35
  141. package/dist/tokenize/basic/paragraph.js.map +1 -1
  142. package/dist/tokenize/basic/sentence.cjs +83 -0
  143. package/dist/tokenize/basic/sentence.cjs.map +1 -0
  144. package/dist/tokenize/basic/sentence.js +56 -57
  145. package/dist/tokenize/basic/sentence.js.map +1 -1
  146. package/dist/tokenize/basic/word.cjs +44 -0
  147. package/dist/tokenize/basic/word.cjs.map +1 -0
  148. package/dist/tokenize/basic/word.js +17 -20
  149. package/dist/tokenize/basic/word.js.map +1 -1
  150. package/dist/tokenize/index.cjs +55 -0
  151. package/dist/tokenize/index.cjs.map +1 -0
  152. package/dist/tokenize/index.js +18 -7
  153. package/dist/tokenize/index.js.map +1 -1
  154. package/dist/tokenize/token_stream.cjs +164 -0
  155. package/dist/tokenize/token_stream.cjs.map +1 -0
  156. package/dist/tokenize/token_stream.js +133 -139
  157. package/dist/tokenize/token_stream.js.map +1 -1
  158. package/dist/tokenize/tokenizer.cjs +184 -0
  159. package/dist/tokenize/tokenizer.cjs.map +1 -0
  160. package/dist/tokenize/tokenizer.js +138 -99
  161. package/dist/tokenize/tokenizer.js.map +1 -1
  162. package/dist/transcription.cjs +131 -0
  163. package/dist/transcription.cjs.map +1 -0
  164. package/dist/transcription.js +99 -96
  165. package/dist/transcription.js.map +1 -1
  166. package/dist/tts/index.cjs +38 -0
  167. package/dist/tts/index.cjs.map +1 -0
  168. package/dist/tts/index.js +13 -5
  169. package/dist/tts/index.js.map +1 -1
  170. package/dist/tts/stream_adapter.cjs +78 -0
  171. package/dist/tts/stream_adapter.cjs.map +1 -0
  172. package/dist/tts/stream_adapter.js +50 -47
  173. package/dist/tts/stream_adapter.js.map +1 -1
  174. package/dist/tts/tts.cjs +127 -0
  175. package/dist/tts/tts.cjs.map +1 -0
  176. package/dist/tts/tts.js +90 -120
  177. package/dist/tts/tts.js.map +1 -1
  178. package/dist/utils.cjs +284 -0
  179. package/dist/utils.cjs.map +1 -0
  180. package/dist/utils.js +242 -247
  181. package/dist/utils.js.map +1 -1
  182. package/dist/vad.cjs +92 -0
  183. package/dist/vad.cjs.map +1 -0
  184. package/dist/vad.js +57 -52
  185. package/dist/vad.js.map +1 -1
  186. package/dist/version.cjs +29 -0
  187. package/dist/version.cjs.map +1 -0
  188. package/dist/version.js +4 -4
  189. package/dist/version.js.map +1 -1
  190. package/dist/worker.cjs +576 -0
  191. package/dist/worker.cjs.map +1 -0
  192. package/dist/worker.d.ts +1 -1
  193. package/dist/worker.js +511 -484
  194. package/dist/worker.js.map +1 -1
  195. package/package.json +18 -8
  196. package/src/ipc/job_main.ts +66 -64
  197. package/src/pipeline/pipeline_agent.ts +23 -23
package/dist/cli.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,EAAE;AACF,sCAAsC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAE5C,OAAO,EAAE,gBAAgB,EAAE,GAAG,EAAE,MAAM,UAAU,C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AG,OAAO,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ,CAAC;QAClD,SAAS,CAAC;YACR,IAAI;YACJ,UAAU,EAAE,KAAK;YACjB,KAAK,EAAE,KAAK;YACZ,IAAI,EAAE,OAAO,CAAC,IAAI;YAClB,mBAAmB,EAAE,OAAO,CAAC,mBAAmB;SACjD,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEL,OAAO,CAAC,KAAK,EAAE,CAAC;AAClB,CAAC,CAAC"}
1
+ {"version":3,"sources":["../src/cli.ts"],"sourcesContent":["// SPDX-FileCopyrightText: 2024 LiveKit, Inc.\n//\n// SPDX-License-Identifier: Apache-2.0\nimport { Command, Option } from 'commander';\nimport type { EventEmitter } from 'node:events';\nimport { initializeLogger, log } from './log.js';\nimport { version } from './version.js';\nimport { Worker, WorkerOptions } from './worker.js';\n\ntype CliArgs = {\n opts: WorkerOptions;\n production: boolean;\n watch: boolean;\n event?: EventEmitter;\n room?: string;\n participantIdentity?: string;\n};\n\nconst runWorker = async (args: CliArgs) => {\n initializeLogger({ pretty: !args.production, level: args.opts.logLevel });\n const logger = log();\n\n // though `production` is defined in WorkerOptions, it will always be overriddden by CLI.\n const { production: _, ...opts } = args.opts; // eslint-disable-line @typescript-eslint/no-unused-vars\n const worker = new Worker(new WorkerOptions({ production: args.production, ...opts }));\n\n if (args.room) {\n worker.event.once('worker_registered', () => {\n logger.info(`connecting to room ${args.room}`);\n worker.simulateJob(args.room!, args.participantIdentity);\n });\n }\n\n process.once('SIGINT', async () => {\n // allow C-c C-c for force interrupt\n process.once('SIGINT', () => {\n logger.info('worker closed forcefully');\n process.exit(130); // SIGINT exit code\n });\n if (args.production) {\n await worker.drain();\n }\n await worker.close();\n logger.info('worker closed');\n process.exit(130); // SIGINT exit code\n });\n\n try {\n await worker.run();\n } catch {\n logger.fatal('worker failed');\n process.exit(1);\n }\n};\n\n/**\n * Exposes a CLI for creating a new worker, in development or production mode.\n *\n * @param opts - Options to launch the worker with\n * @example\n * ```\n * if (process.argv[1] === fileURLToPath(import.meta.url)) {\n * cli.runApp(new WorkerOptions({ agent: import.meta.filename }));\n * }\n * ```\n */\nexport const runApp = (opts: WorkerOptions) => {\n const program = new Command()\n .name('agents')\n .description('LiveKit Agents CLI')\n .version(version)\n .addOption(\n new Option('--log-level <level>', 'Set the logging level')\n .choices(['trace', 'debug', 'info', 'warn', 'error', 'fatal'])\n .default('info')\n .env('LOG_LEVEL'),\n )\n .addOption(\n new Option('--url <string>', 'LiveKit server or Cloud project websocket URL').env(\n 'LIVEKIT_URL',\n ),\n )\n .addOption(\n new Option('--api-key <string>', \"LiveKit server or Cloud project's API key\").env(\n 'LIVEKIT_API_KEY',\n ),\n )\n .addOption(\n new Option('--api-secret <string>', \"LiveKit server or Cloud project's API secret\").env(\n 'LIVEKIT_API_SECRET',\n ),\n )\n .action(() => {\n if (\n // do not run CLI if origin file is agents/ipc/job_main.js\n process.argv[1] !== new URL('ipc/job_main.js', import.meta.url).pathname &&\n process.argv.length < 3\n ) {\n program.help();\n }\n });\n\n program\n .command('start')\n .description('Start the worker in production mode')\n .action(() => {\n const options = program.optsWithGlobals();\n opts.wsURL = options.url || opts.wsURL;\n opts.apiKey = options.apiKey || opts.apiKey;\n opts.apiSecret = options.apiSecret || opts.apiSecret;\n opts.logLevel = options.logLevel || opts.logLevel;\n runWorker({\n opts,\n production: true,\n watch: false,\n });\n });\n\n program\n .command('dev')\n .description('Start the worker in development mode')\n .addOption(\n new Option('--log-level <level>', 'Set the logging level')\n .choices(['trace', 'debug', 'info', 'warn', 'error', 'fatal'])\n .default('debug')\n .env('LOG_LEVEL'),\n )\n .action(() => {\n const options = program.optsWithGlobals();\n opts.wsURL = options.url || opts.wsURL;\n opts.apiKey = options.apiKey || opts.apiKey;\n opts.apiSecret = options.apiSecret || opts.apiSecret;\n opts.logLevel = options.logLevel || opts.logLevel;\n runWorker({\n opts,\n production: false,\n watch: false,\n });\n });\n\n program\n .command('connect')\n .description('Connect to a specific room')\n .requiredOption('--room <string>', 'Room name to connect to')\n .option('--participant-identity <string>', 'Identity of user to listen to')\n .addOption(\n new Option('--log-level <level>', 'Set the logging level')\n .choices(['trace', 'debug', 'info', 'warn', 'error', 'fatal'])\n .default('debug')\n .env('LOG_LEVEL'),\n )\n .action((...[, command]) => {\n const options = command.optsWithGlobals();\n opts.wsURL = options.url || opts.wsURL;\n opts.apiKey = options.apiKey || opts.apiKey;\n opts.apiSecret = options.apiSecret || opts.apiSecret;\n opts.logLevel = options.logLevel || opts.logLevel;\n runWorker({\n opts,\n production: false,\n watch: false,\n room: options.room,\n participantIdentity: options.participantIdentity,\n });\n });\n\n program.parse();\n};\n"],"mappings":"AAGA,SAAS,SAAS,cAAc;AAEhC,SAAS,kBAAkB,WAAW;AACtC,SAAS,eAAe;AACxB,SAAS,QAAQ,qBAAqB;AAWtC,MAAM,YAAY,OAAO,SAAkB;AACzC,mBAAiB,EAAE,QAAQ,CAAC,KAAK,YAAY,OAAO,KAAK,KAAK,SAAS,CAAC;AACxE,QAAM,SAAS,IAAI;AAGnB,QAAM,EAAE,YAAY,GAAG,GAAG,KAAK,IAAI,KAAK;AACxC,QAAM,SAAS,IAAI,OAAO,IAAI,cAAc,EAAE,YAAY,KAAK,YAAY,GAAG,KAAK,CAAC,CAAC;AAErF,MAAI,KAAK,MAAM;AACb,WAAO,MAAM,KAAK,qBAAqB,MAAM;AAC3C,aAAO,KAAK,sBAAsB,KAAK,IAAI,EAAE;AAC7C,aAAO,YAAY,KAAK,MAAO,KAAK,mBAAmB;AAAA,IACzD,CAAC;AAAA,EACH;AAEA,UAAQ,KAAK,UAAU,YAAY;AAEjC,YAAQ,KAAK,UAAU,MAAM;AAC3B,aAAO,KAAK,0BAA0B;AACtC,cAAQ,KAAK,GAAG;AAAA,IAClB,CAAC;AACD,QAAI,KAAK,YAAY;AACnB,YAAM,OAAO,MAAM;AAAA,IACrB;AACA,UAAM,OAAO,MAAM;AACnB,WAAO,KAAK,eAAe;AAC3B,YAAQ,KA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;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var generator_exports = {};
20
+ __export(generator_exports, {
21
+ defineAgent: () => defineAgent,
22
+ isAgent: () => isAgent
23
+ });
24
+ module.exports = __toCommonJS(generator_exports);
25
+ function isAgent(obj) {
26
+ return typeof obj === "object" && obj !== null && "entry" in obj && typeof obj.entry === "function" && ("prewarm" in obj && typeof obj.prewarm === "function" || !("prewarm" in obj));
27
+ }
28
+ function defineAgent(agent) {
29
+ return agent;
30
+ }
31
+ // Annotate the CommonJS export names for ESM import in node:
32
+ 0 && (module.exports = {
33
+ defineAgent,
34
+ isAgent
35
+ });
36
+ //# sourceMappingURL=generator.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/generator.ts"],"sourcesContent":["// SPDX-FileCopyrightText: 2024 LiveKit, Inc.\n//\n// SPDX-License-Identifier: Apache-2.0\nimport type { JobContext, JobProcess } from './job.js';\n\n/** @see {@link defineAgent} */\nexport interface Agent {\n entry: (ctx: JobContext) => Promise<void>;\n prewarm?: (proc: JobProcess) => unknown;\n}\n\n/** Helper to check if an object is an agent before running it.\n *\n * @internal\n */\nexport function isAgent(obj: unknown): obj is Agent {\n return (\n typeof obj === 'object' &&\n obj !== null &&\n 'entry' in obj &&\n typeof (obj as Agent).entry === 'function' &&\n (('prewarm' in obj && typeof (obj as Agent).prewarm === 'function') || !('prewarm' in obj))\n );\n}\n\n/**\n * Helper to define an agent according to the required interface.\n * @example A basic agent with entry and prewarm functions\n * ```\n * export default defineAgent({\n * entry: async (ctx: JobContext) => { ... },\n * prewarm: (proc: JobProcess) => { ... },\n * })\n * ```\n */\nexport function defineAgent(agent: Agent): Agent {\n return agent;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAeO,SAAS,QAAQ,KAA4B;AAClD,SACE,OAAO,QAAQ,YACf,QAAQ,QACR,WAAW,OACX,OAAQ,IAAc,UAAU,eAC9B,aAAa,OAAO,OAAQ,IAAc,YAAY,cAAe,EAAE,aAAa;AAE1F;AAYO,SAAS,YAAY,OAAqB;AAC/C,SAAO;AACT;","names":[]}
package/dist/generator.js CHANGED
@@ -1,25 +1,11 @@
1
- /** Helper to check if an object is an agent before running it.
2
- *
3
- * @internal
4
- */
5
- export function isAgent(obj) {
6
- return (typeof obj === 'object' &&
7
- obj !== null &&
8
- 'entry' in obj &&
9
- typeof obj.entry === 'function' &&
10
- (('prewarm' in obj && typeof obj.prewarm === 'function') || !('prewarm' in obj)));
1
+ function isAgent(obj) {
2
+ return typeof obj === "object" && obj !== null && "entry" in obj && typeof obj.entry === "function" && ("prewarm" in obj && typeof obj.prewarm === "function" || !("prewarm" in obj));
11
3
  }
12
- /**
13
- * Helper to define an agent according to the required interface.
14
- * @example A basic agent with entry and prewarm functions
15
- * ```
16
- * export default defineAgent({
17
- * entry: async (ctx: JobContext) => { ... },
18
- * prewarm: (proc: JobProcess) => { ... },
19
- * })
20
- * ```
21
- */
22
- export function defineAgent(agent) {
23
- return agent;
4
+ function defineAgent(agent) {
5
+ return agent;
24
6
  }
7
+ export {
8
+ defineAgent,
9
+ isAgent
10
+ };
25
11
  //# sourceMappingURL=generator.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"generator.js","sourceRoot":"","sources":["../src/generator.ts"],"names":[],"mappings":"AAWA;;;GAGG;AACH,MAAM,UAAU,OAAO,CAAC,GAAY;IAClC,OAAO,CACL,OAAO,GAAG,KAAK,QAAQ;QACvB,GAAG,KAAK,IAAI;QACZ,OAAO,IAAI,GAAG;QACd,OAAQ,GAAa,CAAC,KAAK,KAAK,UAAU;QAC1C,CAAC,CAAC,SAAS,IAAI,GAAG,IAAI,OAAQ,GAAa,CAAC,OAAO,KAAK,UAAU,CAAC,IAAI,CAAC,CAAC,SAAS,IAAI,GAAG,CAAC,CAAC,CAC5F,CAAC;AACJ,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,WAAW,CAAC,KAAY;IACtC,OAAO,KAAK,CAAC;AACf,CAAC"}
1
+ {"version":3,"sources":["../src/generator.ts"],"sourcesContent":["// SPDX-FileCopyrightText: 2024 LiveKit, Inc.\n//\n// SPDX-License-Identifier: Apache-2.0\nimport type { JobContext, JobProcess } from './job.js';\n\n/** @see {@link defineAgent} */\nexport interface Agent {\n entry: (ctx: JobContext) => Promise<void>;\n prewarm?: (proc: JobProcess) => unknown;\n}\n\n/** Helper to check if an object is an agent before running it.\n *\n * @internal\n */\nexport function isAgent(obj: unknown): obj is Agent {\n return (\n typeof obj === 'object' &&\n obj !== null &&\n 'entry' in obj &&\n typeof (obj as Agent).entry === 'function' &&\n (('prewarm' in obj && typeof (obj as Agent).prewarm === 'function') || !('prewarm' in obj))\n );\n}\n\n/**\n * Helper to define an agent according to the required interface.\n * @example A basic agent with entry and prewarm functions\n * ```\n * export default defineAgent({\n * entry: async (ctx: JobContext) => { ... },\n * prewarm: (proc: JobProcess) => { ... },\n * })\n * ```\n */\nexport function defineAgent(agent: Agent): Agent {\n return agent;\n}\n"],"mappings":"AAeO,SAAS,QAAQ,KAA4B;AAClD,SACE,OAAO,QAAQ,YACf,QAAQ,QACR,WAAW,OACX,OAAQ,IAAc,UAAU,eAC9B,aAAa,OAAO,OAAQ,IAAc,YAAY,cAAe,EAAE,aAAa;AAE1F;AAYO,SAAS,YAAY,OAAqB;AAC/C,SAAO;AACT;","names":[]}
@@ -0,0 +1,72 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var http_server_exports = {};
20
+ __export(http_server_exports, {
21
+ HTTPServer: () => HTTPServer
22
+ });
23
+ module.exports = __toCommonJS(http_server_exports);
24
+ var import_node_http = require("node:http");
25
+ var import_log = require("./log.cjs");
26
+ const healthCheck = async (res) => {
27
+ res.writeHead(200);
28
+ res.end("OK");
29
+ };
30
+ class HTTPServer {
31
+ host;
32
+ port;
33
+ app;
34
+ #logger = (0, import_log.log)();
35
+ constructor(host, port) {
36
+ this.host = host;
37
+ this.port = port;
38
+ this.app = (0, import_node_http.createServer)((req, res) => {
39
+ if (req.url === "/") {
40
+ healthCheck(res);
41
+ } else {
42
+ res.writeHead(404);
43
+ res.end("not found");
44
+ }
45
+ });
46
+ }
47
+ async run() {
48
+ return new Promise((resolve, reject) => {
49
+ this.app.listen(this.port, this.host, (err) => {
50
+ if (err) reject(err);
51
+ const address = this.app.address();
52
+ if (typeof address !== "string") {
53
+ this.#logger.info(`Server is listening on port ${address.port}`);
54
+ }
55
+ resolve();
56
+ });
57
+ });
58
+ }
59
+ async close() {
60
+ return new Promise((resolve, reject) => {
61
+ this.app.close((err) => {
62
+ if (err) reject(err);
63
+ resolve();
64
+ });
65
+ });
66
+ }
67
+ }
68
+ // Annotate the CommonJS export names for ESM import in node:
69
+ 0 && (module.exports = {
70
+ HTTPServer
71
+ });
72
+ //# sourceMappingURL=http_server.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/http_server.ts"],"sourcesContent":["// SPDX-FileCopyrightText: 2024 LiveKit, Inc.\n//\n// SPDX-License-Identifier: Apache-2.0\nimport { type IncomingMessage, type Server, type ServerResponse, createServer } from 'node:http';\nimport { log } from './log.js';\n\nconst healthCheck = async (res: ServerResponse) => {\n res.writeHead(200);\n res.end('OK');\n};\n\nexport class HTTPServer {\n host: string;\n port: number;\n app: Server;\n #logger = log();\n\n constructor(host: string, port: number) {\n this.host = host;\n this.port = port;\n\n this.app = createServer((req: IncomingMessage, res: ServerResponse) => {\n if (req.url === '/') {\n healthCheck(res);\n } else {\n res.writeHead(404);\n res.end('not found');\n }\n });\n }\n\n async run(): Promise<void> {\n return new Promise((resolve, reject) => {\n this.app.listen(this.port, this.host, (err?: Error) => {\n if (err) reject(err);\n const address = this.app.address();\n if (typeof address! !== 'string') {\n this.#logger.info(`Server is listening on port ${address!.port}`);\n }\n resolve();\n });\n });\n }\n\n async close(): Promise<void> {\n return new Promise((resolve, reject) => {\n this.app.close((err?: Error) => {\n if (err) reject(err);\n resolve();\n });\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,uBAAqF;AACrF,iBAAoB;AAEpB,MAAM,cAAc,OAAO,QAAwB;AACjD,MAAI,UAAU,GAAG;AACjB,MAAI,IAAI,IAAI;AACd;AAEO,MAAM,WAAW;AAAA,EACtB;AAAA,EACA;AAAA,EACA;AAAA,EACA,cAAU,gBAAI;AAAA,EAEd,YAAY,MAAc,MAAc;AACtC,SAAK,OAAO;AACZ,SAAK,OAAO;AAEZ,SAAK,UAAM,+BAAa,CAAC,KAAsB,QAAwB;AACrE,UAAI,IAAI,QAAQ,KAAK;AACnB,oBAAY,GAAG;AAAA,MACjB,OAAO;AACL,YAAI,UAAU,GAAG;AACjB,YAAI,IAAI,WAAW;AAAA,MACrB;AAAA,IACF,CAAC;AAAA,EACH;AAAA,EAEA,MAAM,MAAqB;AACzB,WAAO,IAAI,QAAQ,CAAC,SAAS,WAAW;AACtC,WAAK,IAAI,OAAO,KAAK,MAAM,KAAK,MAAM,CAAC,QAAgB;AACrD,YAAI,IAAK,QAAO,GAAG;AACnB,cAAM,UAAU,KAAK,IAAI,QAAQ;AACjC,YAAI,OAAO,YAAa,UAAU;AAChC,eAAK,QAAQ,KAAK,+BAA+B,QAAS,IAAI,EAAE;AAAA,QAClE;AACA,gBAAQ;AAAA,MACV,CAAC;AAAA,IACH,CAAC;AAAA,EACH;AAAA,EAEA,MAAM,QAAuB;AAC3B,WAAO,IAAI,QAAQ,CAAC,SAAS,WAAW;AACtC,WAAK,IAAI,MAAM,CAAC,QAAgB;AAC9B,YAAI,IAAK,QAAO,GAAG;AACnB,gBAAQ;AAAA,MACV,CAAC;AAAA,IACH,CAAC;AAAA,EACH;AACF;","names":[]}
@@ -1,4 +1,4 @@
1
- /// <reference types="node" />
1
+ /// <reference types="node" resolution-mode="require"/>
2
2
  import { type Server } from 'node:http';
3
3
  export declare class HTTPServer {
4
4
  #private;
@@ -1,51 +1,48 @@
1
- // SPDX-FileCopyrightText: 2024 LiveKit, Inc.
2
- //
3
- // SPDX-License-Identifier: Apache-2.0
4
- import { createServer } from 'node:http';
5
- import { log } from './log.js';
1
+ import { createServer } from "node:http";
2
+ import { log } from "./log.js";
6
3
  const healthCheck = async (res) => {
7
- res.writeHead(200);
8
- res.end('OK');
4
+ res.writeHead(200);
5
+ res.end("OK");
9
6
  };
10
- export class HTTPServer {
11
- host;
12
- port;
13
- app;
14
- #logger = log();
15
- constructor(host, port) {
16
- this.host = host;
17
- this.port = port;
18
- this.app = createServer((req, res) => {
19
- if (req.url === '/') {
20
- healthCheck(res);
21
- }
22
- else {
23
- res.writeHead(404);
24
- res.end('not found');
25
- }
26
- });
27
- }
28
- async run() {
29
- return new Promise((resolve, reject) => {
30
- this.app.listen(this.port, this.host, (err) => {
31
- if (err)
32
- reject(err);
33
- const address = this.app.address();
34
- if (typeof address !== 'string') {
35
- this.#logger.info(`Server is listening on port ${address.port}`);
36
- }
37
- resolve();
38
- });
39
- });
40
- }
41
- async close() {
42
- return new Promise((resolve, reject) => {
43
- this.app.close((err) => {
44
- if (err)
45
- reject(err);
46
- resolve();
47
- });
48
- });
49
- }
7
+ class HTTPServer {
8
+ host;
9
+ port;
10
+ app;
11
+ #logger = log();
12
+ constructor(host, port) {
13
+ this.host = host;
14
+ this.port = port;
15
+ this.app = createServer((req, res) => {
16
+ if (req.url === "/") {
17
+ healthCheck(res);
18
+ } else {
19
+ res.writeHead(404);
20
+ res.end("not found");
21
+ }
22
+ });
23
+ }
24
+ async run() {
25
+ return new Promise((resolve, reject) => {
26
+ this.app.listen(this.port, this.host, (err) => {
27
+ if (err) reject(err);
28
+ const address = this.app.address();
29
+ if (typeof address !== "string") {
30
+ this.#logger.info(`Server is listening on port ${address.port}`);
31
+ }
32
+ resolve();
33
+ });
34
+ });
35
+ }
36
+ async close() {
37
+ return new Promise((resolve, reject) => {
38
+ this.app.close((err) => {
39
+ if (err) reject(err);
40
+ resolve();
41
+ });
42
+ });
43
+ }
50
44
  }
45
+ export {
46
+ HTTPServer
47
+ };
51
48
  //# sourceMappingURL=http_server.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"http_server.js","sourceRoot":"","sources":["../src/http_server.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,EAAE;AACF,sCAAsC;AACtC,OAAO,EAA0D,YAAY,EAAE,MAAM,WAAW,CAAC;AACjG,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAE/B,MAAM,WAAW,GAAG,KAAK,EAAE,GAAmB,EAAE,EAAE;IAChD,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;IACnB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OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACrC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,GAAW,EAAE,EAAE;gBAC7B,IAAI,GAAG;oBAAE,MAAM,CAAC,GAAG,CAAC,CAAC;gBACrB,OAAO,EAAE,CAAC;YACZ,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;CACF"}
1
+ {"version":3,"sources":["../src/http_server.ts"],"sourcesContent":["// SPDX-FileCopyrightText: 2024 LiveKit, Inc.\n//\n// SPDX-License-Identifier: Apache-2.0\nimport { type IncomingMessage, type Server, type ServerResponse, createServer } from 'node:http';\nimport { log } from './log.js';\n\nconst healthCheck = async (res: ServerResponse) => {\n res.writeHead(200);\n res.end('OK');\n};\n\nexport class HTTPServer {\n host: string;\n port: number;\n app: Server;\n #logger = log();\n\n constructor(host: string, port: number) {\n this.host = host;\n this.port = port;\n\n this.app = createServer((req: IncomingMessage, res: ServerResponse) => {\n if (req.url === '/') {\n healthCheck(res);\n } else {\n res.writeHead(404);\n res.end('not found');\n }\n });\n }\n\n async run(): Promise<void> {\n return new Promise((resolve, reject) => {\n this.app.listen(this.port, this.host, (err?: Error) => {\n if (err) reject(err);\n const address = this.app.address();\n if (typeof address! !== 'string') {\n this.#logger.info(`Server is listening on port ${address!.port}`);\n }\n resolve();\n });\n });\n }\n\n async close(): Promise<void> {\n return new Promise((resolve, reject) => {\n this.app.close((err?: Error) => {\n if (err) reject(err);\n resolve();\n });\n });\n }\n}\n"],"mappings":"AAGA,SAAiE,oBAAoB;AACrF,SAAS,WAAW;AAEpB,MAAM,cAAc,OAAO,QAAwB;AACjD,MAAI,UAAU,GAAG;AACjB,MAAI,IAAI,IAAI;AACd;AAEO,MAAM,WAAW;AAAA,EACtB;AAAA,EACA;AAAA,EACA;AAAA,EACA,UAAU,IAAI;AAAA,EAEd,YAAY,MAAc,MAAc;AACtC,SAAK,OAAO;AACZ,SAAK,OAAO;AAEZ,SAAK,MAAM,aAAa,CAAC,KAAsB,QAAwB;AACrE,UAAI,IAAI,QAAQ,KAAK;AACnB,oBAAY,GAAG;AAAA,MACjB,OAAO;AACL,YAAI,UAAU,GAAG;AACjB,YAAI,IAAI,WAAW;AAAA,MACrB;AAAA,IACF,CAAC;AAAA,EACH;AAAA,EAEA,MAAM,MAAqB;AACzB,WAAO,IAAI,QAAQ,CAAC,SAAS,WAAW;AACtC,WAAK,IAAI,OAAO,KAAK,MAAM,KAAK,MAAM,CAAC,QAAgB;AACrD,YAAI,IAAK,QAAO,GAAG;AACnB,cAAM,UAAU,KAAK,IAAI,QAAQ;AACjC,YAAI,OAAO,YAAa,UAAU;AAChC,eAAK,QAAQ,KAAK,+BAA+B,QAAS,IAAI,EAAE;AAAA,QAClE;AACA,gBAAQ;AAAA,MACV,CAAC;AAAA,IACH,CAAC;AAAA,EACH;AAAA,EAEA,MAAM,QAAuB;AAC3B,WAAO,IAAI,QAAQ,CAAC,SAAS,WAAW;AACtC,WAAK,IAAI,MAAM,CAAC,QAAgB;AAC9B,YAAI,IAAK,QAAO,GAAG;AACnB,gBAAQ;AAAA,MACV,CAAC;AAAA,IACH,CAAC;AAAA,EACH;AACF;","names":[]}
package/dist/index.cjs ADDED
@@ -0,0 +1,78 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
21
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
22
+ // If the importer is in node compatibility mode or this is not an ESM
23
+ // file that has been converted to a CommonJS file using a Babel-
24
+ // compatible transform (i.e. "__esModule" has not been set), then set
25
+ // "default" to the CommonJS "module.exports" for node compatibility.
26
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
27
+ mod
28
+ ));
29
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
30
+ var src_exports = {};
31
+ __export(src_exports, {
32
+ cli: () => cli,
33
+ llm: () => llm,
34
+ multimodal: () => multimodal,
35
+ pipeline: () => pipeline,
36
+ stt: () => stt,
37
+ tokenize: () => tokenize,
38
+ tts: () => tts
39
+ });
40
+ module.exports = __toCommonJS(src_exports);
41
+ var cli = __toESM(require("./cli.cjs"), 1);
42
+ var llm = __toESM(require("./llm/index.cjs"), 1);
43
+ var multimodal = __toESM(require("./multimodal/index.cjs"), 1);
44
+ var pipeline = __toESM(require("./pipeline/index.cjs"), 1);
45
+ var stt = __toESM(require("./stt/index.cjs"), 1);
46
+ var tokenize = __toESM(require("./tokenize/index.cjs"), 1);
47
+ var tts = __toESM(require("./tts/index.cjs"), 1);
48
+ __reExport(src_exports, require("./vad.cjs"), module.exports);
49
+ __reExport(src_exports, require("./plugin.cjs"), module.exports);
50
+ __reExport(src_exports, require("./version.cjs"), module.exports);
51
+ __reExport(src_exports, require("./job.cjs"), module.exports);
52
+ __reExport(src_exports, require("./worker.cjs"), module.exports);
53
+ __reExport(src_exports, require("./utils.cjs"), module.exports);
54
+ __reExport(src_exports, require("./log.cjs"), module.exports);
55
+ __reExport(src_exports, require("./generator.cjs"), module.exports);
56
+ __reExport(src_exports, require("./audio.cjs"), module.exports);
57
+ __reExport(src_exports, require("./transcription.cjs"), module.exports);
58
+ // Annotate the CommonJS export names for ESM import in node:
59
+ 0 && (module.exports = {
60
+ cli,
61
+ llm,
62
+ multimodal,
63
+ pipeline,
64
+ stt,
65
+ tokenize,
66
+ tts,
67
+ ...require("./vad.cjs"),
68
+ ...require("./plugin.cjs"),
69
+ ...require("./version.cjs"),
70
+ ...require("./job.cjs"),
71
+ ...require("./worker.cjs"),
72
+ ...require("./utils.cjs"),
73
+ ...require("./log.cjs"),
74
+ ...require("./generator.cjs"),
75
+ ...require("./audio.cjs"),
76
+ ...require("./transcription.cjs")
77
+ });
78
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["// SPDX-FileCopyrightText: 2024 LiveKit, Inc.\n//\n// SPDX-License-Identifier: Apache-2.0\n\n/**\n * LiveKit Agents is a framework for building realtime programmable participants that run on\n * servers.\n *\n * @see {@link https://docs.livekit.io/agents/overview | LiveKit Agents documentation}\n * @packageDocumentation\n */\nimport * as cli from './cli.js';\nimport * as llm from './llm/index.js';\nimport * as multimodal from './multimodal/index.js';\nimport * as pipeline from './pipeline/index.js';\nimport * as stt from './stt/index.js';\nimport * as tokenize from './tokenize/index.js';\nimport * as tts from './tts/index.js';\n\nexport * from './vad.js';\nexport * from './plugin.js';\nexport * from './version.js';\nexport * from './job.js';\nexport * from './worker.js';\nexport * from './utils.js';\nexport * from './log.js';\nexport * from './generator.js';\nexport * from './audio.js';\nexport * from './transcription.js';\n\nexport { cli, stt, tts, llm, pipeline, multimodal, tokenize };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAWA,UAAqB;AACrB,UAAqB;AACrB,iBAA4B;AAC5B,eAA0B;AAC1B,UAAqB;AACrB,eAA0B;AAC1B,UAAqB;AAErB,wBAAc,qBAnBd;AAoBA,wBAAc,wBApBd;AAqBA,wBAAc,yBArBd;AAsBA,wBAAc,qBAtBd;AAuBA,wBAAc,wBAvBd;AAwBA,wBAAc,uBAxBd;AAyBA,wBAAc,qBAzBd;AA0BA,wBAAc,2BA1Bd;AA2BA,wBAAc,uBA3Bd;AA4BA,wBAAc,+BA5Bd;","names":[]}
package/dist/index.js CHANGED
@@ -1,29 +1,27 @@
1
- // SPDX-FileCopyrightText: 2024 LiveKit, Inc.
2
- //
3
- // SPDX-License-Identifier: Apache-2.0
4
- /**
5
- * LiveKit Agents is a framework for building realtime programmable participants that run on
6
- * servers.
7
- *
8
- * @see {@link https://docs.livekit.io/agents/overview | LiveKit Agents documentation}
9
- * @packageDocumentation
10
- */
11
- import * as cli from './cli.js';
12
- import * as llm from './llm/index.js';
13
- import * as multimodal from './multimodal/index.js';
14
- import * as pipeline from './pipeline/index.js';
15
- import * as stt from './stt/index.js';
16
- import * as tokenize from './tokenize/index.js';
17
- import * as tts from './tts/index.js';
18
- export * from './vad.js';
19
- export * from './plugin.js';
20
- export * from './version.js';
21
- export * from './job.js';
22
- export * from './worker.js';
23
- export * from './utils.js';
24
- export * from './log.js';
25
- export * from './generator.js';
26
- export * from './audio.js';
27
- export * from './transcription.js';
28
- export { cli, stt, tts, llm, pipeline, multimodal, tokenize };
1
+ import * as cli from "./cli.js";
2
+ import * as llm from "./llm/index.js";
3
+ import * as multimodal from "./multimodal/index.js";
4
+ import * as pipeline from "./pipeline/index.js";
5
+ import * as stt from "./stt/index.js";
6
+ import * as tokenize from "./tokenize/index.js";
7
+ import * as tts from "./tts/index.js";
8
+ export * from "./vad.js";
9
+ export * from "./plugin.js";
10
+ export * from "./version.js";
11
+ export * from "./job.js";
12
+ export * from "./worker.js";
13
+ export * from "./utils.js";
14
+ export * from "./log.js";
15
+ export * from "./generator.js";
16
+ export * from "./audio.js";
17
+ export * from "./transcription.js";
18
+ export {
19
+ cli,
20
+ llm,
21
+ multimodal,
22
+ pipeline,
23
+ stt,
24
+ tokenize,
25
+ tts
26
+ };
29
27
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,EAAE;AACF,sCAAsC;AAEtC;;;;;;GAMG;AACH,OAAO,KAAK,GAAG,MAAM,UAAU,CAAC;AAChC,OAAO,KAAK,GAAG,MAAM,gBAAgB,CAAC;AACtC,OAAO,KAAK,UAAU,MAAM,uBAAuB,CAAC;AACpD,OAAO,KAAK,QAAQ,MAAM,qBAAqB,CAAC;AAChD,OAAO,KAAK,GAAG,MAAM,gBAAgB,CAAC;AACtC,OAAO,KAAK,QAAQ,MAAM,qBAAqB,CAAC;AAChD,OAAO,KAAK,GAAG,MAAM,gBAAgB,CAAC;AAEtC,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,oBAAoB,CAAC;AAEnC,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,CAAC"}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["// SPDX-FileCopyrightText: 2024 LiveKit, Inc.\n//\n// SPDX-License-Identifier: Apache-2.0\n\n/**\n * LiveKit Agents is a framework for building realtime programmable participants that run on\n * servers.\n *\n * @see {@link https://docs.livekit.io/agents/overview | LiveKit Agents documentation}\n * @packageDocumentation\n */\nimport * as cli from './cli.js';\nimport * as llm from './llm/index.js';\nimport * as multimodal from './multimodal/index.js';\nimport * as pipeline from './pipeline/index.js';\nimport * as stt from './stt/index.js';\nimport * as tokenize from './tokenize/index.js';\nimport * as tts from './tts/index.js';\n\nexport * from './vad.js';\nexport * from './plugin.js';\nexport * from './version.js';\nexport * from './job.js';\nexport * from './worker.js';\nexport * from './utils.js';\nexport * from './log.js';\nexport * from './generator.js';\nexport * from './audio.js';\nexport * from './transcription.js';\n\nexport { cli, stt, tts, llm, pipeline, multimodal, tokenize };\n"],"mappings":"AAWA,YAAY,SAAS;AACrB,YAAY,SAAS;AACrB,YAAY,gBAAgB;AAC5B,YAAY,cAAc;AAC1B,YAAY,SAAS;AACrB,YAAY,cAAc;AAC1B,YAAY,SAAS;AAErB,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;","names":[]}
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var job_executor_exports = {};
20
+ __export(job_executor_exports, {
21
+ JobExecutor: () => JobExecutor
22
+ });
23
+ module.exports = __toCommonJS(job_executor_exports);
24
+ class JobExecutor {
25
+ PING_INTERVAL = 2.5 * 1e3;
26
+ PING_TIMEOUT = 90 * 1e3;
27
+ HIGH_PING_THRESHOLD = 0.5 * 1e3;
28
+ }
29
+ // Annotate the CommonJS export names for ESM import in node:
30
+ 0 && (module.exports = {
31
+ JobExecutor
32
+ });
33
+ //# sourceMappingURL=job_executor.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/ipc/job_executor.ts"],"sourcesContent":["// SPDX-FileCopyrightText: 2024 LiveKit, Inc.\n//\n// SPDX-License-Identifier: Apache-2.0\nimport type { RunningJobInfo } from '../job.js';\n\nexport interface ProcOpts {\n agent: string;\n initializeTimeout: number;\n closeTimeout: number;\n}\n\nexport abstract class JobExecutor {\n PING_INTERVAL = 2.5 * 1000;\n PING_TIMEOUT = 90 * 1000;\n HIGH_PING_THRESHOLD = 0.5 * 1000;\n\n abstract get started(): boolean;\n abstract get runningJob(): RunningJobInfo | undefined;\n\n abstract start(): Promise<void>;\n abstract join(): Promise<void>;\n abstract initialize(): Promise<void>;\n abstract close(): Promise<void>;\n abstract launchJob(info: RunningJobInfo): Promise<void>;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAWO,MAAe,YAAY;AAAA,EAChC,gBAAgB,MAAM;AAAA,EACtB,eAAe,KAAK;AAAA,EACpB,sBAAsB,MAAM;AAU9B;","names":[]}
@@ -1,6 +1,9 @@
1
- export class JobExecutor {
2
- PING_INTERVAL = 2.5 * 1000;
3
- PING_TIMEOUT = 90 * 1000;
4
- HIGH_PING_THRESHOLD = 0.5 * 1000;
1
+ class JobExecutor {
2
+ PING_INTERVAL = 2.5 * 1e3;
3
+ PING_TIMEOUT = 90 * 1e3;
4
+ HIGH_PING_THRESHOLD = 0.5 * 1e3;
5
5
  }
6
+ export {
7
+ JobExecutor
8
+ };
6
9
  //# sourceMappingURL=job_executor.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"job_executor.js","sourceRoot":"","sources":["../../src/ipc/job_executor.ts"],"names":[],"mappings":"AAWA,MAAM,OAAgB,WAAW;IAC/B,aAAa,GAAG,GAAG,GAAG,IAAI,CAAC;IAC3B,YAAY,GAAG,EAAE,GAAG,IAAI,CAAC;IACzB,mBAAmB,GAAG,GAAG,GAAG,IAAI,CAAC;CAUlC"}
1
+ {"version":3,"sources":["../../src/ipc/job_executor.ts"],"sourcesContent":["// SPDX-FileCopyrightText: 2024 LiveKit, Inc.\n//\n// SPDX-License-Identifier: Apache-2.0\nimport type { RunningJobInfo } from '../job.js';\n\nexport interface ProcOpts {\n agent: string;\n initializeTimeout: number;\n closeTimeout: number;\n}\n\nexport abstract class JobExecutor {\n PING_INTERVAL = 2.5 * 1000;\n PING_TIMEOUT = 90 * 1000;\n HIGH_PING_THRESHOLD = 0.5 * 1000;\n\n abstract get started(): boolean;\n abstract get runningJob(): RunningJobInfo | undefined;\n\n abstract start(): Promise<void>;\n abstract join(): Promise<void>;\n abstract initialize(): Promise<void>;\n abstract close(): Promise<void>;\n abstract launchJob(info: RunningJobInfo): Promise<void>;\n}\n"],"mappings":"AAWO,MAAe,YAAY;AAAA,EAChC,gBAAgB,MAAM;AAAA,EACtB,eAAe,KAAK;AAAA,EACpB,sBAAsB,MAAM;AAU9B;","names":[]}