@mentingo/luma-sdk 0.4.0 → 0.4.1
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/README.md +73 -5
- package/dist/{chunk-W5CQGEDB.js → chunk-PHLN53W2.js} +6 -2
- package/dist/{contracts-qTi7LQB8.d.cts → contracts-CcTSdQMI.d.cts} +325 -14
- package/dist/{contracts-qTi7LQB8.d.ts → contracts-CcTSdQMI.d.ts} +325 -14
- package/dist/contracts.cjs +2 -0
- package/dist/contracts.d.cts +1 -1
- package/dist/contracts.d.ts +1 -1
- package/dist/contracts.js +1 -1
- package/dist/index.cjs +16 -4
- package/dist/index.d.cts +10 -59
- package/dist/index.d.ts +10 -59
- package/dist/index.js +11 -3
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -121,6 +121,7 @@ var TaskKind = /* @__PURE__ */ ((TaskKind3) => {
|
|
|
121
121
|
TaskKind3["Lesson"] = "lesson";
|
|
122
122
|
TaskKind3["Edit"] = "edit";
|
|
123
123
|
TaskKind3["Source"] = "source";
|
|
124
|
+
TaskKind3["SourceVision"] = "source_vision";
|
|
124
125
|
TaskKind3["Asset"] = "asset";
|
|
125
126
|
TaskKind3["CourseReview"] = "course_review";
|
|
126
127
|
return TaskKind3;
|
|
@@ -153,6 +154,7 @@ var AiModelDomain = /* @__PURE__ */ ((AiModelDomain2) => {
|
|
|
153
154
|
AiModelDomain2["AiJudgeConfigurationValidator"] = "aiJudgeConfigurationValidator";
|
|
154
155
|
AiModelDomain2["Translations"] = "translations";
|
|
155
156
|
AiModelDomain2["CourseGeneration"] = "courseGeneration";
|
|
157
|
+
AiModelDomain2["CourseGenerationVision"] = "courseGenerationVision";
|
|
156
158
|
AiModelDomain2["CourseGenerationVisualAssets"] = "courseGenerationVisualAssets";
|
|
157
159
|
AiModelDomain2["CourseGenerationEmbeddings"] = "courseGenerationEmbeddings";
|
|
158
160
|
AiModelDomain2["Embeddings"] = "embeddings";
|
|
@@ -174,6 +176,7 @@ var AiCapabilityMode = /* @__PURE__ */ ((AiCapabilityMode2) => {
|
|
|
174
176
|
})(AiCapabilityMode || {});
|
|
175
177
|
var AiCapability = /* @__PURE__ */ ((AiCapability2) => {
|
|
176
178
|
AiCapability2["CourseGeneration"] = "courseGeneration";
|
|
179
|
+
AiCapability2["CourseGenerationVision"] = "courseGenerationVision";
|
|
177
180
|
AiCapability2["CourseGenerationVisualAssets"] = "courseGenerationVisualAssets";
|
|
178
181
|
AiCapability2["CourseGenerationEmbeddings"] = "courseGenerationEmbeddings";
|
|
179
182
|
AiCapability2["AiMentorChat"] = "aiMentorChat";
|
|
@@ -297,7 +300,7 @@ var API = class extends HttpClient {
|
|
|
297
300
|
...params
|
|
298
301
|
}),
|
|
299
302
|
/**
|
|
300
|
-
*
|
|
303
|
+
* @description Existing text stream by default; streamFormat=events opts into newline-delimited native text, complete tool-call, finish and sanitized error events. Tools execute in the caller, never in Luma.
|
|
301
304
|
*
|
|
302
305
|
* @tags Public - Require API Key
|
|
303
306
|
* @name MentorChatApiPublicV1AiMentorChatPost
|
|
@@ -440,7 +443,7 @@ var API = class extends HttpClient {
|
|
|
440
443
|
...params
|
|
441
444
|
}),
|
|
442
445
|
/**
|
|
443
|
-
*
|
|
446
|
+
* @description Embeds texts using the API key's Custom embeddings runtime. Optional dimensions requests a positive vector size. The response model identifies the same resolved runtime used to produce the validated vectors.
|
|
444
447
|
*
|
|
445
448
|
* @tags Public - Require API Key
|
|
446
449
|
* @name CreateEmbeddingsApiPublicV1AiEmbeddingsPost
|
|
@@ -886,6 +889,7 @@ var LUMA_AI_CAPABILITY_PROVIDERS = {
|
|
|
886
889
|
};
|
|
887
890
|
var LUMA_AI_CAPABILITIES = {
|
|
888
891
|
COURSE_GENERATION: "courseGeneration" /* CourseGeneration */,
|
|
892
|
+
COURSE_GENERATION_VISION: "courseGenerationVision" /* CourseGenerationVision */,
|
|
889
893
|
COURSE_GENERATION_VISUAL_ASSETS: "courseGenerationVisualAssets" /* CourseGenerationVisualAssets */,
|
|
890
894
|
COURSE_GENERATION_EMBEDDINGS: "courseGenerationEmbeddings" /* CourseGenerationEmbeddings */,
|
|
891
895
|
AI_MENTOR_CHAT: "aiMentorChat" /* AiMentorChat */,
|
|
@@ -906,6 +910,7 @@ var LumaAiClient = class {
|
|
|
906
910
|
constructor(apiClient) {
|
|
907
911
|
this.apiClient = apiClient;
|
|
908
912
|
}
|
|
913
|
+
/** Embed raw text through the native API; optional size and model provenance share this contract. */
|
|
909
914
|
async createEmbeddings(opts) {
|
|
910
915
|
const response = await this.apiClient.api.createEmbeddingsApiPublicV1AiEmbeddingsPost(opts);
|
|
911
916
|
return response.data;
|
|
@@ -1089,6 +1094,7 @@ var LUMA_AI_MODEL_DOMAINS = {
|
|
|
1089
1094
|
AI_JUDGE_CONFIGURATION_VALIDATOR: "aiJudgeConfigurationValidator" /* AiJudgeConfigurationValidator */,
|
|
1090
1095
|
TRANSLATIONS: "translations" /* Translations */,
|
|
1091
1096
|
COURSE_GENERATION: "courseGeneration" /* CourseGeneration */,
|
|
1097
|
+
COURSE_GENERATION_VISION: "courseGenerationVision" /* CourseGenerationVision */,
|
|
1092
1098
|
COURSE_GENERATION_VISUAL_ASSETS: "courseGenerationVisualAssets" /* CourseGenerationVisualAssets */,
|
|
1093
1099
|
COURSE_GENERATION_EMBEDDINGS: "courseGenerationEmbeddings" /* CourseGenerationEmbeddings */,
|
|
1094
1100
|
EMBEDDINGS: "embeddings" /* Embeddings */,
|
|
@@ -1423,8 +1429,14 @@ var LumaMentorClient = class {
|
|
|
1423
1429
|
chat(opts, requestOptions = {}) {
|
|
1424
1430
|
return this.streamChat(opts, requestOptions);
|
|
1425
1431
|
}
|
|
1426
|
-
|
|
1427
|
-
|
|
1432
|
+
/** Generate native chat output, preserving caller cancellation before any fallback decision. */
|
|
1433
|
+
async generateChat(opts, requestOptions = {}) {
|
|
1434
|
+
const response = await this.apiClient.api.generateMentorChatApiPublicV1AiMentorChatGeneratePost(
|
|
1435
|
+
opts,
|
|
1436
|
+
{
|
|
1437
|
+
signal: requestOptions.signal
|
|
1438
|
+
}
|
|
1439
|
+
);
|
|
1428
1440
|
return response.data;
|
|
1429
1441
|
}
|
|
1430
1442
|
async judge(opts) {
|
package/dist/index.d.cts
CHANGED
|
@@ -1,67 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
1
|
+
import { A as API, C as CreateEmbeddingsOptions, a as CreateEmbeddingsResponse, G as GenerateAiJudgeConfigurationOptions, b as GenerateAiJudgeConfigurationResponse, c as GenerateAiMentorConfigurationOptions, d as GenerateAiMentorConfigurationResponse, V as ValidateAiJudgeConfigurationOptions, e as ValidateAiJudgeConfigurationResponse, f as ValidateAiMentorConfigurationOptions, g as ValidateAiMentorConfigurationResponse, h as GenerateTranslationsOptions, i as GenerateTranslationsResponse, T as TranscribeDictationOptions, j as TranscribeDictationResponse, k as AdminOrganizationIdOptions, l as AdminApiKeyResponse, m as AdminApiKeyCreateOptions, n as AdminApiKeyCreateResponse, o as AdminApiKeyIdentifierOptions, p as AdminApiKeyUpdateOptions, q as AdminApiKeyRevokeResponse, r as AdminConfigurationResponse, s as AdminModelAssignmentResponse, t as AdminApiKeyAssignmentUpdateOptions, u as AdminModelProfileResponse, v as AuthoringCreateSessionOptions, w as AuthoringSessionSnapshot, L as ListAuthoringSessionsOptions, x as AuthoringSessionPage, y as AuthoringSessionOptions, z as AuthoringTurnHistoryOptions, B as AuthoringTurnHistoryPage, D as AuthoringEventsOptions, E as AuthoringEventPage, S as SubscribeAuthoringEventsOptions, U as UploadAuthoringSourceOptions, F as AuthoringSourceUploadReceipt, H as DownloadAuthoringAssetOptions, I as DownloadedAuthoringAsset, J as SendAuthoringCommandOptions, K as AuthoringCommandReceipt, M as FulfillAuthoringContextOptions, N as AuthoringContextFulfillmentReceipt, O as FailAuthoringContextOptions, P as AuthoringContextFailureReceipt, Q as PrepareAuthoringExportOptions, R as FrozenAuthoringExport, W as GetAuthoringExportOptions, X as RecordAuthoringReceiptOptions, Y as AuthoringApplicationReceipt, Z as PublicConfigurationResponse, _ as MentorChatOptions, $ as MentorStreamRequestOptions, a0 as NativeChatResult, a1 as MentorGenerateChatResponse, a2 as MentorJudgeOptions, a3 as MentorJudgeResponse, a4 as LumaSocket } from './contracts-CcTSdQMI.cjs';
|
|
2
|
+
export { a5 as AI_MENTOR_CONFIGURATION_TYPES, a6 as AUDIO_PROVIDER_STATES, a7 as AUDIO_RECOVERY_STATES, a8 as AiCapability, a9 as AiCapabilityMode, aa as AiCapabilityProvider, ab as AiCapabilityStatus, ac as AiJudgeConfigurationResponseInput, ad as AiMentorConfigurationType, ae as AiModelAssignmentResponse, af as AiModelAssignmentUpdateRequest, ag as AiModelDomain, ah as AiModelProfileKind, ai as AiModelProfileResponse, aj as AiRuntimeConfiguration, ak as ApiKeyCreateRequest, al as ApiKeyCreateResponse, am as ApiKeyMetadata, an as ApiKeyResponse, ao as ApiKeyUpdateRequest, ap as ApplicationReceipt, aq as AudioBinaryChunk, ar as AudioChunkPayload, as as AudioChunkedPayload, at as AudioOutputAlignmentData, au as AudioOutputAlignmentPayload, av as AudioOutputChunkData, aw as AudioOutputChunkPayload, ax as AudioOutputCompleteData, ay as AudioOutputCompletePayload, az as AudioOutputErrorData, aA as AudioOutputErrorPayload, aB as AudioOutputInterruptedData, aC as AudioOutputInterruptedPayload, aD as AudioProtocolErrorPayload, aE as AudioProviderState, aF as AudioReconnectPayload, aG as AudioRecoveryPayload, aH as AudioRecoveryState, aI as AudioStartedPayload, aJ as AudioStopPayload, aK as AudioTriggerTTSPayload, aL as AuthoringCommand, aM as AuthoringContextFailure, aN as AuthoringContextResponse, aO as AuthoringEvent, aP as AuthoringLessonCreateOperation, aQ as AuthoringLessonUpdateOperation, aR as AuthoringMentorLessonCreatePayload, aS as AuthoringOperation, aT as AuthoringSessionSummary, aU as AuthoringSubscriptionError, aV as AuthoringSubscriptionErrorCode, aW as AuthoringTaskFailure, aX as AuthoringTaskSummary, aY as AuthoringTurn, aZ as AuthoringTurnPart, a_ as AuthoringWorkProgress, a$ as AuthoringWorkProgressChapter, b0 as AuthoringWorkProgressStage, b1 as AuthoringWorkspaceRecord, b2 as BodyUploadSourceApiPublicV1AuthoringSessionsSessionIdSourcesPost, b3 as ClientSpeechBoundaryPayload, b4 as CommandReceipt, b5 as ContextFailure, b6 as ContextFailureReceipt, b7 as ContextFulfillmentReceipt, b8 as ContextResponse, b9 as CreateSession, ba as EXTERNAL_AUDIO_CLIENT_RECONNECT_GRACE_MS, bb as EXTERNAL_AUDIO_MAX_BUFFERED_CHUNKS, bc as EXTERNAL_AUDIO_MAX_RECOVERY_ATTEMPTS, bd as EXTERNAL_AUDIO_OPERATION, be as EXTERNAL_AUDIO_RECOVERY_STATE, bf as EXTERNAL_AUDIO_RECOVERY_TIMEOUT_MS, bg as EXTERNAL_AUDIO_TERMINAL_RECOVERY_ERROR_CODES, bh as EventPage, bi as FrozenExport, bj as LEARNER_TRANSCRIPT_STATUSES, bk as LUMA_AI_CAPABILITIES, bl as LUMA_AI_CAPABILITY_MODES, bm as LUMA_AI_CAPABILITY_PROVIDERS, bn as LUMA_AI_MODEL_DOMAINS, bo as LUMA_AI_MODEL_PROFILE_KINDS, bp as LUMA_AUDIO_ACTIONS, bq as LUMA_AUDIO_FORMATS, br as LUMA_CAPTURE_PROFILES, bs as LUMA_MENTOR_STREAM_EVENT_TYPES, bt as LUMA_SOCKET_EMIT_EVENTS, bu as LUMA_SOCKET_LISTEN_EVENTS, bv as LUMA_SOCKET_MESSAGE_TYPES, bw as LUMA_VOICE_TIMING_PRECISION, bx as LearnerTranscriptStatus, by as LearnerTranscriptionData, bz as LearnerTranscriptionPayload, bA as LearnerTranscriptionTimingData, bB as LumaAiModelDomain, bC as LumaAiModelProfileKind, bD as LumaCaptureProfile, bE as LumaSocketEmitEvents, bF as LumaSocketListenEvents, bG as LumaVoiceTimingPrecision, bH as MentorChatEvent, bI as MentorChatRequest, bJ as MentorChatResponse, bK as MentorStreamEventEnvelope, bL as MentorTextDeltaPayload, bM as MentorTextEndPayload, bN as MentorTextErrorPayload, bO as MentorTranscriptionPayload, bP as NamedToolChoice, bQ as NativeChatTool, bR as NativeChatUsage, bS as NativeErrorEvent, bT as NativeFinishEvent, bU as NativeTextDelta, bV as NativeToolCall, bW as NativeToolCallEvent, bX as PrepareAuthoringExport, bY as PrepareExport, bZ as ProposalReviewDecision, b_ as PublicAiMessage, b$ as ReasoningEffort, c0 as ServerConnectedPayload, c1 as SessionSnapshot, c2 as SessionSummary, c3 as SessionSummaryPage, c4 as SourceUploadReceipt, c5 as SpeechAlignmentWord, c6 as StartAudioPayload, c7 as TRANSCRIPTION_MODES, c8 as TTSProvider, c9 as TaskFailure, ca as TaskKind, cb as TaskSummary, cc as TextToSpeechProvider, cd as TranscriptionSessionPlan, ce as TurnPartKind, cf as TurnPartStatus, cg as TurnStatus, ch as WorkspaceRecord } from './contracts-CcTSdQMI.cjs';
|
|
3
3
|
import { Agent } from 'node:https';
|
|
4
4
|
import 'axios';
|
|
5
5
|
import 'socket.io-client';
|
|
6
6
|
|
|
7
|
-
type AiRuntimeConfiguration = PublicConfigurationResponse;
|
|
8
|
-
type MentorChatOptions = MentorChatRequest;
|
|
9
|
-
type MentorStreamRequestOptions = {
|
|
10
|
-
signal?: AbortSignal;
|
|
11
|
-
};
|
|
12
|
-
type MentorGenerateChatResponse = MentorChatResponse;
|
|
13
|
-
type MentorJudgeOptions = StructuredGenerationRequest;
|
|
14
|
-
type MentorJudgeResponse = JudgeResponse;
|
|
15
|
-
type GenerateAiJudgeConfigurationOptions = StructuredGenerationRequest;
|
|
16
|
-
type GenerateAiJudgeConfigurationResponse = AiJudgeConfigurationResponseOutput;
|
|
17
|
-
declare const AI_MENTOR_CONFIGURATION_TYPES: {
|
|
18
|
-
readonly TEACHER: "teacher";
|
|
19
|
-
readonly ROLEPLAY: "roleplay";
|
|
20
|
-
};
|
|
21
|
-
type AiMentorConfigurationType = (typeof AI_MENTOR_CONFIGURATION_TYPES)[keyof typeof AI_MENTOR_CONFIGURATION_TYPES];
|
|
22
|
-
type GenerateAiMentorConfigurationOptions = Omit<GenerateAiMentorConfigurationRequest, "configurationType"> & {
|
|
23
|
-
configurationType: AiMentorConfigurationType;
|
|
24
|
-
};
|
|
25
|
-
type GenerateAiMentorConfigurationResponse = AiMentorTeacherConfigurationResponse | AiMentorRoleplayConfigurationResponse;
|
|
26
|
-
type ValidateAiJudgeConfigurationOptions = StructuredGenerationRequest;
|
|
27
|
-
type ValidateAiJudgeConfigurationResponse = AiJudgeConfigurationValidationResponse;
|
|
28
|
-
type ValidateAiMentorConfigurationOptions = StructuredGenerationRequest;
|
|
29
|
-
type ValidateAiMentorConfigurationResponse = AiMentorConfigurationValidationResponse;
|
|
30
|
-
type CreateEmbeddingsOptions = EmbeddingsRequest;
|
|
31
|
-
type CreateEmbeddingsResponse = EmbeddingsResponse;
|
|
32
|
-
type GenerateTranslationsOptions = StructuredGenerationRequest;
|
|
33
|
-
type GenerateTranslationsResponse = TranslationResponse;
|
|
34
|
-
type TranscribeDictationOptions = BodyTranscribeDictationApiPublicV1AiTranscriptionsPost;
|
|
35
|
-
type TranscribeDictationResponse = TranscriptionResponse;
|
|
36
|
-
declare const LUMA_AI_CAPABILITY_MODES: {
|
|
37
|
-
readonly CORE: AiCapabilityMode.Core;
|
|
38
|
-
readonly CUSTOM: AiCapabilityMode.Custom;
|
|
39
|
-
readonly DISABLED: AiCapabilityMode.Disabled;
|
|
40
|
-
};
|
|
41
|
-
declare const LUMA_AI_CAPABILITY_PROVIDERS: {
|
|
42
|
-
readonly LUMA: AiCapabilityProvider.Luma;
|
|
43
|
-
readonly MENTINGO_CORE: AiCapabilityProvider.MentingoCore;
|
|
44
|
-
};
|
|
45
|
-
declare const LUMA_AI_CAPABILITIES: {
|
|
46
|
-
readonly COURSE_GENERATION: AiCapability.CourseGeneration;
|
|
47
|
-
readonly COURSE_GENERATION_VISUAL_ASSETS: AiCapability.CourseGenerationVisualAssets;
|
|
48
|
-
readonly COURSE_GENERATION_EMBEDDINGS: AiCapability.CourseGenerationEmbeddings;
|
|
49
|
-
readonly AI_MENTOR_CHAT: AiCapability.AiMentorChat;
|
|
50
|
-
readonly AI_MENTOR_JUDGE: AiCapability.AiMentorJudge;
|
|
51
|
-
readonly AI_MENTOR_CONFIGURATION_GENERATOR: AiCapability.AiMentorConfigurationGenerator;
|
|
52
|
-
readonly AI_JUDGE_CONFIGURATION_GENERATOR: AiCapability.AiJudgeConfigurationGenerator;
|
|
53
|
-
readonly AI_JUDGE_CONFIGURATION_VALIDATOR: AiCapability.AiJudgeConfigurationValidator;
|
|
54
|
-
readonly AI_MENTOR_RAG_EMBEDDINGS: AiCapability.AiMentorRagEmbeddings;
|
|
55
|
-
readonly TRANSLATION_GENERATION: AiCapability.TranslationGeneration;
|
|
56
|
-
readonly DICTATION_TRANSCRIPTION: AiCapability.DictationTranscription;
|
|
57
|
-
readonly VOICE_TRANSCRIPTION: AiCapability.VoiceTranscription;
|
|
58
|
-
readonly VOICE_MENTOR: AiCapability.VoiceMentor;
|
|
59
|
-
readonly VOICE_TEXT_TO_SPEECH: AiCapability.VoiceTextToSpeech;
|
|
60
|
-
};
|
|
61
|
-
|
|
62
7
|
declare class LumaAiClient {
|
|
63
8
|
private readonly apiClient;
|
|
64
9
|
constructor(apiClient: API<unknown>);
|
|
10
|
+
/** Embed raw text through the native API; optional size and model provenance share this contract. */
|
|
65
11
|
createEmbeddings(opts: CreateEmbeddingsOptions): Promise<CreateEmbeddingsResponse>;
|
|
66
12
|
generateJudgeConfiguration(opts: GenerateAiJudgeConfigurationOptions): Promise<GenerateAiJudgeConfigurationResponse>;
|
|
67
13
|
generateMentorConfiguration(opts: GenerateAiMentorConfigurationOptions): Promise<GenerateAiMentorConfigurationResponse>;
|
|
@@ -171,7 +117,12 @@ declare class LumaMentorClient {
|
|
|
171
117
|
constructor(apiClient: API<unknown>);
|
|
172
118
|
streamChat(opts: MentorChatOptions, requestOptions?: MentorStreamRequestOptions): ReturnType<API<unknown>["api"]["mentorChatApiPublicV1AiMentorChatPost"]>;
|
|
173
119
|
chat(opts: MentorChatOptions, requestOptions?: MentorStreamRequestOptions): ReturnType<API<unknown>["api"]["mentorChatApiPublicV1AiMentorChatPost"]>;
|
|
174
|
-
|
|
120
|
+
/** Event-mode generation always returns the native tool-call result contract. */
|
|
121
|
+
generateChat(opts: MentorChatOptions & {
|
|
122
|
+
streamFormat: "events";
|
|
123
|
+
}, requestOptions?: MentorStreamRequestOptions): Promise<NativeChatResult>;
|
|
124
|
+
/** Legacy and tool-bearing native requests preserve their matching response shapes. */
|
|
125
|
+
generateChat(opts: MentorChatOptions, requestOptions?: MentorStreamRequestOptions): Promise<MentorGenerateChatResponse>;
|
|
175
126
|
judge(opts: MentorJudgeOptions): Promise<MentorJudgeResponse>;
|
|
176
127
|
}
|
|
177
128
|
|
|
@@ -212,4 +163,4 @@ type LumaSocketClientOptions = {
|
|
|
212
163
|
};
|
|
213
164
|
declare const createLumaSocket: (opts: LumaSocketClientOptions) => LumaSocket;
|
|
214
165
|
|
|
215
|
-
export {
|
|
166
|
+
export { AdminApiKeyAssignmentUpdateOptions, AdminApiKeyCreateOptions, AdminApiKeyCreateResponse, AdminApiKeyIdentifierOptions, AdminApiKeyResponse, AdminApiKeyRevokeResponse, AdminApiKeyUpdateOptions, AdminConfigurationResponse, AdminModelAssignmentResponse, AdminModelProfileResponse, AdminOrganizationIdOptions, AuthoringApplicationReceipt, AuthoringCommandReceipt, AuthoringContextFailureReceipt, AuthoringContextFulfillmentReceipt, AuthoringCreateSessionOptions, AuthoringEventPage, AuthoringEventsOptions, AuthoringSessionOptions, AuthoringSessionPage, AuthoringSessionSnapshot, AuthoringSourceUploadReceipt, AuthoringTurnHistoryOptions, AuthoringTurnHistoryPage, CreateEmbeddingsOptions, CreateEmbeddingsResponse, DownloadAuthoringAssetOptions, DownloadedAuthoringAsset, FailAuthoringContextOptions, FrozenAuthoringExport, FulfillAuthoringContextOptions, GenerateAiJudgeConfigurationOptions, GenerateAiJudgeConfigurationResponse, GenerateAiMentorConfigurationOptions, GenerateAiMentorConfigurationResponse, GenerateTranslationsOptions, GenerateTranslationsResponse, GetAuthoringExportOptions, ListAuthoringSessionsOptions, LumaAdminApiKeysClient, LumaAdminClient, LumaAdminModelProfilesClient, LumaAiClient, LumaAuthoringClient, LumaClient, type LumaClientOptions, LumaConfigurationClient, LumaMentorClient, LumaSocket, type LumaSocketClientOptions, MentorChatOptions, MentorGenerateChatResponse, MentorJudgeOptions, MentorJudgeResponse, MentorStreamRequestOptions, NativeChatResult, PrepareAuthoringExportOptions, PublicConfigurationResponse, RecordAuthoringReceiptOptions, SendAuthoringCommandOptions, SubscribeAuthoringEventsOptions, TranscribeDictationOptions, TranscribeDictationResponse, UploadAuthoringSourceOptions, ValidateAiJudgeConfigurationOptions, ValidateAiJudgeConfigurationResponse, ValidateAiMentorConfigurationOptions, ValidateAiMentorConfigurationResponse, consumeAuthoringEventStream, createLumaClient, createLumaSocket };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,67 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
1
|
+
import { A as API, C as CreateEmbeddingsOptions, a as CreateEmbeddingsResponse, G as GenerateAiJudgeConfigurationOptions, b as GenerateAiJudgeConfigurationResponse, c as GenerateAiMentorConfigurationOptions, d as GenerateAiMentorConfigurationResponse, V as ValidateAiJudgeConfigurationOptions, e as ValidateAiJudgeConfigurationResponse, f as ValidateAiMentorConfigurationOptions, g as ValidateAiMentorConfigurationResponse, h as GenerateTranslationsOptions, i as GenerateTranslationsResponse, T as TranscribeDictationOptions, j as TranscribeDictationResponse, k as AdminOrganizationIdOptions, l as AdminApiKeyResponse, m as AdminApiKeyCreateOptions, n as AdminApiKeyCreateResponse, o as AdminApiKeyIdentifierOptions, p as AdminApiKeyUpdateOptions, q as AdminApiKeyRevokeResponse, r as AdminConfigurationResponse, s as AdminModelAssignmentResponse, t as AdminApiKeyAssignmentUpdateOptions, u as AdminModelProfileResponse, v as AuthoringCreateSessionOptions, w as AuthoringSessionSnapshot, L as ListAuthoringSessionsOptions, x as AuthoringSessionPage, y as AuthoringSessionOptions, z as AuthoringTurnHistoryOptions, B as AuthoringTurnHistoryPage, D as AuthoringEventsOptions, E as AuthoringEventPage, S as SubscribeAuthoringEventsOptions, U as UploadAuthoringSourceOptions, F as AuthoringSourceUploadReceipt, H as DownloadAuthoringAssetOptions, I as DownloadedAuthoringAsset, J as SendAuthoringCommandOptions, K as AuthoringCommandReceipt, M as FulfillAuthoringContextOptions, N as AuthoringContextFulfillmentReceipt, O as FailAuthoringContextOptions, P as AuthoringContextFailureReceipt, Q as PrepareAuthoringExportOptions, R as FrozenAuthoringExport, W as GetAuthoringExportOptions, X as RecordAuthoringReceiptOptions, Y as AuthoringApplicationReceipt, Z as PublicConfigurationResponse, _ as MentorChatOptions, $ as MentorStreamRequestOptions, a0 as NativeChatResult, a1 as MentorGenerateChatResponse, a2 as MentorJudgeOptions, a3 as MentorJudgeResponse, a4 as LumaSocket } from './contracts-CcTSdQMI.js';
|
|
2
|
+
export { a5 as AI_MENTOR_CONFIGURATION_TYPES, a6 as AUDIO_PROVIDER_STATES, a7 as AUDIO_RECOVERY_STATES, a8 as AiCapability, a9 as AiCapabilityMode, aa as AiCapabilityProvider, ab as AiCapabilityStatus, ac as AiJudgeConfigurationResponseInput, ad as AiMentorConfigurationType, ae as AiModelAssignmentResponse, af as AiModelAssignmentUpdateRequest, ag as AiModelDomain, ah as AiModelProfileKind, ai as AiModelProfileResponse, aj as AiRuntimeConfiguration, ak as ApiKeyCreateRequest, al as ApiKeyCreateResponse, am as ApiKeyMetadata, an as ApiKeyResponse, ao as ApiKeyUpdateRequest, ap as ApplicationReceipt, aq as AudioBinaryChunk, ar as AudioChunkPayload, as as AudioChunkedPayload, at as AudioOutputAlignmentData, au as AudioOutputAlignmentPayload, av as AudioOutputChunkData, aw as AudioOutputChunkPayload, ax as AudioOutputCompleteData, ay as AudioOutputCompletePayload, az as AudioOutputErrorData, aA as AudioOutputErrorPayload, aB as AudioOutputInterruptedData, aC as AudioOutputInterruptedPayload, aD as AudioProtocolErrorPayload, aE as AudioProviderState, aF as AudioReconnectPayload, aG as AudioRecoveryPayload, aH as AudioRecoveryState, aI as AudioStartedPayload, aJ as AudioStopPayload, aK as AudioTriggerTTSPayload, aL as AuthoringCommand, aM as AuthoringContextFailure, aN as AuthoringContextResponse, aO as AuthoringEvent, aP as AuthoringLessonCreateOperation, aQ as AuthoringLessonUpdateOperation, aR as AuthoringMentorLessonCreatePayload, aS as AuthoringOperation, aT as AuthoringSessionSummary, aU as AuthoringSubscriptionError, aV as AuthoringSubscriptionErrorCode, aW as AuthoringTaskFailure, aX as AuthoringTaskSummary, aY as AuthoringTurn, aZ as AuthoringTurnPart, a_ as AuthoringWorkProgress, a$ as AuthoringWorkProgressChapter, b0 as AuthoringWorkProgressStage, b1 as AuthoringWorkspaceRecord, b2 as BodyUploadSourceApiPublicV1AuthoringSessionsSessionIdSourcesPost, b3 as ClientSpeechBoundaryPayload, b4 as CommandReceipt, b5 as ContextFailure, b6 as ContextFailureReceipt, b7 as ContextFulfillmentReceipt, b8 as ContextResponse, b9 as CreateSession, ba as EXTERNAL_AUDIO_CLIENT_RECONNECT_GRACE_MS, bb as EXTERNAL_AUDIO_MAX_BUFFERED_CHUNKS, bc as EXTERNAL_AUDIO_MAX_RECOVERY_ATTEMPTS, bd as EXTERNAL_AUDIO_OPERATION, be as EXTERNAL_AUDIO_RECOVERY_STATE, bf as EXTERNAL_AUDIO_RECOVERY_TIMEOUT_MS, bg as EXTERNAL_AUDIO_TERMINAL_RECOVERY_ERROR_CODES, bh as EventPage, bi as FrozenExport, bj as LEARNER_TRANSCRIPT_STATUSES, bk as LUMA_AI_CAPABILITIES, bl as LUMA_AI_CAPABILITY_MODES, bm as LUMA_AI_CAPABILITY_PROVIDERS, bn as LUMA_AI_MODEL_DOMAINS, bo as LUMA_AI_MODEL_PROFILE_KINDS, bp as LUMA_AUDIO_ACTIONS, bq as LUMA_AUDIO_FORMATS, br as LUMA_CAPTURE_PROFILES, bs as LUMA_MENTOR_STREAM_EVENT_TYPES, bt as LUMA_SOCKET_EMIT_EVENTS, bu as LUMA_SOCKET_LISTEN_EVENTS, bv as LUMA_SOCKET_MESSAGE_TYPES, bw as LUMA_VOICE_TIMING_PRECISION, bx as LearnerTranscriptStatus, by as LearnerTranscriptionData, bz as LearnerTranscriptionPayload, bA as LearnerTranscriptionTimingData, bB as LumaAiModelDomain, bC as LumaAiModelProfileKind, bD as LumaCaptureProfile, bE as LumaSocketEmitEvents, bF as LumaSocketListenEvents, bG as LumaVoiceTimingPrecision, bH as MentorChatEvent, bI as MentorChatRequest, bJ as MentorChatResponse, bK as MentorStreamEventEnvelope, bL as MentorTextDeltaPayload, bM as MentorTextEndPayload, bN as MentorTextErrorPayload, bO as MentorTranscriptionPayload, bP as NamedToolChoice, bQ as NativeChatTool, bR as NativeChatUsage, bS as NativeErrorEvent, bT as NativeFinishEvent, bU as NativeTextDelta, bV as NativeToolCall, bW as NativeToolCallEvent, bX as PrepareAuthoringExport, bY as PrepareExport, bZ as ProposalReviewDecision, b_ as PublicAiMessage, b$ as ReasoningEffort, c0 as ServerConnectedPayload, c1 as SessionSnapshot, c2 as SessionSummary, c3 as SessionSummaryPage, c4 as SourceUploadReceipt, c5 as SpeechAlignmentWord, c6 as StartAudioPayload, c7 as TRANSCRIPTION_MODES, c8 as TTSProvider, c9 as TaskFailure, ca as TaskKind, cb as TaskSummary, cc as TextToSpeechProvider, cd as TranscriptionSessionPlan, ce as TurnPartKind, cf as TurnPartStatus, cg as TurnStatus, ch as WorkspaceRecord } from './contracts-CcTSdQMI.js';
|
|
3
3
|
import { Agent } from 'node:https';
|
|
4
4
|
import 'axios';
|
|
5
5
|
import 'socket.io-client';
|
|
6
6
|
|
|
7
|
-
type AiRuntimeConfiguration = PublicConfigurationResponse;
|
|
8
|
-
type MentorChatOptions = MentorChatRequest;
|
|
9
|
-
type MentorStreamRequestOptions = {
|
|
10
|
-
signal?: AbortSignal;
|
|
11
|
-
};
|
|
12
|
-
type MentorGenerateChatResponse = MentorChatResponse;
|
|
13
|
-
type MentorJudgeOptions = StructuredGenerationRequest;
|
|
14
|
-
type MentorJudgeResponse = JudgeResponse;
|
|
15
|
-
type GenerateAiJudgeConfigurationOptions = StructuredGenerationRequest;
|
|
16
|
-
type GenerateAiJudgeConfigurationResponse = AiJudgeConfigurationResponseOutput;
|
|
17
|
-
declare const AI_MENTOR_CONFIGURATION_TYPES: {
|
|
18
|
-
readonly TEACHER: "teacher";
|
|
19
|
-
readonly ROLEPLAY: "roleplay";
|
|
20
|
-
};
|
|
21
|
-
type AiMentorConfigurationType = (typeof AI_MENTOR_CONFIGURATION_TYPES)[keyof typeof AI_MENTOR_CONFIGURATION_TYPES];
|
|
22
|
-
type GenerateAiMentorConfigurationOptions = Omit<GenerateAiMentorConfigurationRequest, "configurationType"> & {
|
|
23
|
-
configurationType: AiMentorConfigurationType;
|
|
24
|
-
};
|
|
25
|
-
type GenerateAiMentorConfigurationResponse = AiMentorTeacherConfigurationResponse | AiMentorRoleplayConfigurationResponse;
|
|
26
|
-
type ValidateAiJudgeConfigurationOptions = StructuredGenerationRequest;
|
|
27
|
-
type ValidateAiJudgeConfigurationResponse = AiJudgeConfigurationValidationResponse;
|
|
28
|
-
type ValidateAiMentorConfigurationOptions = StructuredGenerationRequest;
|
|
29
|
-
type ValidateAiMentorConfigurationResponse = AiMentorConfigurationValidationResponse;
|
|
30
|
-
type CreateEmbeddingsOptions = EmbeddingsRequest;
|
|
31
|
-
type CreateEmbeddingsResponse = EmbeddingsResponse;
|
|
32
|
-
type GenerateTranslationsOptions = StructuredGenerationRequest;
|
|
33
|
-
type GenerateTranslationsResponse = TranslationResponse;
|
|
34
|
-
type TranscribeDictationOptions = BodyTranscribeDictationApiPublicV1AiTranscriptionsPost;
|
|
35
|
-
type TranscribeDictationResponse = TranscriptionResponse;
|
|
36
|
-
declare const LUMA_AI_CAPABILITY_MODES: {
|
|
37
|
-
readonly CORE: AiCapabilityMode.Core;
|
|
38
|
-
readonly CUSTOM: AiCapabilityMode.Custom;
|
|
39
|
-
readonly DISABLED: AiCapabilityMode.Disabled;
|
|
40
|
-
};
|
|
41
|
-
declare const LUMA_AI_CAPABILITY_PROVIDERS: {
|
|
42
|
-
readonly LUMA: AiCapabilityProvider.Luma;
|
|
43
|
-
readonly MENTINGO_CORE: AiCapabilityProvider.MentingoCore;
|
|
44
|
-
};
|
|
45
|
-
declare const LUMA_AI_CAPABILITIES: {
|
|
46
|
-
readonly COURSE_GENERATION: AiCapability.CourseGeneration;
|
|
47
|
-
readonly COURSE_GENERATION_VISUAL_ASSETS: AiCapability.CourseGenerationVisualAssets;
|
|
48
|
-
readonly COURSE_GENERATION_EMBEDDINGS: AiCapability.CourseGenerationEmbeddings;
|
|
49
|
-
readonly AI_MENTOR_CHAT: AiCapability.AiMentorChat;
|
|
50
|
-
readonly AI_MENTOR_JUDGE: AiCapability.AiMentorJudge;
|
|
51
|
-
readonly AI_MENTOR_CONFIGURATION_GENERATOR: AiCapability.AiMentorConfigurationGenerator;
|
|
52
|
-
readonly AI_JUDGE_CONFIGURATION_GENERATOR: AiCapability.AiJudgeConfigurationGenerator;
|
|
53
|
-
readonly AI_JUDGE_CONFIGURATION_VALIDATOR: AiCapability.AiJudgeConfigurationValidator;
|
|
54
|
-
readonly AI_MENTOR_RAG_EMBEDDINGS: AiCapability.AiMentorRagEmbeddings;
|
|
55
|
-
readonly TRANSLATION_GENERATION: AiCapability.TranslationGeneration;
|
|
56
|
-
readonly DICTATION_TRANSCRIPTION: AiCapability.DictationTranscription;
|
|
57
|
-
readonly VOICE_TRANSCRIPTION: AiCapability.VoiceTranscription;
|
|
58
|
-
readonly VOICE_MENTOR: AiCapability.VoiceMentor;
|
|
59
|
-
readonly VOICE_TEXT_TO_SPEECH: AiCapability.VoiceTextToSpeech;
|
|
60
|
-
};
|
|
61
|
-
|
|
62
7
|
declare class LumaAiClient {
|
|
63
8
|
private readonly apiClient;
|
|
64
9
|
constructor(apiClient: API<unknown>);
|
|
10
|
+
/** Embed raw text through the native API; optional size and model provenance share this contract. */
|
|
65
11
|
createEmbeddings(opts: CreateEmbeddingsOptions): Promise<CreateEmbeddingsResponse>;
|
|
66
12
|
generateJudgeConfiguration(opts: GenerateAiJudgeConfigurationOptions): Promise<GenerateAiJudgeConfigurationResponse>;
|
|
67
13
|
generateMentorConfiguration(opts: GenerateAiMentorConfigurationOptions): Promise<GenerateAiMentorConfigurationResponse>;
|
|
@@ -171,7 +117,12 @@ declare class LumaMentorClient {
|
|
|
171
117
|
constructor(apiClient: API<unknown>);
|
|
172
118
|
streamChat(opts: MentorChatOptions, requestOptions?: MentorStreamRequestOptions): ReturnType<API<unknown>["api"]["mentorChatApiPublicV1AiMentorChatPost"]>;
|
|
173
119
|
chat(opts: MentorChatOptions, requestOptions?: MentorStreamRequestOptions): ReturnType<API<unknown>["api"]["mentorChatApiPublicV1AiMentorChatPost"]>;
|
|
174
|
-
|
|
120
|
+
/** Event-mode generation always returns the native tool-call result contract. */
|
|
121
|
+
generateChat(opts: MentorChatOptions & {
|
|
122
|
+
streamFormat: "events";
|
|
123
|
+
}, requestOptions?: MentorStreamRequestOptions): Promise<NativeChatResult>;
|
|
124
|
+
/** Legacy and tool-bearing native requests preserve their matching response shapes. */
|
|
125
|
+
generateChat(opts: MentorChatOptions, requestOptions?: MentorStreamRequestOptions): Promise<MentorGenerateChatResponse>;
|
|
175
126
|
judge(opts: MentorJudgeOptions): Promise<MentorJudgeResponse>;
|
|
176
127
|
}
|
|
177
128
|
|
|
@@ -212,4 +163,4 @@ type LumaSocketClientOptions = {
|
|
|
212
163
|
};
|
|
213
164
|
declare const createLumaSocket: (opts: LumaSocketClientOptions) => LumaSocket;
|
|
214
165
|
|
|
215
|
-
export {
|
|
166
|
+
export { AdminApiKeyAssignmentUpdateOptions, AdminApiKeyCreateOptions, AdminApiKeyCreateResponse, AdminApiKeyIdentifierOptions, AdminApiKeyResponse, AdminApiKeyRevokeResponse, AdminApiKeyUpdateOptions, AdminConfigurationResponse, AdminModelAssignmentResponse, AdminModelProfileResponse, AdminOrganizationIdOptions, AuthoringApplicationReceipt, AuthoringCommandReceipt, AuthoringContextFailureReceipt, AuthoringContextFulfillmentReceipt, AuthoringCreateSessionOptions, AuthoringEventPage, AuthoringEventsOptions, AuthoringSessionOptions, AuthoringSessionPage, AuthoringSessionSnapshot, AuthoringSourceUploadReceipt, AuthoringTurnHistoryOptions, AuthoringTurnHistoryPage, CreateEmbeddingsOptions, CreateEmbeddingsResponse, DownloadAuthoringAssetOptions, DownloadedAuthoringAsset, FailAuthoringContextOptions, FrozenAuthoringExport, FulfillAuthoringContextOptions, GenerateAiJudgeConfigurationOptions, GenerateAiJudgeConfigurationResponse, GenerateAiMentorConfigurationOptions, GenerateAiMentorConfigurationResponse, GenerateTranslationsOptions, GenerateTranslationsResponse, GetAuthoringExportOptions, ListAuthoringSessionsOptions, LumaAdminApiKeysClient, LumaAdminClient, LumaAdminModelProfilesClient, LumaAiClient, LumaAuthoringClient, LumaClient, type LumaClientOptions, LumaConfigurationClient, LumaMentorClient, LumaSocket, type LumaSocketClientOptions, MentorChatOptions, MentorGenerateChatResponse, MentorJudgeOptions, MentorJudgeResponse, MentorStreamRequestOptions, NativeChatResult, PrepareAuthoringExportOptions, PublicConfigurationResponse, RecordAuthoringReceiptOptions, SendAuthoringCommandOptions, SubscribeAuthoringEventsOptions, TranscribeDictationOptions, TranscribeDictationResponse, UploadAuthoringSourceOptions, ValidateAiJudgeConfigurationOptions, ValidateAiJudgeConfigurationResponse, ValidateAiMentorConfigurationOptions, ValidateAiMentorConfigurationResponse, consumeAuthoringEventStream, createLumaClient, createLumaSocket };
|
package/dist/index.js
CHANGED
|
@@ -34,7 +34,7 @@ import {
|
|
|
34
34
|
TurnPartKind,
|
|
35
35
|
TurnPartStatus,
|
|
36
36
|
TurnStatus
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-PHLN53W2.js";
|
|
38
38
|
|
|
39
39
|
// src/types.ts
|
|
40
40
|
var AI_MENTOR_CONFIGURATION_TYPES = {
|
|
@@ -52,6 +52,7 @@ var LUMA_AI_CAPABILITY_PROVIDERS = {
|
|
|
52
52
|
};
|
|
53
53
|
var LUMA_AI_CAPABILITIES = {
|
|
54
54
|
COURSE_GENERATION: "courseGeneration" /* CourseGeneration */,
|
|
55
|
+
COURSE_GENERATION_VISION: "courseGenerationVision" /* CourseGenerationVision */,
|
|
55
56
|
COURSE_GENERATION_VISUAL_ASSETS: "courseGenerationVisualAssets" /* CourseGenerationVisualAssets */,
|
|
56
57
|
COURSE_GENERATION_EMBEDDINGS: "courseGenerationEmbeddings" /* CourseGenerationEmbeddings */,
|
|
57
58
|
AI_MENTOR_CHAT: "aiMentorChat" /* AiMentorChat */,
|
|
@@ -72,6 +73,7 @@ var LumaAiClient = class {
|
|
|
72
73
|
constructor(apiClient) {
|
|
73
74
|
this.apiClient = apiClient;
|
|
74
75
|
}
|
|
76
|
+
/** Embed raw text through the native API; optional size and model provenance share this contract. */
|
|
75
77
|
async createEmbeddings(opts) {
|
|
76
78
|
const response = await this.apiClient.api.createEmbeddingsApiPublicV1AiEmbeddingsPost(opts);
|
|
77
79
|
return response.data;
|
|
@@ -555,8 +557,14 @@ var LumaMentorClient = class {
|
|
|
555
557
|
chat(opts, requestOptions = {}) {
|
|
556
558
|
return this.streamChat(opts, requestOptions);
|
|
557
559
|
}
|
|
558
|
-
|
|
559
|
-
|
|
560
|
+
/** Generate native chat output, preserving caller cancellation before any fallback decision. */
|
|
561
|
+
async generateChat(opts, requestOptions = {}) {
|
|
562
|
+
const response = await this.apiClient.api.generateMentorChatApiPublicV1AiMentorChatGeneratePost(
|
|
563
|
+
opts,
|
|
564
|
+
{
|
|
565
|
+
signal: requestOptions.signal
|
|
566
|
+
}
|
|
567
|
+
);
|
|
560
568
|
return response.data;
|
|
561
569
|
}
|
|
562
570
|
async judge(opts) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mentingo/luma-sdk",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"description": "Luma API SDK",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"dev": "tsup src/index.ts src/contracts.ts --watch --format esm,cjs --dts",
|
|
62
62
|
"lint": "eslint .",
|
|
63
63
|
"test": "pnpm build && pnpm test:types && node --test test/*.test.js",
|
|
64
|
-
"test:types": "tsc --noEmit --module ESNext --moduleResolution Bundler --target ES2020 --strict --skipLibCheck test/admin-consumer.ts test/authoring-consumer.ts",
|
|
64
|
+
"test:types": "tsc --noEmit --module ESNext --moduleResolution Bundler --target ES2020 --strict --skipLibCheck test/admin-consumer.ts test/authoring-consumer.ts test/mentor-consumer.ts",
|
|
65
65
|
"lint:fix": "eslint . --fix",
|
|
66
66
|
"format": "prettier . --write",
|
|
67
67
|
"format:check": "prettier . --check",
|