@theaiplatform/miniapp-sdk 0.2.2 → 0.3.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.
package/dist/sdk.d.ts CHANGED
@@ -201,10 +201,17 @@ export declare type MiniAppHttpRequestInput = {
201
201
 
202
202
  export declare type MiniAppHttpRequestOptions = {
203
203
  /**
204
- * Opaque host-managed credential reference. Secret material never enters
205
- * miniapp JavaScript.
204
+ * Opaque host-managed credential reference, or the reserved
205
+ * `platform-session` reference for the active TAP account. Secret material
206
+ * never enters miniapp JavaScript.
206
207
  */
207
208
  credentialRef?: string;
209
+ /**
210
+ * Requests one host-managed integration credential. The host attaches it
211
+ * only after the package declares and receives the corresponding credential
212
+ * permission; secret material never enters miniapp JavaScript.
213
+ */
214
+ auth?: 'github';
208
215
  };
209
216
 
210
217
  export declare type MiniAppHttpResponse = {
@@ -294,8 +301,6 @@ export declare type MiniAppPlatformApi = {
294
301
  create(options: CreateChannelOptions): CreateChannelResult | Promise<CreateChannelResult>;
295
302
  list(options?: ListChannelsOptions): ListChannelsResult | Promise<ListChannelsResult>;
296
303
  sendMessage(options: SendChannelMessageOptions): SendChannelMessageResult | Promise<SendChannelMessageResult>;
297
- /** Persist one deterministic completed row under a joined specialist. */
298
- sendSpecialistMessage(options: SendChannelSpecialistMessageOptions): SendChannelSpecialistMessageResult | Promise<SendChannelSpecialistMessageResult>;
299
304
  getAccess(options: GetChannelAccessOptions): GetChannelAccessResult | Promise<GetChannelAccessResult>;
300
305
  getTimeline(options: GetChannelTimelineOptions): GetChannelTimelineResult | Promise<GetChannelTimelineResult>;
301
306
  };
@@ -321,6 +326,8 @@ export declare type MiniAppPlatformApi = {
321
326
  credentials?: MiniAppCredentialsApi;
322
327
  /** Desktop host capability; feature-detect before use on portable targets. */
323
328
  printing?: MiniAppReceiptPrintingApi;
329
+ /** Desktop host capability; feature-detect before opening a terminal. */
330
+ terminal?: MiniAppTerminalApi;
324
331
  /** Browser capabilities appear only when the selected target supports them. */
325
332
  auth?: MiniAppAuthApi;
326
333
  vfs?: MiniAppVfsApi;
@@ -376,7 +383,8 @@ export declare type MiniAppProject = {
376
383
  export declare type MiniAppProvisionProjectChatOptions = {
377
384
  conversationId: string;
378
385
  projectId: string;
379
- referenceBranch?: string | null;
386
+ baseBranch?: string | null;
387
+ workingBranch?: string | null;
380
388
  };
381
389
 
382
390
  export declare type MiniAppProvisionProjectChatResult = {
@@ -412,24 +420,51 @@ export declare type MiniAppReceiptLine = {
412
420
  kind: 'blank';
413
421
  };
414
422
 
415
- /** Abstract machine-local printer readiness; destination identity stays host-only. */
423
+ /** Host rendering capabilities for one supported receipt paper width. */
424
+ export declare type MiniAppReceiptPaperProfile = {
425
+ id: MiniAppReceiptPrinterProfile;
426
+ widthMm: 58 | 80;
427
+ columns: 32 | 48;
428
+ };
429
+
430
+ /** Bounded metadata for one machine-local printer visible to an authorized miniapp. */
431
+ export declare type MiniAppReceiptPrinter = {
432
+ name: string;
433
+ isDefault: boolean;
434
+ };
435
+
436
+ export declare type MiniAppReceiptPrinterDiscovery = {
437
+ printers: MiniAppReceiptPrinter[];
438
+ paperProfiles: MiniAppReceiptPaperProfile[];
439
+ };
440
+
441
+ export declare type MiniAppReceiptPrinterProfile = 'receipt-58mm' | 'receipt-80mm';
442
+
443
+ /** Miniapp-owned selection passed explicitly to status and submission calls. */
444
+ export declare type MiniAppReceiptPrinterSelection = {
445
+ printerName: string;
446
+ profile: MiniAppReceiptPrinterProfile;
447
+ };
448
+
449
+ /** Readiness for an exact machine-local printer selection. */
416
450
  export declare type MiniAppReceiptPrinterStatus = {
417
- availability: 'unconfigured' | 'ready' | 'unavailable';
418
- profile: 'receipt-58mm' | 'receipt-80mm' | null;
451
+ availability: 'ready' | 'unavailable';
419
452
  };
420
453
 
421
- /** Desktop-only silent receipt output through the host-configured OS spooler. */
454
+ /** Desktop-only silent receipt output through a discovered OS spooler. */
422
455
  export declare type MiniAppReceiptPrintingApi = {
423
- getStatus(): MiniAppMaybePromise<MiniAppReceiptPrinterStatus>;
456
+ listPrinters(): MiniAppMaybePromise<MiniAppReceiptPrinterDiscovery>;
457
+ getStatus(selection: MiniAppReceiptPrinterSelection): MiniAppMaybePromise<MiniAppReceiptPrinterStatus>;
424
458
  submit(options: MiniAppReceiptPrintOptions): MiniAppMaybePromise<MiniAppReceiptPrintResult>;
425
459
  };
426
460
 
427
461
  export declare type MiniAppReceiptPrintOptions = {
428
462
  /**
429
463
  * Stable caller key, capped at 128 characters. The host journals it within
430
- * installation, workspace, and configured-destination scope.
464
+ * installation, workspace, and selected-destination scope.
431
465
  */
432
466
  jobKey: string;
467
+ selection: MiniAppReceiptPrinterSelection;
433
468
  document: MiniAppReceiptDocument;
434
469
  };
435
470
 
@@ -558,6 +593,76 @@ export declare type MiniAppStorageSetOptions = MiniAppStorageAddress & {
558
593
  expectedRevision: number | null;
559
594
  };
560
595
 
596
+ export declare type MiniAppTerminalApi = {
597
+ readonly v1: MiniAppTerminalV1Api;
598
+ };
599
+
600
+ /** Versioned, desktop-only host terminal capability. */
601
+ export declare type MiniAppTerminalV1Api = {
602
+ getCapabilities(): Promise<MiniAppTerminalV1Capabilities>;
603
+ open(options: MiniAppTerminalV1OpenOptions): Promise<MiniAppTerminalV1Session>;
604
+ };
605
+
606
+ export declare type MiniAppTerminalV1Capabilities = {
607
+ profiles: MiniAppTerminalV1Profile[];
608
+ limits: MiniAppTerminalV1Limits;
609
+ };
610
+
611
+ export declare type MiniAppTerminalV1DataEvent = {
612
+ type: 'data';
613
+ sequence: number;
614
+ data: Uint8Array;
615
+ };
616
+
617
+ export declare type MiniAppTerminalV1Event = MiniAppTerminalV1DataEvent | MiniAppTerminalV1ExitEvent;
618
+
619
+ export declare type MiniAppTerminalV1ExitEvent = {
620
+ type: 'exit';
621
+ sequence: number;
622
+ code: number | null;
623
+ signal: string | null;
624
+ reason: 'exited' | 'closed' | 'revoked' | 'error';
625
+ };
626
+
627
+ export declare type MiniAppTerminalV1Limits = {
628
+ maxSessionsPerDocument: number;
629
+ maxWriteBytes: number;
630
+ maxOutputBytesInFlight: number;
631
+ maxCols: number;
632
+ maxRows: number;
633
+ };
634
+
635
+ export declare type MiniAppTerminalV1OpenOptions = {
636
+ profile: MiniAppTerminalV1ProfileId;
637
+ cols: number;
638
+ rows: number;
639
+ };
640
+
641
+ export declare type MiniAppTerminalV1Profile = {
642
+ id: MiniAppTerminalV1ProfileId;
643
+ available: boolean;
644
+ unavailableReason: string | null;
645
+ };
646
+
647
+ /** Host-owned terminal runtime profiles exposed by `sdk.terminal.v1`. */
648
+ export declare type MiniAppTerminalV1ProfileId = 'workspace-shell' | 'neovim';
649
+
650
+ export declare type MiniAppTerminalV1ResizeOptions = {
651
+ cols: number;
652
+ rows: number;
653
+ };
654
+
655
+ export declare type MiniAppTerminalV1Session = {
656
+ /** Opaque host-minted session identity; it carries no ambient authority. */
657
+ readonly id: string;
658
+ readonly profile: MiniAppTerminalV1ProfileId;
659
+ /** Ordered output with byte-sized backpressure owned by the host session. */
660
+ readonly events: ReadableStream<MiniAppTerminalV1Event>;
661
+ write(data: Uint8Array): Promise<void>;
662
+ resize(options: MiniAppTerminalV1ResizeOptions): Promise<void>;
663
+ close(): Promise<void>;
664
+ };
665
+
561
666
  export declare type MiniAppUserProfile = {
562
667
  sub: string;
563
668
  name?: string | null;
@@ -627,21 +732,6 @@ export declare type SendChannelMessageResult = {
627
732
  clientMessageId: string;
628
733
  };
629
734
 
630
- export declare type SendChannelSpecialistMessageOptions = {
631
- workspaceId?: string;
632
- channelId: string;
633
- projectId: string;
634
- specialistId: string;
635
- clientMessageId: string;
636
- body: string;
637
- messageContent?: Record<string, MiniAppJsonValue>;
638
- };
639
-
640
- export declare type SendChannelSpecialistMessageResult = {
641
- messageId: string;
642
- clientMessageId: string;
643
- };
644
-
645
735
  export declare type UpdateProjectOptions = {
646
736
  workspaceId?: string;
647
737
  projectId: string;
package/dist/ui/wasm.js CHANGED
@@ -6,7 +6,7 @@ import { clsx } from "clsx";
6
6
  import { twMerge } from "tailwind-merge";
7
7
  import { Slot as react_slot_Slot } from "@radix-ui/react-slot";
8
8
  import "prism-react-renderer";
9
- import { composeRefs } from "@radix-ui/react-compose-refs";
9
+ import { useComposedRefs } from "@radix-ui/react-compose-refs";
10
10
  import { useCallback as external_react_useCallback, useEffect, useRef } from "react";
11
11
  import "react-resizable-panels";
12
12
  import "@radix-ui/react-scroll-area";
@@ -626,6 +626,7 @@ DialogContentPrimitive.displayName = __rspack_external__radix_ui_react_dialog_da
626
626
  function DialogContent({ className, children, ref, container, hideCloseButton, onOpenAutoFocus, onEscapeKeyDown, ...props }) {
627
627
  const { ref: occlusionRef, ready } = native_view_occlusion_useNativeViewOcclusion();
628
628
  const contentRef = __rspack_external_react.useRef(null);
629
+ const composedContentRef = useComposedRefs(ref, contentRef);
629
630
  const closeButtonRef = __rspack_external_react.useRef(null);
630
631
  const shouldFocusWhenReadyRef = __rspack_external_react.useRef(false);
631
632
  const handleOpenAutoFocus = __rspack_external_react.useCallback((event)=>{
@@ -670,7 +671,7 @@ function DialogContent({ className, children, ref, container, hideCloseButton, o
670
671
  bottom: 'var(--chat-input-offset, 0px)'
671
672
  } : void 0
672
673
  }, /*#__PURE__*/ __rspack_external_react.createElement(DialogContentPrimitive, {
673
- ref: composeRefs(ref, contentRef),
674
+ ref: composedContentRef,
674
675
  className: utils_cn('bg-surface-level-1 pointer-events-auto relative grid max-h-full w-full max-w-lg min-w-0 gap-4 overflow-auto rounded-3xl border p-8 break-words shadow-lg', className),
675
676
  ...container ? {
676
677
  onInteractOutside: (e)=>{
@@ -1348,8 +1349,9 @@ function SelectScrollDownButton({ className, ref, ...props }) {
1348
1349
  SelectScrollDownButton.displayName = __rspack_external__radix_ui_react_select_4606f4d3.ScrollDownButton.displayName;
1349
1350
  function SelectContent({ className, children, position = 'popper', ref, ...props }) {
1350
1351
  const { ref: occlusionRef, ready } = native_view_occlusion_useNativeViewOcclusion();
1352
+ const composedRef = useComposedRefs(ref, occlusionRef);
1351
1353
  return /*#__PURE__*/ __rspack_external_react.createElement(__rspack_external__radix_ui_react_select_4606f4d3.Portal, null, /*#__PURE__*/ __rspack_external_react.createElement(__rspack_external__radix_ui_react_select_4606f4d3.Content, {
1352
- ref: composeRefs(ref, occlusionRef),
1354
+ ref: composedRef,
1353
1355
  className: utils_cn('bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-(--z-popover) max-h-[--radix-select-content-available-height] min-w-[8rem] overflow-x-hidden overflow-y-auto rounded-lg shadow-sm data-[side=bottom]:origin-top data-[side=left]:origin-right data-[side=right]:origin-left data-[side=top]:origin-bottom', 'popper' === position && 'data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1', !ready && 'invisible', className),
1354
1356
  position: position,
1355
1357
  ...props
package/dist/ui.js CHANGED
@@ -4,7 +4,7 @@ import { twMerge } from "tailwind-merge";
4
4
  import { Slot } from "@radix-ui/react-slot";
5
5
  import { Check, CheckIcon, ChevronDown, ChevronUp, Circle, CopyIcon, GripVertical, X, XIcon } from "lucide-react";
6
6
  import { Highlight, themes } from "prism-react-renderer";
7
- import { composeRefs } from "@radix-ui/react-compose-refs";
7
+ import { useComposedRefs } from "@radix-ui/react-compose-refs";
8
8
  import { useCallback, useEffect, useRef } from "react";
9
9
  import { Group, Panel, Separator as external_react_resizable_panels_Separator } from "react-resizable-panels";
10
10
  import * as __rspack_external_react from "react";
@@ -808,6 +808,7 @@ DialogContentPrimitive.displayName = __rspack_external__radix_ui_react_dialog_da
808
808
  function DialogContent({ className, children, ref, container, hideCloseButton, onOpenAutoFocus, onEscapeKeyDown, ...props }) {
809
809
  const { ref: occlusionRef, ready } = useNativeViewOcclusion();
810
810
  const contentRef = __rspack_external_react.useRef(null);
811
+ const composedContentRef = useComposedRefs(ref, contentRef);
811
812
  const closeButtonRef = __rspack_external_react.useRef(null);
812
813
  const shouldFocusWhenReadyRef = __rspack_external_react.useRef(false);
813
814
  const handleOpenAutoFocus = __rspack_external_react.useCallback((event)=>{
@@ -852,7 +853,7 @@ function DialogContent({ className, children, ref, container, hideCloseButton, o
852
853
  bottom: 'var(--chat-input-offset, 0px)'
853
854
  } : void 0
854
855
  }, /*#__PURE__*/ __rspack_external_react.createElement(DialogContentPrimitive, {
855
- ref: composeRefs(ref, contentRef),
856
+ ref: composedContentRef,
856
857
  className: cn('bg-surface-level-1 pointer-events-auto relative grid max-h-full w-full max-w-lg min-w-0 gap-4 overflow-auto rounded-3xl border p-8 break-words shadow-lg', className),
857
858
  ...container ? {
858
859
  onInteractOutside: (e)=>{
@@ -1725,8 +1726,9 @@ function SelectScrollDownButton({ className, ref, ...props }) {
1725
1726
  SelectScrollDownButton.displayName = __rspack_external__radix_ui_react_select_4606f4d3.ScrollDownButton.displayName;
1726
1727
  function SelectContent({ className, children, position = 'popper', ref, ...props }) {
1727
1728
  const { ref: occlusionRef, ready } = useNativeViewOcclusion();
1729
+ const composedRef = useComposedRefs(ref, occlusionRef);
1728
1730
  return /*#__PURE__*/ __rspack_external_react.createElement(__rspack_external__radix_ui_react_select_4606f4d3.Portal, null, /*#__PURE__*/ __rspack_external_react.createElement(__rspack_external__radix_ui_react_select_4606f4d3.Content, {
1729
- ref: composeRefs(ref, occlusionRef),
1731
+ ref: composedRef,
1730
1732
  className: cn('bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-(--z-popover) max-h-[--radix-select-content-available-height] min-w-[8rem] overflow-x-hidden overflow-y-auto rounded-lg shadow-sm data-[side=bottom]:origin-top data-[side=left]:origin-right data-[side=right]:origin-left data-[side=top]:origin-bottom', 'popper' === position && 'data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1', !ready && 'invisible', className),
1731
1733
  position: position,
1732
1734
  ...props
package/dist/web.d.ts CHANGED
@@ -239,10 +239,17 @@ declare type MiniAppHttpRequestInput = {
239
239
 
240
240
  declare type MiniAppHttpRequestOptions = {
241
241
  /**
242
- * Opaque host-managed credential reference. Secret material never enters
243
- * miniapp JavaScript.
242
+ * Opaque host-managed credential reference, or the reserved
243
+ * `platform-session` reference for the active TAP account. Secret material
244
+ * never enters miniapp JavaScript.
244
245
  */
245
246
  credentialRef?: string;
247
+ /**
248
+ * Requests one host-managed integration credential. The host attaches it
249
+ * only after the package declares and receives the corresponding credential
250
+ * permission; secret material never enters miniapp JavaScript.
251
+ */
252
+ auth?: 'github';
246
253
  };
247
254
 
248
255
  declare type MiniAppHttpResponse = {
@@ -335,8 +342,6 @@ export declare type MiniAppPlatformApi = {
335
342
  create(options: CreateChannelOptions): CreateChannelResult | Promise<CreateChannelResult>;
336
343
  list(options?: ListChannelsOptions): ListChannelsResult | Promise<ListChannelsResult>;
337
344
  sendMessage(options: SendChannelMessageOptions): SendChannelMessageResult | Promise<SendChannelMessageResult>;
338
- /** Persist one deterministic completed row under a joined specialist. */
339
- sendSpecialistMessage(options: SendChannelSpecialistMessageOptions): SendChannelSpecialistMessageResult | Promise<SendChannelSpecialistMessageResult>;
340
345
  getAccess(options: GetChannelAccessOptions): GetChannelAccessResult | Promise<GetChannelAccessResult>;
341
346
  getTimeline(options: GetChannelTimelineOptions): GetChannelTimelineResult | Promise<GetChannelTimelineResult>;
342
347
  };
@@ -362,6 +367,8 @@ export declare type MiniAppPlatformApi = {
362
367
  credentials?: MiniAppCredentialsApi;
363
368
  /** Desktop host capability; feature-detect before use on portable targets. */
364
369
  printing?: MiniAppReceiptPrintingApi;
370
+ /** Desktop host capability; feature-detect before opening a terminal. */
371
+ terminal?: MiniAppTerminalApi;
365
372
  /** Browser capabilities appear only when the selected target supports them. */
366
373
  auth?: MiniAppAuthApi;
367
374
  vfs?: MiniAppVfsApi;
@@ -417,7 +424,8 @@ declare type MiniAppProject = {
417
424
  declare type MiniAppProvisionProjectChatOptions = {
418
425
  conversationId: string;
419
426
  projectId: string;
420
- referenceBranch?: string | null;
427
+ baseBranch?: string | null;
428
+ workingBranch?: string | null;
421
429
  };
422
430
 
423
431
  declare type MiniAppProvisionProjectChatResult = {
@@ -453,24 +461,51 @@ declare type MiniAppReceiptLine = {
453
461
  kind: 'blank';
454
462
  };
455
463
 
456
- /** Abstract machine-local printer readiness; destination identity stays host-only. */
464
+ /** Host rendering capabilities for one supported receipt paper width. */
465
+ declare type MiniAppReceiptPaperProfile = {
466
+ id: MiniAppReceiptPrinterProfile;
467
+ widthMm: 58 | 80;
468
+ columns: 32 | 48;
469
+ };
470
+
471
+ /** Bounded metadata for one machine-local printer visible to an authorized miniapp. */
472
+ declare type MiniAppReceiptPrinter = {
473
+ name: string;
474
+ isDefault: boolean;
475
+ };
476
+
477
+ declare type MiniAppReceiptPrinterDiscovery = {
478
+ printers: MiniAppReceiptPrinter[];
479
+ paperProfiles: MiniAppReceiptPaperProfile[];
480
+ };
481
+
482
+ declare type MiniAppReceiptPrinterProfile = 'receipt-58mm' | 'receipt-80mm';
483
+
484
+ /** Miniapp-owned selection passed explicitly to status and submission calls. */
485
+ declare type MiniAppReceiptPrinterSelection = {
486
+ printerName: string;
487
+ profile: MiniAppReceiptPrinterProfile;
488
+ };
489
+
490
+ /** Readiness for an exact machine-local printer selection. */
457
491
  declare type MiniAppReceiptPrinterStatus = {
458
- availability: 'unconfigured' | 'ready' | 'unavailable';
459
- profile: 'receipt-58mm' | 'receipt-80mm' | null;
492
+ availability: 'ready' | 'unavailable';
460
493
  };
461
494
 
462
- /** Desktop-only silent receipt output through the host-configured OS spooler. */
495
+ /** Desktop-only silent receipt output through a discovered OS spooler. */
463
496
  declare type MiniAppReceiptPrintingApi = {
464
- getStatus(): MiniAppMaybePromise<MiniAppReceiptPrinterStatus>;
497
+ listPrinters(): MiniAppMaybePromise<MiniAppReceiptPrinterDiscovery>;
498
+ getStatus(selection: MiniAppReceiptPrinterSelection): MiniAppMaybePromise<MiniAppReceiptPrinterStatus>;
465
499
  submit(options: MiniAppReceiptPrintOptions): MiniAppMaybePromise<MiniAppReceiptPrintResult>;
466
500
  };
467
501
 
468
502
  declare type MiniAppReceiptPrintOptions = {
469
503
  /**
470
504
  * Stable caller key, capped at 128 characters. The host journals it within
471
- * installation, workspace, and configured-destination scope.
505
+ * installation, workspace, and selected-destination scope.
472
506
  */
473
507
  jobKey: string;
508
+ selection: MiniAppReceiptPrinterSelection;
474
509
  document: MiniAppReceiptDocument;
475
510
  };
476
511
 
@@ -599,6 +634,76 @@ declare type MiniAppStorageSetOptions = MiniAppStorageAddress & {
599
634
  expectedRevision: number | null;
600
635
  };
601
636
 
637
+ declare type MiniAppTerminalApi = {
638
+ readonly v1: MiniAppTerminalV1Api;
639
+ };
640
+
641
+ /** Versioned, desktop-only host terminal capability. */
642
+ declare type MiniAppTerminalV1Api = {
643
+ getCapabilities(): Promise<MiniAppTerminalV1Capabilities>;
644
+ open(options: MiniAppTerminalV1OpenOptions): Promise<MiniAppTerminalV1Session>;
645
+ };
646
+
647
+ declare type MiniAppTerminalV1Capabilities = {
648
+ profiles: MiniAppTerminalV1Profile[];
649
+ limits: MiniAppTerminalV1Limits;
650
+ };
651
+
652
+ declare type MiniAppTerminalV1DataEvent = {
653
+ type: 'data';
654
+ sequence: number;
655
+ data: Uint8Array;
656
+ };
657
+
658
+ declare type MiniAppTerminalV1Event = MiniAppTerminalV1DataEvent | MiniAppTerminalV1ExitEvent;
659
+
660
+ declare type MiniAppTerminalV1ExitEvent = {
661
+ type: 'exit';
662
+ sequence: number;
663
+ code: number | null;
664
+ signal: string | null;
665
+ reason: 'exited' | 'closed' | 'revoked' | 'error';
666
+ };
667
+
668
+ declare type MiniAppTerminalV1Limits = {
669
+ maxSessionsPerDocument: number;
670
+ maxWriteBytes: number;
671
+ maxOutputBytesInFlight: number;
672
+ maxCols: number;
673
+ maxRows: number;
674
+ };
675
+
676
+ declare type MiniAppTerminalV1OpenOptions = {
677
+ profile: MiniAppTerminalV1ProfileId;
678
+ cols: number;
679
+ rows: number;
680
+ };
681
+
682
+ declare type MiniAppTerminalV1Profile = {
683
+ id: MiniAppTerminalV1ProfileId;
684
+ available: boolean;
685
+ unavailableReason: string | null;
686
+ };
687
+
688
+ /** Host-owned terminal runtime profiles exposed by `sdk.terminal.v1`. */
689
+ declare type MiniAppTerminalV1ProfileId = 'workspace-shell' | 'neovim';
690
+
691
+ declare type MiniAppTerminalV1ResizeOptions = {
692
+ cols: number;
693
+ rows: number;
694
+ };
695
+
696
+ declare type MiniAppTerminalV1Session = {
697
+ /** Opaque host-minted session identity; it carries no ambient authority. */
698
+ readonly id: string;
699
+ readonly profile: MiniAppTerminalV1ProfileId;
700
+ /** Ordered output with byte-sized backpressure owned by the host session. */
701
+ readonly events: ReadableStream<MiniAppTerminalV1Event>;
702
+ write(data: Uint8Array): Promise<void>;
703
+ resize(options: MiniAppTerminalV1ResizeOptions): Promise<void>;
704
+ close(): Promise<void>;
705
+ };
706
+
602
707
  export declare type MiniAppTheme = 'light' | 'dark';
603
708
 
604
709
  export declare type MiniAppUiScale = number;
@@ -684,21 +789,6 @@ declare type SendChannelMessageResult = {
684
789
  clientMessageId: string;
685
790
  };
686
791
 
687
- declare type SendChannelSpecialistMessageOptions = {
688
- workspaceId?: string;
689
- channelId: string;
690
- projectId: string;
691
- specialistId: string;
692
- clientMessageId: string;
693
- body: string;
694
- messageContent?: Record<string, MiniAppJsonValue>;
695
- };
696
-
697
- declare type SendChannelSpecialistMessageResult = {
698
- messageId: string;
699
- clientMessageId: string;
700
- };
701
-
702
792
  export declare type SpecialistEvent = SpecialistTurnCompletedEvent | SpecialistTurnErrorEvent;
703
793
 
704
794
  export declare type SpecialistTurnCompletedEvent = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theaiplatform/miniapp-sdk",
3
- "version": "0.2.2",
3
+ "version": "0.3.0",
4
4
  "description": "Public SDK for building portable miniapps that run in The AI Platform.",
5
5
  "type": "module",
6
6
  "engines": {
@@ -177,23 +177,23 @@
177
177
  "typescript": "catalog:typescript"
178
178
  },
179
179
  "dependencies": {
180
- "@radix-ui/react-alert-dialog": "^1.1.15",
181
- "@radix-ui/react-avatar": "1.1.11",
182
- "@radix-ui/react-checkbox": "^1.3.3",
183
- "@radix-ui/react-compose-refs": "^1.1.2",
184
- "@radix-ui/react-dialog": "^1.1.15",
185
- "@radix-ui/react-label": "^2.1.8",
186
- "@radix-ui/react-progress": "^1.1.8",
187
- "@radix-ui/react-radio-group": "^1.3.8",
188
- "@radix-ui/react-scroll-area": "^1.2.10",
189
- "@radix-ui/react-select": "^2.2.6",
190
- "@radix-ui/react-separator": "^1.1.8",
191
- "@radix-ui/react-slider": "^1.3.6",
192
- "@radix-ui/react-slot": "^1.2.4",
193
- "@radix-ui/react-tabs": "^1.1.13",
194
- "@radix-ui/react-toggle": "^1.1.10",
195
- "@radix-ui/react-toggle-group": "^1.1.11",
196
- "@radix-ui/react-tooltip": "^1.2.8",
180
+ "@radix-ui/react-alert-dialog": "^1.1.20",
181
+ "@radix-ui/react-avatar": "1.2.3",
182
+ "@radix-ui/react-checkbox": "^1.3.8",
183
+ "@radix-ui/react-compose-refs": "^1.1.3",
184
+ "@radix-ui/react-dialog": "^1.1.20",
185
+ "@radix-ui/react-label": "^2.1.12",
186
+ "@radix-ui/react-progress": "^1.1.13",
187
+ "@radix-ui/react-radio-group": "^1.4.4",
188
+ "@radix-ui/react-scroll-area": "^1.2.15",
189
+ "@radix-ui/react-select": "^2.3.4",
190
+ "@radix-ui/react-separator": "^1.1.12",
191
+ "@radix-ui/react-slider": "^1.4.4",
192
+ "@radix-ui/react-slot": "^1.3.0",
193
+ "@radix-ui/react-tabs": "^1.1.18",
194
+ "@radix-ui/react-toggle": "^1.1.15",
195
+ "@radix-ui/react-toggle-group": "^1.1.16",
196
+ "@radix-ui/react-tooltip": "^1.2.13",
197
197
  "ajv": "^8.20.0",
198
198
  "class-variance-authority": "^0.7.1",
199
199
  "clsx": "^2.1.1",