@theaiplatform/miniapp-sdk 0.2.2 → 0.2.4

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 CHANGED
@@ -40,14 +40,17 @@ requests through host consent instead of browser `fetch`, and
40
40
  secrets remain in the host vault and are injected only by the native request
41
41
  authority.
42
42
 
43
- `sdk.printing` is an optional desktop-only receipt printer API. It accepts only
44
- bounded semantic version-1 receipt rows with printable ASCII text and a stable job key; the host chooses
45
- the machine-local printer/profile and owns wrapping, feed, cut, and OS spooler
46
- submission. Packages must declare the exact descriptor effect
43
+ `sdk.printing` is an optional desktop-only receipt printer API. It discovers
44
+ bounded machine-local printer metadata and host-supported 58 mm and 80 mm paper
45
+ profiles, then accepts only bounded semantic version-1 receipt rows with
46
+ printable ASCII text and a stable job key. The miniapp passes its exact
47
+ printer/profile selection to status and submission; the host revalidates that
48
+ destination and owns wrapping, feed, cut, and OS spooler submission. Packages
49
+ must declare the exact descriptor effect
47
50
  `{ "kind": "physical-output", "resources": ["receipt-printer"] }` and a
48
51
  persisted `printing.receipt` action with reusable consent, `do` autonomy, and
49
- consequential risk. Printer identity, raw ESC/POS, direct USB/network access,
50
- and `window.print()` are not SDK capabilities. Job-key journaling suppresses
52
+ consequential risk. Raw ESC/POS, direct USB/network access, and `window.print()`
53
+ are not SDK capabilities. Job-key journaling suppresses
51
54
  routine reconnect duplicates, but physical exactly-once printing is impossible;
52
55
  every result therefore carries `physicalExactlyOnce: false`.
53
56
 
@@ -9,30 +9,30 @@ distributed as source. Optional peer dependencies are not distributed with
9
9
  this package and remain subject to their own licenses.
10
10
 
11
11
  The inventory below records the direct and transitive runtime dependency
12
- versions resolved by the release workspace lockfile on July 18, 2026. A
12
+ versions resolved by the release workspace lockfile on July 22, 2026. A
13
13
  downstream application may resolve a different compatible transitive version
14
14
  and is responsible for reviewing the notices required by its own lockfile and
15
15
  distribution artifact.
16
16
 
17
17
  | Relationship | Package | Version | License |
18
18
  | ---------------- | ------------------------------ | ------: | ------------ |
