@codex-app-sdk/core 0.14.4 → 0.15.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/dist/native.d.ts CHANGED
@@ -2,6 +2,32 @@ export type CodexSpeechTranscriptionResult = {
2
2
  text: string;
3
3
  error?: string;
4
4
  };
5
+ /** Full replacement of the current transcript, not an append-only word delta. */
6
+ export type CodexSpeechTranscript = {
7
+ finalText: string;
8
+ partialText: string;
9
+ };
10
+ export type CodexSpeechSessionOptions = {
11
+ sessionId: string;
12
+ sampleRate: number;
13
+ locale?: string;
14
+ };
15
+ export type CodexSpeechSessionEvent = ({
16
+ type: 'transcript';
17
+ sessionId: string;
18
+ } & CodexSpeechTranscript) | {
19
+ type: 'error';
20
+ sessionId: string;
21
+ error: string;
22
+ };
23
+ /** Mono Float32 little-endian PCM, sent once in capture order. Stop drains final results. */
24
+ export type CodexStreamingTranscription = {
25
+ start(options: CodexSpeechSessionOptions): Promise<void>;
26
+ append(sessionId: string, audio: ArrayBuffer): Promise<void>;
27
+ stop(sessionId: string): Promise<CodexSpeechTranscriptionResult>;
28
+ cancel(sessionId: string): Promise<void>;
29
+ onEvent(listener: (event: CodexSpeechSessionEvent) => void): () => void;
30
+ };
5
31
  /** Renderer-safe attachment metadata. `reference` is an opaque host capability, never a filesystem path. */
