@theaiplatform/miniapp-sdk 0.0.0-main.1 → 0.0.0-oscar-c-miniapp-github-auth.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 CHANGED
@@ -40,6 +40,20 @@ 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 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
50
+ `{ "kind": "physical-output", "resources": ["receipt-printer"] }` and a
51
+ persisted `printing.receipt` action with reusable consent, `do` autonomy, and
52
+ consequential risk. Raw ESC/POS, direct USB/network access, and `window.print()`
53
+ are not SDK capabilities. Job-key journaling suppresses
54
+ routine reconnect duplicates, but physical exactly-once printing is impossible;
55
+ every result therefore carries `physicalExactlyOnce: false`.
56
+
43
57
  ## Discovery metadata
44
58
 
45
59
  Descriptor-backed packages may assign up to three unique
@@ -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
  };
@@ -348,6 +353,8 @@ export declare type MiniAppPlatformApi = {
348
353
  http?: MiniAppHttpApi;
349
354
  /** Desktop host capability; feature-detect before use on portable targets. */
350
355
  credentials?: MiniAppCredentialsApi;
356
+ /** Desktop host capability; feature-detect before use on portable targets. */
357
+ printing?: MiniAppReceiptPrintingApi;
351
358
  /** Browser capabilities appear only when the selected target supports them. */
352
359
  auth?: MiniAppAuthApi;
353
360
  vfs?: MiniAppVfsApi;
@@ -403,7 +410,8 @@ export declare type MiniAppProject = {
403
410
  export declare type MiniAppProvisionProjectChatOptions = {
404
411
  conversationId: string;
405
412
  projectId: string;
406
- referenceBranch?: string | null;
413
+ baseBranch?: string | null;
414
+ workingBranch?: string | null;
407
415
  };
408
416
 
409
417
  export declare type MiniAppProvisionProjectChatResult = {
@@ -412,6 +420,91 @@ export declare type MiniAppProvisionProjectChatResult = {
412
420
  worktreeBaseCommit?: string | null;
413
421
  };
414
422
 
423
+ /** Bounded semantic receipt rendered, wrapped, fed, and cut by the desktop host. */
424
+ export declare type MiniAppReceiptDocument = {
425
+ version: 1;
426
+ /** One to 200 rows; each text field is capped at 512 printable ASCII characters. */
427
+ lines: MiniAppReceiptLine[];
428
+ /** Defaults to 3 and is capped at 8. */
429
+ feedLines?: number;
430
+ /** Defaults to true. */
431
+ cut?: boolean;
432
+ };
433
+
434
+ /** One semantic receipt row. Raw printer commands are intentionally absent. */
435
+ export declare type MiniAppReceiptLine = {
436
+ kind: 'text';
437
+ text: string;
438
+ alignment?: MiniAppReceiptTextAlignment;
439
+ weight?: MiniAppReceiptTextWeight;
440
+ } | {
441
+ kind: 'key-value';
442
+ label: string;
443
+ value: string;
444
+ } | {
445
+ kind: 'divider';
446
+ } | {
447
+ kind: 'blank';
448
+ };
449
+
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. */
477
+ export declare type MiniAppReceiptPrinterStatus = {
478
+ availability: 'ready' | 'unavailable';
479
+ };
480
+
481
+ /** Desktop-only silent receipt output through a discovered OS spooler. */
482
+ export declare type MiniAppReceiptPrintingApi = {
483
+ listPrinters(): MiniAppMaybePromise<MiniAppReceiptPrinterDiscovery>;
484
+ getStatus(selection: MiniAppReceiptPrinterSelection): MiniAppMaybePromise<MiniAppReceiptPrinterStatus>;
485
+ submit(options: MiniAppReceiptPrintOptions): MiniAppMaybePromise<MiniAppReceiptPrintResult>;
486
+ };
487
+
488
+ export declare type MiniAppReceiptPrintOptions = {
489
+ /**
490
+ * Stable caller key, capped at 128 characters. The host journals it within
491
+ * installation, workspace, and selected-destination scope.
492
+ */
493
+ jobKey: string;
494
+ selection: MiniAppReceiptPrinterSelection;
495
+ document: MiniAppReceiptDocument;
496
+ };
497
+
498
+ export declare type MiniAppReceiptPrintResult = {
499
+ disposition: 'submitted' | 'duplicate-suppressed' | 'indeterminate';
500
+ /** Always false: spooler acknowledgement cannot prove physical exactly-once output. */
501
+ physicalExactlyOnce: false;
502
+ };
503
+
504
+ export declare type MiniAppReceiptTextAlignment = 'left' | 'center' | 'right';
505
+
506
+ export declare type MiniAppReceiptTextWeight = 'normal' | 'bold';
507
+
415
508
  export declare type MiniAppSpecialistApi = {
416
509
  joinToChannel(channelId: string, specialistId: string): MiniAppMaybePromise<string>;
417
510
  listWorkspace(workspaceId: string): MiniAppMaybePromise<MiniAppSpecialistSummary[]>;
@@ -596,21 +689,6 @@ export declare type SendChannelMessageResult = {
596
689
  clientMessageId: string;
597
690
  };
598
691
 
599
- export declare type SendChannelSpecialistMessageOptions = {
600
- workspaceId?: string;
601
- channelId: string;
602
- projectId: string;
603
- specialistId: string;
604
- clientMessageId: string;
605
- body: string;
606
- messageContent?: Record<string, MiniAppJsonValue>;
607
- };
608
-
609
- export declare type SendChannelSpecialistMessageResult = {
610
- messageId: string;
611
- clientMessageId: string;
612
- };
613
-
614
692
  export declare type ToolDefinition<TArguments = unknown, TResult = unknown> = {
615
693
  displayName?: string;
616
694
  description: string;
@@ -358,6 +358,10 @@ const optionalSafeId = (name) => {
358
358
  }
359
359
  return value;
360
360
  };
361
+ const packageTarget = optionalSafeId('target');
362
+ if (packageTarget !== undefined && packageTarget !== 'desktop' && packageTarget !== 'mobile') {
363
+ throw new Error('Invalid federated surface package target.');
364
+ }
361
365
  const exactOrigin = (value) => {
362
366
  const origin = new URL(value).origin;
363
367
  if (origin === 'null') throw new Error('The TAP host origin must be concrete.');
@@ -453,6 +457,11 @@ const MAX_PRESENCE_JSON_BYTES = 16 * 1024;
453
457
  const MAX_HTTP_REQUEST_JSON_BYTES = 11 * 1024 * 1024;
454
458
  const MAX_HTTP_URL_CHARS = 64 * 1024;
455
459
  const MAX_CREDENTIAL_REFERENCE_CHARS = 512;
460
+ const MAX_RECEIPT_JOB_KEY_CHARS = 128;
461
+ const MAX_RECEIPT_PRINTER_NAME_CHARS = 512;
462
+ const MAX_RECEIPT_LINES = 200;
463
+ const MAX_RECEIPT_LINE_CHARS = 512;
464
+ const MAX_RECEIPT_TOTAL_CHARS = 32768;
456
465
  const PRESENCE_EVENT = 'tap-miniapp-presence-event';
457
466
  const HOST_ACTION_TIMEOUT_MS = 4000;
458
467
  const pendingHostActions = new Map();
@@ -774,6 +783,12 @@ const http = Object.freeze({
774
783
  !validPlatformPartition(options.credentialRef, MAX_CREDENTIAL_REFERENCE_CHARS)) {
775
784
  throw new Error('app.http.request credentialRef is invalid.');
776
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
+ }
777
792
  return invokeSdkHostAction(
778
793
  'tap.platform.http.request',
779
794
  {
@@ -781,6 +796,7 @@ const http = Object.freeze({
781
796
  ...(options.credentialRef === undefined
782
797
  ? {}
783
798
  : { credentialRef: options.credentialRef }),
799
+ ...(options.auth === undefined ? {} : { auth: options.auth }),
784
800
  },
785
801
  'app.http.request',
786
802
  null,
@@ -820,6 +836,142 @@ const credentials = Object.freeze({
820
836
  });
821
837
  },
822
838
  });
839
+ const checkedReceiptDocument = (document) => {
840
+ requireOptionsObject(document, 'app.printing.submit document');
841
+ if (document.version !== 1 || !Array.isArray(document.lines) ||
842
+ document.lines.length < 1 || document.lines.length > MAX_RECEIPT_LINES ||
843
+ Object.keys(document).some(
844
+ (key) => !new Set(['version', 'lines', 'feedLines', 'cut']).has(key),
845
+ ) ||
846
+ (document.feedLines !== undefined &&
847
+ (!Number.isInteger(document.feedLines) || document.feedLines < 0 || document.feedLines > 8)) ||
848
+ (document.cut !== undefined && typeof document.cut !== 'boolean')) {
849
+ throw new Error('app.printing.submit document is invalid.');
850
+ }
851
+ let totalChars = 0;
852
+ const text = (value) => {
853
+ if (typeof value !== 'string' || value.length > MAX_RECEIPT_LINE_CHARS ||
854
+ /[^\u0020-\u007e]/u.test(value)) {
855
+ throw new Error('app.printing.submit receipt text is invalid.');
856
+ }
857
+ totalChars += value.length;
858
+ };
859
+ for (const line of document.lines) {
860
+ requireOptionsObject(line, 'app.printing.submit receipt line');
861
+ const keys = Object.keys(line);
862
+ if (line.kind === 'text') {
863
+ text(line.text);
864
+ if ((line.alignment !== undefined && !new Set(['left', 'center', 'right']).has(line.alignment)) ||
865
+ (line.weight !== undefined && !new Set(['normal', 'bold']).has(line.weight)) ||
866
+ keys.some((key) => !new Set(['kind', 'text', 'alignment', 'weight']).has(key))) {
867
+ throw new Error('app.printing.submit text line is invalid.');
868
+ }
869
+ } else if (line.kind === 'key-value') {
870
+ text(line.label);
871
+ text(line.value);
872
+ if (keys.some((key) => !new Set(['kind', 'label', 'value']).has(key))) {
873
+ throw new Error('app.printing.submit key-value line is invalid.');
874
+ }
875
+ } else if ((line.kind !== 'divider' && line.kind !== 'blank') || keys.length !== 1) {
876
+ throw new Error('app.printing.submit receipt line is invalid.');
877
+ }
878
+ }
879
+ if (totalChars > MAX_RECEIPT_TOTAL_CHARS) {
880
+ throw new Error('app.printing.submit receipt text exceeds the allowed size.');
881
+ }
882
+ return document;
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
+ };
893
+ const printing = Object.freeze({
894
+ listPrinters() {
895
+ return invokeSdkHostAction(
896
+ 'tap.platform.printing.receipt.v2.list-printers',
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,
936
+ 'app.printing.getStatus',
937
+ 30000,
938
+ ).then((value) => {
939
+ if (!value || typeof value !== 'object' || Array.isArray(value) ||
940
+ !new Set(['ready', 'unavailable']).has(value.availability)) {
941
+ throw new Error('app.printing.getStatus returned an invalid result.');
942
+ }
943
+ return projectResultFields(value, ['availability'], 'app.printing.getStatus');
944
+ });
945
+ },
946
+ submit(options) {
947
+ requireOptionsObject(options, 'app.printing.submit');
948
+ if (Object.keys(options).some((key) => !new Set(['jobKey', 'selection', 'document']).has(key)) ||
949
+ !validPlatformPartition(options.jobKey, MAX_RECEIPT_JOB_KEY_CHARS)) {
950
+ throw new Error('app.printing.submit jobKey is invalid.');
951
+ }
952
+ checkedPrinterSelection(options.selection, 'app.printing.submit');
953
+ checkedReceiptDocument(options.document);
954
+ return invokeSdkHostAction(
955
+ 'tap.platform.printing.receipt.v2.submit',
956
+ options,
957
+ 'app.printing.submit',
958
+ // Physical output cannot be cancelled when an SDK timer expires. Keep
959
+ // the request correlated until the host reports its journaled outcome.
960
+ null,
961
+ ).then((value) => {
962
+ if (!value || typeof value !== 'object' || Array.isArray(value) ||
963
+ !new Set(['submitted', 'duplicate-suppressed', 'indeterminate']).has(value.disposition) ||
964
+ value.physicalExactlyOnce !== false) {
965
+ throw new Error('app.printing.submit returned an invalid result.');
966
+ }
967
+ return projectResultFields(
968
+ value,
969
+ ['disposition', 'physicalExactlyOnce'],
970
+ 'app.printing.submit',
971
+ );
972
+ });
973
+ },
974
+ });
823
975
  const channels = Object.freeze({
824
976
  create(options) {
825
977
  requireOptionString(options?.name, 'app.channels.create name');
@@ -833,33 +985,6 @@ const channels = Object.freeze({
833
985
  requireOptionString(options?.content, 'app.channels.sendMessage content');
834
986
  return invokeSdkHostAction('sendChannelMessage', options, 'app.channels.sendMessage');
835
987
  },
836
- sendSpecialistMessage(options) {
837
- requireOptionString(
838
- options?.channelId,
839
- 'app.channels.sendSpecialistMessage channelId',
840
- );
841
- requireOptionString(
842
- options?.specialistId,
843
- 'app.channels.sendSpecialistMessage specialistId',
844
- );
845
- requireOptionString(
846
- options?.projectId,
847
- 'app.channels.sendSpecialistMessage projectId',
848
- );
849
- requireOptionString(
850
- options?.clientMessageId,
851
- 'app.channels.sendSpecialistMessage clientMessageId',
852
- );
853
- requireOptionString(
854
- options?.body,
855
- 'app.channels.sendSpecialistMessage body',
856
- );
857
- return invokeSdkHostAction(
858
- 'sendSpecialistChannelMessage',
859
- options,
860
- 'app.channels.sendSpecialistMessage',
861
- );
862
- },
863
988
  getAccess(options) {
864
989
  requireOptionString(options?.channelId, 'app.channels.getAccess channelId');
865
990
  return invokeSdkHostAction('getChannelAccess', options, 'app.channels.getAccess');
@@ -1098,6 +1223,7 @@ const miniappSdk = Object.freeze({
1098
1223
  presence,
1099
1224
  http,
1100
1225
  credentials,
1226
+ ...(packageTarget === 'desktop' ? { printing } : {}),
1101
1227
  auth: platformAuth,
1102
1228
  vfs: platformVfs,
1103
1229
  specialist: platformSpecialist,
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
  };
@@ -319,6 +324,8 @@ export declare type MiniAppPlatformApi = {
319
324
  http?: MiniAppHttpApi;
320
325
  /** Desktop host capability; feature-detect before use on portable targets. */
321
326
  credentials?: MiniAppCredentialsApi;
327
+ /** Desktop host capability; feature-detect before use on portable targets. */
328
+ printing?: MiniAppReceiptPrintingApi;
322
329
  /** Browser capabilities appear only when the selected target supports them. */
323
330
  auth?: MiniAppAuthApi;
324
331
  vfs?: MiniAppVfsApi;
@@ -374,7 +381,8 @@ export declare type MiniAppProject = {
374
381
  export declare type MiniAppProvisionProjectChatOptions = {
375
382
  conversationId: string;
376
383
  projectId: string;
377
- referenceBranch?: string | null;
384
+ baseBranch?: string | null;
385
+ workingBranch?: string | null;
378
386
  };
379
387
 
380
388
  export declare type MiniAppProvisionProjectChatResult = {
@@ -383,6 +391,91 @@ export declare type MiniAppProvisionProjectChatResult = {
383
391
  worktreeBaseCommit?: string | null;
384
392
  };
385
393
 
394
+ /** Bounded semantic receipt rendered, wrapped, fed, and cut by the desktop host. */
395
+ export declare type MiniAppReceiptDocument = {
396
+ version: 1;
397
+ /** One to 200 rows; each text field is capped at 512 printable ASCII characters. */
398
+ lines: MiniAppReceiptLine[];
399
+ /** Defaults to 3 and is capped at 8. */
400
+ feedLines?: number;
401
+ /** Defaults to true. */
402
+ cut?: boolean;
403
+ };
404
+
405
+ /** One semantic receipt row. Raw printer commands are intentionally absent. */
406
+ export declare type MiniAppReceiptLine = {
407
+ kind: 'text';
408
+ text: string;
409
+ alignment?: MiniAppReceiptTextAlignment;
410
+ weight?: MiniAppReceiptTextWeight;
411
+ } | {
412
+ kind: 'key-value';
413
+ label: string;
414
+ value: string;
415
+ } | {
416
+ kind: 'divider';
417
+ } | {
418
+ kind: 'blank';
419
+ };
420
+
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. */
448
+ export declare type MiniAppReceiptPrinterStatus = {
449
+ availability: 'ready' | 'unavailable';
450
+ };
451
+
452
+ /** Desktop-only silent receipt output through a discovered OS spooler. */
453
+ export declare type MiniAppReceiptPrintingApi = {
454
+ listPrinters(): MiniAppMaybePromise<MiniAppReceiptPrinterDiscovery>;
455
+ getStatus(selection: MiniAppReceiptPrinterSelection): MiniAppMaybePromise<MiniAppReceiptPrinterStatus>;
456
+ submit(options: MiniAppReceiptPrintOptions): MiniAppMaybePromise<MiniAppReceiptPrintResult>;
457
+ };
458
+
459
+ export declare type MiniAppReceiptPrintOptions = {
460
+ /**
461
+ * Stable caller key, capped at 128 characters. The host journals it within
462
+ * installation, workspace, and selected-destination scope.
463
+ */
464
+ jobKey: string;
465
+ selection: MiniAppReceiptPrinterSelection;
466
+ document: MiniAppReceiptDocument;
467
+ };
468
+
469
+ export declare type MiniAppReceiptPrintResult = {
470
+ disposition: 'submitted' | 'duplicate-suppressed' | 'indeterminate';
471
+ /** Always false: spooler acknowledgement cannot prove physical exactly-once output. */
472
+ physicalExactlyOnce: false;
473
+ };
474
+
475
+ export declare type MiniAppReceiptTextAlignment = 'left' | 'center' | 'right';
476
+
477
+ export declare type MiniAppReceiptTextWeight = 'normal' | 'bold';
478
+
386
479
  export declare type MiniAppSpecialistApi = {
387
480
  joinToChannel(channelId: string, specialistId: string): MiniAppMaybePromise<string>;
388
481
  listWorkspace(workspaceId: string): MiniAppMaybePromise<MiniAppSpecialistSummary[]>;
@@ -567,21 +660,6 @@ export declare type SendChannelMessageResult = {
567
660
  clientMessageId: string;
568
661
  };
569
662
 
570
- export declare type SendChannelSpecialistMessageOptions = {
571
- workspaceId?: string;
572
- channelId: string;
573
- projectId: string;
574
- specialistId: string;
575
- clientMessageId: string;
576
- body: string;
577
- messageContent?: Record<string, MiniAppJsonValue>;
578
- };
579
-
580
- export declare type SendChannelSpecialistMessageResult = {
581
- messageId: string;
582
- clientMessageId: string;
583
- };
584
-
585
663
  export declare type UpdateProjectOptions = {
586
664
  workspaceId?: string;
587
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
  };
@@ -360,6 +365,8 @@ export declare type MiniAppPlatformApi = {
360
365
  http?: MiniAppHttpApi;
361
366
  /** Desktop host capability; feature-detect before use on portable targets. */
362
367
  credentials?: MiniAppCredentialsApi;
368
+ /** Desktop host capability; feature-detect before use on portable targets. */
369
+ printing?: MiniAppReceiptPrintingApi;
363
370
  /** Browser capabilities appear only when the selected target supports them. */
364
371
  auth?: MiniAppAuthApi;
365
372
  vfs?: MiniAppVfsApi;
@@ -415,7 +422,8 @@ declare type MiniAppProject = {
415
422
  declare type MiniAppProvisionProjectChatOptions = {
416
423
  conversationId: string;
417
424
  projectId: string;
418
- referenceBranch?: string | null;
425
+ baseBranch?: string | null;
426
+ workingBranch?: string | null;
419
427
  };
420
428
 
421
429
  declare type MiniAppProvisionProjectChatResult = {
@@ -424,6 +432,91 @@ declare type MiniAppProvisionProjectChatResult = {
424
432
  worktreeBaseCommit?: string | null;
425
433
  };
426
434
 
435
+ /** Bounded semantic receipt rendered, wrapped, fed, and cut by the desktop host. */
436
+ declare type MiniAppReceiptDocument = {
437
+ version: 1;
438
+ /** One to 200 rows; each text field is capped at 512 printable ASCII characters. */
439
+ lines: MiniAppReceiptLine[];
440
+ /** Defaults to 3 and is capped at 8. */
441
+ feedLines?: number;
442
+ /** Defaults to true. */
443
+ cut?: boolean;
444
+ };
445
+
446
+ /** One semantic receipt row. Raw printer commands are intentionally absent. */
447
+ declare type MiniAppReceiptLine = {
448
+ kind: 'text';
449
+ text: string;
450
+ alignment?: MiniAppReceiptTextAlignment;
451
+ weight?: MiniAppReceiptTextWeight;
452
+ } | {
453
+ kind: 'key-value';
454
+ label: string;
455
+ value: string;
456
+ } | {
457
+ kind: 'divider';
458
+ } | {
459
+ kind: 'blank';
460
+ };
461
+
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. */
489
+ declare type MiniAppReceiptPrinterStatus = {
490
+ availability: 'ready' | 'unavailable';
491
+ };
492
+
493
+ /** Desktop-only silent receipt output through a discovered OS spooler. */
494
+ declare type MiniAppReceiptPrintingApi = {
495
+ listPrinters(): MiniAppMaybePromise<MiniAppReceiptPrinterDiscovery>;
496
+ getStatus(selection: MiniAppReceiptPrinterSelection): MiniAppMaybePromise<MiniAppReceiptPrinterStatus>;
497
+ submit(options: MiniAppReceiptPrintOptions): MiniAppMaybePromise<MiniAppReceiptPrintResult>;
498
+ };
499
+
500
+ declare type MiniAppReceiptPrintOptions = {
501
+ /**
502
+ * Stable caller key, capped at 128 characters. The host journals it within
503
+ * installation, workspace, and selected-destination scope.
504
+ */
505
+ jobKey: string;
506
+ selection: MiniAppReceiptPrinterSelection;
507
+ document: MiniAppReceiptDocument;
508
+ };
509
+
510
+ declare type MiniAppReceiptPrintResult = {
511
+ disposition: 'submitted' | 'duplicate-suppressed' | 'indeterminate';
512
+ /** Always false: spooler acknowledgement cannot prove physical exactly-once output. */
513
+ physicalExactlyOnce: false;
514
+ };
515
+
516
+ declare type MiniAppReceiptTextAlignment = 'left' | 'center' | 'right';
517
+
518
+ declare type MiniAppReceiptTextWeight = 'normal' | 'bold';
519
+
427
520
  declare type MiniAppSpecialistApi = {
428
521
  joinToChannel(channelId: string, specialistId: string): MiniAppMaybePromise<string>;
429
522
  listWorkspace(workspaceId: string): MiniAppMaybePromise<MiniAppSpecialistSummary[]>;
@@ -624,21 +717,6 @@ declare type SendChannelMessageResult = {
624
717
  clientMessageId: string;
625
718
  };
626
719
 
627
- declare type SendChannelSpecialistMessageOptions = {
628
- workspaceId?: string;
629
- channelId: string;
630
- projectId: string;
631
- specialistId: string;
632
- clientMessageId: string;
633
- body: string;
634
- messageContent?: Record<string, MiniAppJsonValue>;
635
- };
636
-
637
- declare type SendChannelSpecialistMessageResult = {
638
- messageId: string;
639
- clientMessageId: string;
640
- };
641
-
642
720
  export declare type SpecialistEvent = SpecialistTurnCompletedEvent | SpecialistTurnErrorEvent;
643
721
 
644
722
  export declare type SpecialistTurnCompletedEvent = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theaiplatform/miniapp-sdk",
3
- "version": "0.0.0-main.1",
3
+ "version": "0.0.0-oscar-c-miniapp-github-auth.1",
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",