19
- | Direct UI | `@radix-ui/react-alert-dialog` | 1.1.15 | MIT |
20
- | Direct UI | `@radix-ui/react-avatar` | 1.1.11 | MIT |
21
- | Direct UI | `@radix-ui/react-checkbox` | 1.3.3 | MIT |
22
- | Direct UI | `@radix-ui/react-compose-refs` | 1.1.2 | MIT |
23
- | Direct UI | `@radix-ui/react-dialog` | 1.1.15 | MIT |
24
- | Direct UI | `@radix-ui/react-label` | 2.1.8 | MIT |
25
- | Direct UI | `@radix-ui/react-progress` | 1.1.8 | MIT |
26
- | Direct UI | `@radix-ui/react-radio-group` | 1.3.8 | MIT |
27
- | Direct UI | `@radix-ui/react-scroll-area` | 1.2.10 | MIT |
28
- | Direct UI | `@radix-ui/react-select` | 2.2.6 | MIT |
29
- | Direct UI | `@radix-ui/react-separator` | 1.1.8 | MIT |
30
- | Direct UI | `@radix-ui/react-slider` | 1.3.6 | MIT |
31
- | Direct UI | `@radix-ui/react-slot` | 1.2.4 | MIT |
32
- | Direct UI | `@radix-ui/react-tabs` | 1.1.13 | MIT |
33
- | Direct UI | `@radix-ui/react-toggle` | 1.1.10 | MIT |
34
- | Direct UI | `@radix-ui/react-toggle-group` | 1.1.11 | MIT |
35
- | Direct UI | `@radix-ui/react-tooltip` | 1.2.8 | MIT |
19
+ | Direct UI | `@radix-ui/react-alert-dialog` | 1.1.20 | MIT |
20
+ | Direct UI | `@radix-ui/react-avatar` | 1.2.3 | MIT |
21
+ | Direct UI | `@radix-ui/react-checkbox` | 1.3.8 | MIT |
22
+ | Direct UI | `@radix-ui/react-compose-refs` | 1.1.3 | MIT |
23
+ | Direct UI | `@radix-ui/react-dialog` | 1.1.20 | MIT |
24
+ | Direct UI | `@radix-ui/react-label` | 2.1.12 | MIT |
25
+ | Direct UI | `@radix-ui/react-progress` | 1.1.13 | MIT |
26
+ | Direct UI | `@radix-ui/react-radio-group` | 1.4.4 | MIT |
27
+ | Direct UI | `@radix-ui/react-scroll-area` | 1.2.15 | MIT |
28
+ | Direct UI | `@radix-ui/react-select` | 2.3.4 | MIT |
29
+ | Direct UI | `@radix-ui/react-separator` | 1.1.12 | MIT |
30
+ | Direct UI | `@radix-ui/react-slider` | 1.4.4 | MIT |
31
+ | Direct UI | `@radix-ui/react-slot` | 1.3.0 | MIT |
32
+ | Direct UI | `@radix-ui/react-tabs` | 1.1.18 | MIT |
33
+ | Direct UI | `@radix-ui/react-toggle` | 1.1.15 | MIT |
34
+ | Direct UI | `@radix-ui/react-toggle-group` | 1.1.16 | MIT |
35
+ | Direct UI | `@radix-ui/react-tooltip` | 1.2.13 | MIT |
36
36
  | Direct UI | `class-variance-authority` | 0.7.1 | Apache-2.0 |
37
37
  | Direct UI | `clsx` | 2.1.1 | MIT |
38
38
  | Direct UI | `lucide-react` | 1.20.0 | ISC |