6
32
  export type CodexHostAttachment = {
7
33
  id: string;
@@ -26,6 +52,8 @@ export type CodexNativeClipboardContent = {
26
52
  html?: string;
27
53
  };
28
54
  export type CodexHostCapabilities = {
55
+ /** Absent when only batch transcription is available. */
56
+ streamingTranscription?: CodexStreamingTranscription;
29
57
  capabilities: {
30
58
  attachments: boolean;
31
59
  clipboard: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"native.d.ts","sourceRoot":"","sources":["../src/native.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,8BAA8B,GAAG;IAC3C,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CA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,SAAS,wBAAwB,EAAE,GAAG,OAAO,CAAC,mBAAmB,EAAE,CAAC,CAAC;IAC9F,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1C,eAAe,IAAI,OAAO,CAAC,mBAAmB,EAAE,CAAC,CAAC;IAClD,gBAAgB,CAAC,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAC7D,eAAe,CACb,SAAS,EAAE,WAAW,EACtB,OAAO,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,OAAO,CAAA;KAAE,GAC5C,OAAO,CAAC,8BAA8B,CAAC,CAAC;CAC5C,CAAC;AAEF,yEAAyE;AACzE,MAAM,MAAM,sBAAsB,GAAG,qBAAqB,CAAC;AAE3D,eAAO,MAAM,yBAAyB,sBAAsB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"native.js","names":[],"sources":["../src/native.ts"],"sourcesContent":["export type CodexSpeechTranscriptionResult = {\n text: string;\n error?: string;\n};\n\n/** Renderer-safe attachment metadata. `reference` is an opaque host capability, never a filesystem path. */\nexport type CodexHostAttachment = {\n id: string;\n type: 'file' | 'image';\n reference: string;\n name: string;\n mimeType: string;\n size: number;\n previewUrl?: string;\n};\n\nexport type CodexHostAttachmentInput = {\n name: string;\n mimeType?: string;\n data: ArrayBuffer;\n};\n\n/** @deprecated Use the platform-neutral `CodexHostAttachment` name. */\nexport type CodexNativeAttachment = CodexHostAttachment;\n/** @deprecated Use the platform-neutral `CodexHostAttachmentInput` name. */\nexport type CodexNativeAttachmentInput = CodexHostAttachmentInput;\n\nexport type CodexNativeClipboardContent = {\n text: string;\n html?: string;\n};\n\nexport type CodexHostCapabilities = {\n capabilities: {\n attachments: boolean;\n clipboard: boolean;\n externalLinks: boolean;\n transcription: boolean;\n };\n copyToClipboard(content: CodexNativeClipboardContent): Promise<void>;\n ingestAttachments(files: readonly CodexHostAttachmentInput[]): Promise<CodexHostAttachment[]>;\n openExternal(href: string): Promise<void>;\n pickAttachments(): Promise<CodexHostAttachment[]>;\n readImagePreview?(reference: string): Promise<string | null>;\n transcribeAudio(\n audioData: ArrayBuffer,\n options?: { locale?: string; live?: boolean },\n ): Promise<CodexSpeechTranscriptionResult>;\n};\n\n/** @deprecated Use the platform-neutral `CodexHostCapabilities` name. */\nexport type CodexNativeRendererApi = CodexHostCapabilities;\n\nexport const codexNativeRendererGlobal = 'codexAppSdkNative';\n"],"mappings":";AAqDA,IAAa,IAA4B"}
1
+ {"version":3,"file":"native.js","names":[],"sources":["../src/native.ts"],"sourcesContent":["export type CodexSpeechTranscriptionResult = {\n text: string;\n error?: string;\n};\n\n/** Full replacement of the current transcript, not an append-only word delta. */\nexport type CodexSpeechTranscript = { finalText: string; partialText: string };\nexport type CodexSpeechSessionOptions = { sessionId: string; sampleRate: number; locale?: string };\nexport type CodexSpeechSessionEvent =\n | ({ type: 'transcript'; sessionId: string } & CodexSpeechTranscript)\n | { type: 'error'; sessionId: string; error: string };\n\n/** Mono Float32 little-endian PCM, sent once in capture order. Stop drains final results. */\nexport type CodexStreamingTranscription = {\n start(options: CodexSpeechSessionOptions): Promise<void>;\n append(sessionId: string, audio: ArrayBuffer): Promise<void>;\n stop(sessionId: string): Promise<CodexSpeechTranscriptionResult>;\n cancel(sessionId: string): Promise<void>;\n onEvent(listener: (event: CodexSpeechSessionEvent) => void): () => void;\n};\n\n/** Renderer-safe attachment metadata. `reference` is an opaque host capability, never a filesystem path. */\nexport type CodexHostAttachment = {\n id: string;\n type: 'file' | 'image';\n reference: string;\n name: string;\n mimeType: string;\n size: number;\n previewUrl?: string;\n};\n\nexport type CodexHostAttachmentInput = {\n name: string;\n mimeType?: string;\n data: ArrayBuffer;\n};\n\n/** @deprecated Use the platform-neutral `CodexHostAttachment` name. */\nexport type CodexNativeAttachment = CodexHostAttachment;\n/** @deprecated Use the platform-neutral `CodexHostAttachmentInput` name. */\nexport type CodexNativeAttachmentInput = CodexHostAttachmentInput;\n\nexport type CodexNativeClipboardContent = {\n text: string;\n html?: string;\n};\n\nexport type CodexHostCapabilities = {\n /** Absent when only batch transcription is available. */\n streamingTranscription?: CodexStreamingTranscription;\n capabilities: {\n attachments: boolean;\n clipboard: boolean;\n externalLinks: boolean;\n transcription: boolean;\n };\n copyToClipboard(content: CodexNativeClipboardContent): Promise<void>;\n ingestAttachments(files: readonly CodexHostAttachmentInput[]): Promise<CodexHostAttachment[]>;\n openExternal(href: string): Promise<void>;\n pickAttachments(): Promise<CodexHostAttachment[]>;\n readImagePreview?(reference: string): Promise<string | null>;\n transcribeAudio(\n audioData: ArrayBuffer,\n options?: { locale?: string; live?: boolean },\n ): Promise<CodexSpeechTranscriptionResult>;\n};\n\n/** @deprecated Use the platform-neutral `CodexHostCapabilities` name. */\nexport type CodexNativeRendererApi = CodexHostCapabilities;\n\nexport const codexNativeRendererGlobal = 'codexAppSdkNative';\n"],"mappings":";AAuEA,IAAa,IAA4B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codex-app-sdk/core",
3
- "version": "0.14.4",
3
+ "version": "0.15.1",
4
4
  "description": "Renderer-safe contracts and shared primitives for Codex applications.",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",