@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/README.md +31 -6
- package/THIRD_PARTY_NOTICES.md +18 -18
- package/config-schema.json +1 -26
- package/dist/index.d.ts +116 -26
- package/dist/rspack/index.js +559 -44
- package/dist/sdk.d.ts +116 -26
- package/dist/ui/wasm.js +5 -3
- package/dist/ui.js +5 -3
- package/dist/web.d.ts +116 -26
- package/package.json +18 -18
package/README.md
CHANGED
|
@@ -40,17 +40,42 @@ 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
|
|
44
|
-
bounded
|
|
45
|
-
|
|
46
|
-
|
|
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.
|
|
50
|
-
|
|
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
|
|
|
57
|
+
## Terminal sessions in 0.3.0
|
|
58
|
+
|
|
59
|
+
`sdk.terminal?.v1` is an optional desktop-only terminal session API introduced
|
|
60
|
+
in SDK 0.3.0. It exposes
|
|
61
|
+
only the fixed `workspace-shell` and `neovim` profiles; package code cannot
|
|
62
|
+
choose an executable, environment, native terminal ID, working directory, or
|
|
63
|
+
filesystem path. `open()` returns a host-owned session with ordered binary
|
|
64
|
+
events, acknowledged binary writes, resize, and idempotent close. A dedicated
|
|
65
|
+
per-session channel applies byte credit and bounded buffering, so terminal
|
|
66
|
+
output never uses the ordinary miniapp host-action bridge as a data plane.
|
|
67
|
+
Packages opening a session declare the selected `terminal` profile and the
|
|
68
|
+
`filesystem-mount` resource `conversation-vfs:read-write`, plus the persisted
|
|
69
|
+
`terminal.session.open`, `filesystem.read`, and `filesystem.write` actions.
|
|
70
|
+
Capability discovery is authoritative: the initial host reports both profiles
|
|
71
|
+
unavailable. `workspace-shell` waits for positive conversation-scoped read
|
|
72
|
+
isolation, and `neovim` additionally waits for an integrity-locked runtime.
|
|
73
|
+
|
|
74
|
+
See the
|
|
75
|
+
[terminal API reference](https://docs.theaiplatform.app/miniapps/reference/sdk#terminal-sessions)
|
|
76
|
+
for capability detection, the required descriptor authorization, session
|
|
77
|
+
events, limits, and cleanup.
|
|
78
|
+
|
|
54
79
|
## Discovery metadata
|
|
55
80
|
|
|
56
81
|
Descriptor-backed packages may assign up to three unique
|
package/THIRD_PARTY_NOTICES.md
CHANGED
|
@@ -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
|
|
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.
|
|
20
|
-
| Direct UI | `@radix-ui/react-avatar` |
|
|
21
|
-
| Direct UI | `@radix-ui/react-checkbox` | 1.3.
|
|
22
|
-
| Direct UI | `@radix-ui/react-compose-refs` | 1.1.
|
|
23
|
-
| Direct UI | `@radix-ui/react-dialog` | 1.1.
|
|
24
|
-
| Direct UI | `@radix-ui/react-label` |
|
|
25
|
-
| Direct UI | `@radix-ui/react-progress` |
|
|
26
|
-
| Direct UI | `@radix-ui/react-radio-group` | 1.
|
|
27
|
-
| Direct UI | `@radix-ui/react-scroll-area` | 1.2.
|
|
28
|
-
| Direct UI | `@radix-ui/react-select` | 2.
|
|
29
|
-
| Direct UI | `@radix-ui/react-separator` |
|
|
30
|
-
| Direct UI | `@radix-ui/react-slider` | 1.
|
|
31
|
-
| Direct UI | `@radix-ui/react-slot` | 1.
|
|
32
|
-
| Direct UI | `@radix-ui/react-tabs` | 1.1.
|
|
33
|
-
| Direct UI | `@radix-ui/react-toggle` | 1.1.
|
|
34
|
-
| Direct UI | `@radix-ui/react-toggle-group` | 1.1.
|
|
35
|
-
| Direct UI | `@radix-ui/react-tooltip` |
|
|
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/config-schema.json
CHANGED
|
@@ -600,27 +600,6 @@
|
|
|
600
600
|
],
|
|
601
601
|
"type": "string"
|
|
602
602
|
},
|
|
603
|
-
"MiniAppReferencesManifest": {
|
|
604
|
-
"additionalProperties": false,
|
|
605
|
-
"description": "Manifest that references built TAP miniapp manifests.",
|
|
606
|
-
"properties": {
|
|
607
|
-
"$schema": {
|
|
608
|
-
"description": "Optional JSON Schema reference for editor support.",
|
|
609
|
-
"type": ["string", "null"]
|
|
610
|
-
},
|
|
611
|
-
"references": {
|
|
612
|
-
"description": "References to built TAP miniapp manifests.\n\nString shorthand remains available for local and mutable development sources. An\nimmutable remote collection uses the object form (`{ \"url\": ..., \"hash\": ... }`) so\nevery child manifest carries its own SHA-256 integrity boundary.",
|
|
613
|
-
"items": {
|
|
614
|
-
"$ref": "#/$defs/MiniAppSource"
|
|
615
|
-
},
|
|
616
|
-
"minItems": 1,
|
|
617
|
-
"type": "array"
|
|
618
|
-
}
|
|
619
|
-
},
|
|
620
|
-
"required": ["references"],
|
|
621
|
-
"title": "Tap Miniapp References Manifest",
|
|
622
|
-
"type": "object"
|
|
623
|
-
},
|
|
624
603
|
"MiniAppSource": {
|
|
625
604
|
"description": "Absolute URL or local path. Bundle entry paths are resolved relative to the manifest that declares them.",
|
|
626
605
|
"oneOf": [
|
|
@@ -3694,12 +3673,8 @@
|
|
|
3694
3673
|
{
|
|
3695
3674
|
"$ref": "#/$defs/MiniAppBundleManifest",
|
|
3696
3675
|
"description": "A single miniapp bundle with its runtime entrypoint."
|
|
3697
|
-
},
|
|
3698
|
-
{
|
|
3699
|
-
"$ref": "#/$defs/MiniAppReferencesManifest",
|
|
3700
|
-
"description": "A collection manifest that points at built miniapp manifests."
|
|
3701
3676
|
}
|
|
3702
3677
|
],
|
|
3703
|
-
"description": "Manifest for
|
|
3678
|
+
"description": "Manifest for one Tap package or legacy miniapp bundle.",
|
|
3704
3679
|
"title": "Tap Miniapp Manifest"
|
|
3705
3680
|
}
|
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
|
|
234
|
-
*
|
|
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
|
};
|
|
@@ -350,6 +355,8 @@ export declare type MiniAppPlatformApi = {
|
|
|
350
355
|
credentials?: MiniAppCredentialsApi;
|
|
351
356
|
/** Desktop host capability; feature-detect before use on portable targets. */
|
|
352
357
|
printing?: MiniAppReceiptPrintingApi;
|
|
358
|
+
/** Desktop host capability; feature-detect before opening a terminal. */
|
|
359
|
+
terminal?: MiniAppTerminalApi;
|
|
353
360
|
/** Browser capabilities appear only when the selected target supports them. */
|
|
354
361
|
auth?: MiniAppAuthApi;
|
|
355
362
|
vfs?: MiniAppVfsApi;
|
|
@@ -405,7 +412,8 @@ export declare type MiniAppProject = {
|
|
|
405
412
|
export declare type MiniAppProvisionProjectChatOptions = {
|
|
406
413
|
conversationId: string;
|
|
407
414
|
projectId: string;
|
|
408
|
-
|
|
415
|
+
baseBranch?: string | null;
|
|
416
|
+
workingBranch?: string | null;
|
|
409
417
|
};
|
|
410
418
|
|
|
411
419
|
export declare type MiniAppProvisionProjectChatResult = {
|
|
@@ -441,24 +449,51 @@ export declare type MiniAppReceiptLine = {
|
|
|
441
449
|
kind: 'blank';
|
|
442
450
|
};
|
|
443
451
|
|
|
444
|
-
/**
|
|
452
|
+
/** Host rendering capabilities for one supported receipt paper width. */
|
|
453
|
+
export declare type MiniAppReceiptPaperProfile = {
|
|
454
|
+
id: MiniAppReceiptPrinterProfile;
|
|
455
|
+
widthMm: 58 | 80;
|
|
456
|
+
columns: 32 | 48;
|
|
457
|
+
};
|
|
458
|
+
|
|
459
|
+
/** Bounded metadata for one machine-local printer visible to an authorized miniapp. */
|
|
460
|
+
export declare type MiniAppReceiptPrinter = {
|
|
461
|
+
name: string;
|
|
462
|
+
isDefault: boolean;
|
|
463
|
+
};
|
|
464
|
+
|
|
465
|
+
export declare type MiniAppReceiptPrinterDiscovery = {
|
|
466
|
+
printers: MiniAppReceiptPrinter[];
|
|
467
|
+
paperProfiles: MiniAppReceiptPaperProfile[];
|
|
468
|
+
};
|
|
469
|
+
|
|
470
|
+
export declare type MiniAppReceiptPrinterProfile = 'receipt-58mm' | 'receipt-80mm';
|
|
471
|
+
|
|
472
|
+
/** Miniapp-owned selection passed explicitly to status and submission calls. */
|
|
473
|
+
export declare type MiniAppReceiptPrinterSelection = {
|
|
474
|
+
printerName: string;
|
|
475
|
+
profile: MiniAppReceiptPrinterProfile;
|
|
476
|
+
};
|
|
477
|
+
|
|
478
|
+
/** Readiness for an exact machine-local printer selection. */
|
|
445
479
|
export declare type MiniAppReceiptPrinterStatus = {
|
|
446
|
-
availability: '
|
|
447
|
-
profile: 'receipt-58mm' | 'receipt-80mm' | null;
|
|
480
|
+
availability: 'ready' | 'unavailable';
|
|
448
481
|
};
|
|
449
482
|
|
|
450
|
-
/** Desktop-only silent receipt output through
|
|
483
|
+
/** Desktop-only silent receipt output through a discovered OS spooler. */
|
|
451
484
|
export declare type MiniAppReceiptPrintingApi = {
|
|
452
|
-
|
|
485
|
+
listPrinters(): MiniAppMaybePromise<MiniAppReceiptPrinterDiscovery>;
|
|
486
|
+
getStatus(selection: MiniAppReceiptPrinterSelection): MiniAppMaybePromise<MiniAppReceiptPrinterStatus>;
|
|
453
487
|
submit(options: MiniAppReceiptPrintOptions): MiniAppMaybePromise<MiniAppReceiptPrintResult>;
|
|
454
488
|
};
|
|
455
489
|
|
|
456
490
|
export declare type MiniAppReceiptPrintOptions = {
|
|
457
491
|
/**
|
|
458
492
|
* Stable caller key, capped at 128 characters. The host journals it within
|
|
459
|
-
* installation, workspace, and
|
|
493
|
+
* installation, workspace, and selected-destination scope.
|
|
460
494
|
*/
|
|
461
495
|
jobKey: string;
|
|
496
|
+
selection: MiniAppReceiptPrinterSelection;
|
|
462
497
|
document: MiniAppReceiptDocument;
|
|
463
498
|
};
|
|
464
499
|
|
|
@@ -587,6 +622,76 @@ export declare type MiniAppStorageSetOptions = MiniAppStorageAddress & {
|
|
|
587
622
|
expectedRevision: number | null;
|
|
588
623
|
};
|
|
589
624
|
|
|
625
|
+
export declare type MiniAppTerminalApi = {
|
|
626
|
+
readonly v1: MiniAppTerminalV1Api;
|
|
627
|
+
};
|
|
628
|
+
|
|
629
|
+
/** Versioned, desktop-only host terminal capability. */
|
|
630
|
+
export declare type MiniAppTerminalV1Api = {
|
|
631
|
+
getCapabilities(): Promise<MiniAppTerminalV1Capabilities>;
|
|
632
|
+
open(options: MiniAppTerminalV1OpenOptions): Promise<MiniAppTerminalV1Session>;
|
|
633
|
+
};
|
|
634
|
+
|
|
635
|
+
export declare type MiniAppTerminalV1Capabilities = {
|
|
636
|
+
profiles: MiniAppTerminalV1Profile[];
|
|
637
|
+
limits: MiniAppTerminalV1Limits;
|
|
638
|
+
};
|
|
639
|
+
|
|
640
|
+
export declare type MiniAppTerminalV1DataEvent = {
|
|
641
|
+
type: 'data';
|
|
642
|
+
sequence: number;
|
|
643
|
+
data: Uint8Array;
|
|
644
|
+
};
|
|
645
|
+
|
|
646
|
+
export declare type MiniAppTerminalV1Event = MiniAppTerminalV1DataEvent | MiniAppTerminalV1ExitEvent;
|
|
647
|
+
|
|
648
|
+
export declare type MiniAppTerminalV1ExitEvent = {
|
|
649
|
+
type: 'exit';
|
|
650
|
+
sequence: number;
|
|
651
|
+
code: number | null;
|
|
652
|
+
signal: string | null;
|
|
653
|
+
reason: 'exited' | 'closed' | 'revoked' | 'error';
|
|
654
|
+
};
|
|
655
|
+
|
|
656
|
+
export declare type MiniAppTerminalV1Limits = {
|
|
657
|
+
maxSessionsPerDocument: number;
|
|
658
|
+
maxWriteBytes: number;
|
|
659
|
+
maxOutputBytesInFlight: number;
|
|
660
|
+
maxCols: number;
|
|
661
|
+
maxRows: number;
|
|
662
|
+
};
|
|
663
|
+
|
|
664
|
+
export declare type MiniAppTerminalV1OpenOptions = {
|
|
665
|
+
profile: MiniAppTerminalV1ProfileId;
|
|
666
|
+
cols: number;
|
|
667
|
+
rows: number;
|
|
668
|
+
};
|
|
669
|
+
|
|
670
|
+
export declare type MiniAppTerminalV1Profile = {
|
|
671
|
+
id: MiniAppTerminalV1ProfileId;
|
|
672
|
+
available: boolean;
|
|
673
|
+
unavailableReason: string | null;
|
|
674
|
+
};
|
|
675
|
+
|
|
676
|
+
/** Host-owned terminal runtime profiles exposed by `sdk.terminal.v1`. */
|
|
677
|
+
export declare type MiniAppTerminalV1ProfileId = 'workspace-shell' | 'neovim';
|
|
678
|
+
|
|
679
|
+
export declare type MiniAppTerminalV1ResizeOptions = {
|
|
680
|
+
cols: number;
|
|
681
|
+
rows: number;
|
|
682
|
+
};
|
|
683
|
+
|
|
684
|
+
export declare type MiniAppTerminalV1Session = {
|
|
685
|
+
/** Opaque host-minted session identity; it carries no ambient authority. */
|
|
686
|
+
readonly id: string;
|
|
687
|
+
readonly profile: MiniAppTerminalV1ProfileId;
|
|
688
|
+
/** Ordered output with byte-sized backpressure owned by the host session. */
|
|
689
|
+
readonly events: ReadableStream<MiniAppTerminalV1Event>;
|
|
690
|
+
write(data: Uint8Array): Promise<void>;
|
|
691
|
+
resize(options: MiniAppTerminalV1ResizeOptions): Promise<void>;
|
|
692
|
+
close(): Promise<void>;
|
|
693
|
+
};
|
|
694
|
+
|
|
590
695
|
export declare type MiniAppUserProfile = {
|
|
591
696
|
sub: string;
|
|
592
697
|
name?: string | null;
|
|
@@ -656,21 +761,6 @@ export declare type SendChannelMessageResult = {
|
|
|
656
761
|
clientMessageId: string;
|
|
657
762
|
};
|
|
658
763
|
|
|
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
764
|
export declare type ToolDefinition<TArguments = unknown, TResult = unknown> = {
|
|
675
765
|
displayName?: string;
|
|
676
766
|
description: string;
|