package/dist/index.d.ts CHANGED
@@ -230,10 +230,17 @@ export declare type MiniAppHttpRequestInput = {
230
230
 
231
231
  export declare type MiniAppHttpRequestOptions = {
232
232
  /**
233
- * Opaque host-managed credential reference. Secret material never enters
234
- * miniapp JavaScript.
233
+ * Opaque host-managed credential reference, or the reserved
234
+ * `platform-session` reference for the active TAP account. Secret material
235
+ * never enters miniapp JavaScript.
235
236
  */
236
237
  credentialRef?: string;
238
+ /**
239
+ * Requests one host-managed integration credential. The host attaches it
240
+ * only after the package declares and receives the corresponding credential
241
+ * permission; secret material never enters miniapp JavaScript.
242
+ */
243
+ auth?: 'github';
237
244
  };
238
245
 
239
246
  export declare type MiniAppHttpResponse = {
@@ -323,8 +330,6 @@ export declare type MiniAppPlatformApi = {
323
330
  create(options: CreateChannelOptions): CreateChannelResult | Promise<CreateChannelResult>;
324
331
  list(options?: ListChannelsOptions): ListChannelsResult | Promise<ListChannelsResult>;
325
332
  sendMessage(options: SendChannelMessageOptions): SendChannelMessageResult | Promise<SendChannelMessageResult>;
326
- /** Persist one deterministic completed row under a joined specialist. */
327
- sendSpecialistMessage(options: SendChannelSpecialistMessageOptions): SendChannelSpecialistMessageResult | Promise<SendChannelSpecialistMessageResult>;
328
333
  getAccess(options: GetChannelAccessOptions): GetChannelAccessResult | Promise<GetChannelAccessResult>;
329
334
  getTimeline(options: GetChannelTimelineOptions): GetChannelTimelineResult | Promise<GetChannelTimelineResult>;
330
335
  };
@@ -405,7 +410,8 @@ export declare type MiniAppProject = {
405
410
  export declare type MiniAppProvisionProjectChatOptions = {
406
411
  conversationId: string;
407
412
  projectId: string;
408
- referenceBranch?: string | null;
413
+ baseBranch?: string | null;
414
+ workingBranch?: string | null;
409
415
  };
410
416
 
411
417
  export declare type MiniAppProvisionProjectChatResult = {
@@ -441,24 +447,51 @@ export declare type MiniAppReceiptLine = {
441
447
  kind: 'blank';
442
448
  };
443
449
 
444
- /** Abstract machine-local printer readiness; destination identity stays host-only. */
450
+ /** Host rendering capabilities for one supported receipt paper width. */
451
+ export declare type MiniAppReceiptPaperProfile = {
452
+ id: MiniAppReceiptPrinterProfile;
453
+ widthMm: 58 | 80;
454
+ columns: 32 | 48;
455
+ };
456
+
457
+ /** Bounded metadata for one machine-local printer visible to an authorized miniapp. */
458
+ export declare type MiniAppReceiptPrinter = {
459
+ name: string;
460
+ isDefault: boolean;
461
+ };
462
+
463
+ export declare type MiniAppReceiptPrinterDiscovery = {
464
+ printers: MiniAppReceiptPrinter[];
465
+ paperProfiles: MiniAppReceiptPaperProfile[];
466
+ };
467
+
468
+ export declare type MiniAppReceiptPrinterProfile = 'receipt-58mm' | 'receipt-80mm';
469
+
470
+ /** Miniapp-owned selection passed explicitly to status and submission calls. */
471
+ export declare type MiniAppReceiptPrinterSelection = {
472
+ printerName: string;
473
+ profile: MiniAppReceiptPrinterProfile;
474
+ };
475
+
476
+ /** Readiness for an exact machine-local printer selection. */
445
477
  export declare type MiniAppReceiptPrinterStatus = {
446
- availability: 'unconfigured' | 'ready' | 'unavailable';
447
- profile: 'receipt-58mm' | 'receipt-80mm' | null;
478
+ availability: 'ready' | 'unavailable';
448
479
  };
449
480
 
450
- /** Desktop-only silent receipt output through the host-configured OS spooler. */
481
+ /** Desktop-only silent receipt output through a discovered OS spooler. */
451
482
  export declare type MiniAppReceiptPrintingApi = {
452
- getStatus(): MiniAppMaybePromise<MiniAppReceiptPrinterStatus>;
483
+ listPrinters(): MiniAppMaybePromise<MiniAppReceiptPrinterDiscovery>;
484
+ getStatus(selection: MiniAppReceiptPrinterSelection): MiniAppMaybePromise<MiniAppReceiptPrinterStatus>;
453
485
  submit(options: MiniAppReceiptPrintOptions): MiniAppMaybePromise<MiniAppReceiptPrintResult>;
454
486
  };
455
487
 
456
488
  export declare type MiniAppReceiptPrintOptions = {
457
489
  /**
458
490
  * Stable caller key, capped at 128 characters. The host journals it within
459
- * installation, workspace, and configured-destination scope.
491
+ * installation, workspace, and selected-destination scope.
460
492
  */
461
493
  jobKey: string;
494
+ selection: MiniAppReceiptPrinterSelection;
462
495
  document: MiniAppReceiptDocument;
463
496
  };
464
497
 
@@ -656,21 +689,6 @@ export declare type SendChannelMessageResult = {
656
689
  clientMessageId: string;
657
690
  };
658
691
 
659
- export declare type SendChannelSpecialistMessageOptions = {
660
- workspaceId?: string;
661
- channelId: string;
662
- projectId: string;
663
- specialistId: string;
664
- clientMessageId: string;
665
- body: string;
666
- messageContent?: Record<string, MiniAppJsonValue>;
667
- };
668
-
669
- export declare type SendChannelSpecialistMessageResult = {
670
- messageId: string;
671
- clientMessageId: string;
672
- };
673
-
674
692
  export declare type ToolDefinition<TArguments = unknown, TResult = unknown> = {
675
693
  displayName?: string;
676
694
  description: string;
@@ -458,6 +458,7 @@ const MAX_HTTP_REQUEST_JSON_BYTES = 11 * 1024 * 1024;
458
458
  const MAX_HTTP_URL_CHARS = 64 * 1024;
459
459
  const MAX_CREDENTIAL_REFERENCE_CHARS = 512;
460
460
  const MAX_RECEIPT_JOB_KEY_CHARS = 128;
461
+ const MAX_RECEIPT_PRINTER_NAME_CHARS = 512;
461
462
  const MAX_RECEIPT_LINES = 200;
462
463
  const MAX_RECEIPT_LINE_CHARS = 512;
463
464
  const MAX_RECEIPT_TOTAL_CHARS = 32768;
@@ -782,6 +783,12 @@ const http = Object.freeze({
782
783
  !validPlatformPartition(options.credentialRef, MAX_CREDENTIAL_REFERENCE_CHARS)) {
783
784
  throw new Error('app.http.request credentialRef is invalid.');
784
785
  }
786
+ if (options.auth !== undefined && options.auth !== 'github') {
787
+ throw new Error('app.http.request auth is invalid.');
788
+ }
789
+ if (options.credentialRef !== undefined && options.auth !== undefined) {
790
+ throw new Error('app.http.request accepts either credentialRef or auth, not both.');
791
+ }
785
792
  return invokeSdkHostAction(
786
793
  'tap.platform.http.request',
787
794
  {
@@ -789,6 +796,7 @@ const http = Object.freeze({
789
796
  ...(options.credentialRef === undefined
790
797
  ? {}
791
798
  : { credentialRef: options.credentialRef }),
799
+ ...(options.auth === undefined ? {} : { auth: options.auth }),
792
800
  },
793
801
  'app.http.request',
794
802
  null,
@@ -873,31 +881,78 @@ const checkedReceiptDocument = (document) => {
873
881
  }
874
882
  return document;
875
883
  };
884
+ const checkedPrinterSelection = (selection, operation) => {
885
+ requireOptionsObject(selection, operation + ' selection');
886
+ if (Object.keys(selection).some((key) => !new Set(['printerName', 'profile']).has(key)) ||
887
+ !validPlatformPartition(selection.printerName, MAX_RECEIPT_PRINTER_NAME_CHARS) ||
888
+ !new Set(['receipt-58mm', 'receipt-80mm']).has(selection.profile)) {
889
+ throw new Error(operation + ' selection is invalid.');
890
+ }
891
+ return selection;
892
+ };
876
893
  const printing = Object.freeze({
877
- getStatus() {
894
+ listPrinters() {
878
895
  return invokeSdkHostAction(
879
- 'tap.platform.printing.receipt.status',
896
+ 'tap.platform.printing.receipt.v2.list-printers',
880
897
  {},
898
+ 'app.printing.listPrinters',
899
+ 30000,
900
+ ).then((value) => {
901
+ if (!value || typeof value !== 'object' || Array.isArray(value) ||
902
+ !Array.isArray(value.printers) || !Array.isArray(value.paperProfiles)) {
903
+ throw new Error('app.printing.listPrinters returned an invalid result.');
904
+ }
905
+ const printers = value.printers.map((printer) => {
906
+ if (!printer || typeof printer !== 'object' || Array.isArray(printer) ||
907
+ Object.keys(printer).some((key) => !new Set(['name', 'isDefault']).has(key)) ||
908
+ !validPlatformPartition(printer.name, MAX_RECEIPT_PRINTER_NAME_CHARS) ||
909
+ typeof printer.isDefault !== 'boolean') {
910
+ throw new Error('app.printing.listPrinters returned an invalid printer.');
911
+ }
912
+ return projectResultFields(printer, ['name', 'isDefault'], 'app.printing.listPrinters');
913
+ });
914
+ const paperProfiles = value.paperProfiles.map((profile) => {
915
+ const expected = profile?.id === 'receipt-58mm' ? [58, 32]
916
+ : profile?.id === 'receipt-80mm' ? [80, 48] : null;
917
+ if (!profile || typeof profile !== 'object' || Array.isArray(profile) || !expected ||
918
+ Object.keys(profile).some((key) => !new Set(['id', 'widthMm', 'columns']).has(key)) ||
919
+ profile.widthMm !== expected[0] || profile.columns !== expected[1]) {
920
+ throw new Error('app.printing.listPrinters returned an invalid paper profile.');
921
+ }
922
+ return projectResultFields(
923
+ profile,
924
+ ['id', 'widthMm', 'columns'],
925
+ 'app.printing.listPrinters',
926
+ );
927
+ });
928
+ return { printers, paperProfiles };
929
+ });
930
+ },
931
+ getStatus(selection) {
932
+ checkedPrinterSelection(selection, 'app.printing.getStatus');
933
+ return invokeSdkHostAction(
934
+ 'tap.platform.printing.receipt.v2.status',
935
+ selection,
881
936
  'app.printing.getStatus',
882
937
  30000,
883
938
  ).then((value) => {
884
939
  if (!value || typeof value !== 'object' || Array.isArray(value) ||
885
- !new Set(['unconfigured', 'ready', 'unavailable']).has(value.availability) ||
886
- !new Set([null, 'receipt-58mm', 'receipt-80mm']).has(value.profile)) {
940
+ !new Set(['ready', 'unavailable']).has(value.availability)) {
887
941
  throw new Error('app.printing.getStatus returned an invalid result.');
888
942
  }
889
- return projectResultFields(value, ['availability', 'profile'], 'app.printing.getStatus');
943
+ return projectResultFields(value, ['availability'], 'app.printing.getStatus');
890
944
  });
891
945
  },
892
946
  submit(options) {
893
947
  requireOptionsObject(options, 'app.printing.submit');
894
- if (Object.keys(options).some((key) => !new Set(['jobKey', 'document']).has(key)) ||
948
+ if (Object.keys(options).some((key) => !new Set(['jobKey', 'selection', 'document']).has(key)) ||
895
949
  !validPlatformPartition(options.jobKey, MAX_RECEIPT_JOB_KEY_CHARS)) {
896
950
  throw new Error('app.printing.submit jobKey is invalid.');
897
951
  }
952
+ checkedPrinterSelection(options.selection, 'app.printing.submit');
898
953
  checkedReceiptDocument(options.document);
899
954
  return invokeSdkHostAction(
900
- 'tap.platform.printing.receipt.submit',
955
+ 'tap.platform.printing.receipt.v2.submit',
901
956
  options,
902
957
  'app.printing.submit',
903
958
  // Physical output cannot be cancelled when an SDK timer expires. Keep
@@ -930,33 +985,6 @@ const channels = Object.freeze({
930
985
  requireOptionString(options?.content, 'app.channels.sendMessage content');
931
986
  return invokeSdkHostAction('sendChannelMessage', options, 'app.channels.sendMessage');
932
987
  },
933
- sendSpecialistMessage(options) {
934
- requireOptionString(
935
- options?.channelId,
936
- 'app.channels.sendSpecialistMessage channelId',
937
- );
938
- requireOptionString(
939
- options?.specialistId,
940
- 'app.channels.sendSpecialistMessage specialistId',
941
- );
942
- requireOptionString(
943
- options?.projectId,
944
- 'app.channels.sendSpecialistMessage projectId',
945
- );
946
- requireOptionString(
947
- options?.clientMessageId,
948
- 'app.channels.sendSpecialistMessage clientMessageId',
949
- );
950
- requireOptionString(
951
- options?.body,
952
- 'app.channels.sendSpecialistMessage body',
953
- );
954
- return invokeSdkHostAction(
955
- 'sendSpecialistChannelMessage',
956
- options,
957
- 'app.channels.sendSpecialistMessage',
958
- );
959
- },
960
988
  getAccess(options) {
961
989
  requireOptionString(options?.channelId, 'app.channels.getAccess channelId');
962
990
  return invokeSdkHostAction('getChannelAccess', options, 'app.channels.getAccess');
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
  };
@@ -376,7 +381,8 @@ export declare type MiniAppProject = {
376
381
  export declare type MiniAppProvisionProjectChatOptions = {
377
382
  conversationId: string;
378
383
  projectId: string;
379
- referenceBranch?: string | null;
384
+ baseBranch?: string | null;
385
+ workingBranch?: string | null;
380
386
  };
381
387
 
382
388
  export declare type MiniAppProvisionProjectChatResult = {
@@ -412,24 +418,51 @@ export declare type MiniAppReceiptLine = {
412
418
  kind: 'blank';
413
419
  };
414
420
 
415
- /** Abstract machine-local printer readiness; destination identity stays host-only. */
421
+ /** Host rendering capabilities for one supported receipt paper width. */
422
+ export declare type MiniAppReceiptPaperProfile = {
423
+ id: MiniAppReceiptPrinterProfile;
424
+ widthMm: 58 | 80;
425
+ columns: 32 | 48;
426
+ };
427
+
428
+ /** Bounded metadata for one machine-local printer visible to an authorized miniapp. */
429
+ export declare type MiniAppReceiptPrinter = {
430
+ name: string;
431
+ isDefault: boolean;
432
+ };
433
+
434
+ export declare type MiniAppReceiptPrinterDiscovery = {
435
+ printers: MiniAppReceiptPrinter[];
436
+ paperProfiles: MiniAppReceiptPaperProfile[];
437
+ };
438
+
439
+ export declare type MiniAppReceiptPrinterProfile = 'receipt-58mm' | 'receipt-80mm';
440
+
441
+ /** Miniapp-owned selection passed explicitly to status and submission calls. */
442
+ export declare type MiniAppReceiptPrinterSelection = {
443
+ printerName: string;
444
+ profile: MiniAppReceiptPrinterProfile;
445
+ };
446
+
447
+ /** Readiness for an exact machine-local printer selection. */
416
448
  export declare type MiniAppReceiptPrinterStatus = {
417
- availability: 'unconfigured' | 'ready' | 'unavailable';
418
- profile: 'receipt-58mm' | 'receipt-80mm' | null;
449
+ availability: 'ready' | 'unavailable';
419
450
  };
420
451
 
421
- /** Desktop-only silent receipt output through the host-configured OS spooler. */
452
+ /** Desktop-only silent receipt output through a discovered OS spooler. */
422
453
  export declare type MiniAppReceiptPrintingApi = {
423
- getStatus(): MiniAppMaybePromise<MiniAppReceiptPrinterStatus>;
454
+ listPrinters(): MiniAppMaybePromise<MiniAppReceiptPrinterDiscovery>;
455
+ getStatus(selection: MiniAppReceiptPrinterSelection): MiniAppMaybePromise<MiniAppReceiptPrinterStatus>;
424
456
  submit(options: MiniAppReceiptPrintOptions): MiniAppMaybePromise<MiniAppReceiptPrintResult>;
425
457
  };
426
458
 
427
459
  export declare type MiniAppReceiptPrintOptions = {
428
460
  /**
429
461
  * Stable caller key, capped at 128 characters. The host journals it within
430
- * installation, workspace, and configured-destination scope.
462
+ * installation, workspace, and selected-destination scope.
431
463
  */
432
464
  jobKey: string;
465
+ selection: MiniAppReceiptPrinterSelection;
433
466
  document: MiniAppReceiptDocument;
434
467
  };
435
468
 
@@ -627,21 +660,6 @@ export declare type SendChannelMessageResult = {
627
660
  clientMessageId: string;
628
661
  };
629
662
 
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
663
  export declare type UpdateProjectOptions = {
646
664
  workspaceId?: string;
647
665
  projectId: string;
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
  };
@@ -417,7 +422,8 @@ declare type MiniAppProject = {
417
422
  declare type MiniAppProvisionProjectChatOptions = {
418
423
  conversationId: string;
419
424
  projectId: string;
420
- referenceBranch?: string | null;
425
+ baseBranch?: string | null;
426
+ workingBranch?: string | null;
421
427
  };
422
428
 
423
429
  declare type MiniAppProvisionProjectChatResult = {
@@ -453,24 +459,51 @@ declare type MiniAppReceiptLine = {
453
459
  kind: 'blank';
454
460
  };
455
461
 
456
- /** Abstract machine-local printer readiness; destination identity stays host-only. */
462
+ /** Host rendering capabilities for one supported receipt paper width. */
463
+ declare type MiniAppReceiptPaperProfile = {
464
+ id: MiniAppReceiptPrinterProfile;
465
+ widthMm: 58 | 80;
466
+ columns: 32 | 48;
467
+ };
468
+
469
+ /** Bounded metadata for one machine-local printer visible to an authorized miniapp. */
470
+ declare type MiniAppReceiptPrinter = {
471
+ name: string;
472
+ isDefault: boolean;
473
+ };
474
+
475
+ declare type MiniAppReceiptPrinterDiscovery = {
476
+ printers: MiniAppReceiptPrinter[];
477
+ paperProfiles: MiniAppReceiptPaperProfile[];
478
+ };
479
+
480
+ declare type MiniAppReceiptPrinterProfile = 'receipt-58mm' | 'receipt-80mm';
481
+
482
+ /** Miniapp-owned selection passed explicitly to status and submission calls. */
483
+ declare type MiniAppReceiptPrinterSelection = {
484
+ printerName: string;
485
+ profile: MiniAppReceiptPrinterProfile;
486
+ };
487
+
488
+ /** Readiness for an exact machine-local printer selection. */
457
489
  declare type MiniAppReceiptPrinterStatus = {
458
- availability: 'unconfigured' | 'ready' | 'unavailable';
459
- profile: 'receipt-58mm' | 'receipt-80mm' | null;
490
+ availability: 'ready' | 'unavailable';
460
491
  };
461
492
 
462
- /** Desktop-only silent receipt output through the host-configured OS spooler. */
493
+ /** Desktop-only silent receipt output through a discovered OS spooler. */
463
494
  declare type MiniAppReceiptPrintingApi = {
464
- getStatus(): MiniAppMaybePromise<MiniAppReceiptPrinterStatus>;
495
+ listPrinters(): MiniAppMaybePromise<MiniAppReceiptPrinterDiscovery>;
496
+ getStatus(selection: MiniAppReceiptPrinterSelection): MiniAppMaybePromise<MiniAppReceiptPrinterStatus>;
465
497
  submit(options: MiniAppReceiptPrintOptions): MiniAppMaybePromise<MiniAppReceiptPrintResult>;
466
498
  };
467
499
 
468
500
  declare type MiniAppReceiptPrintOptions = {
469
501
  /**
470
502
  * Stable caller key, capped at 128 characters. The host journals it within
471
- * installation, workspace, and configured-destination scope.
503
+ * installation, workspace, and selected-destination scope.
472
504
  */
473
505
  jobKey: string;
506
+ selection: MiniAppReceiptPrinterSelection;
474
507
  document: MiniAppReceiptDocument;
475
508
  };
476
509
 
@@ -684,21 +717,6 @@ declare type SendChannelMessageResult = {
684
717
  clientMessageId: string;
685
718
  };
686
719
 
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
720
  export declare type SpecialistEvent = SpecialistTurnCompletedEvent | SpecialistTurnErrorEvent;
703
721
 
704
722
  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.2.4",
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",