@stackable-labs/sdk-extension-contracts 1.17.0 → 1.18.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/api.js DELETED
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=api.js.map
package/dist/api.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"api.js","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":""}
package/dist/app.d.ts DELETED
@@ -1 +0,0 @@
1
- export type { AppRegistryEntry } from '@stackable-labs/lib-contracts';
package/dist/app.js DELETED
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=app.js.map
package/dist/app.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"app.js","sourceRoot":"","sources":["../src/app.ts"],"names":[],"mappings":""}
@@ -1,59 +0,0 @@
1
- /**
2
- * Capabilities Contract
3
- * Defines the host-mediated APIs that extensions can call via RPC.
4
- */
5
- import type { ApiRequest } from './api';
6
- /** Optional init for data.fetch — mirrors RequestInit subset */
7
- export interface FetchRequestInit {
8
- /** HTTP method (default: 'GET') */
9
- method?: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
10
- /** Optional request headers */
11
- headers?: Record<string, string>;
12
- /** Optional request body (JSON-serializable) */
13
- body?: unknown;
14
- }
15
- /** Internal wire payload sent over RPC (url merged back in from positional args) */
16
- export interface FetchRequest extends FetchRequestInit {
17
- /** Full URL to fetch — must be on the extension's allowedDomains */
18
- url: string;
19
- }
20
- /** Response returned to the extension */
21
- export interface FetchResponse {
22
- status: number;
23
- ok: boolean;
24
- data: unknown;
25
- }
26
- /** Payload for actions.toast capability */
27
- export interface ToastPayload {
28
- message: string;
29
- type?: 'success' | 'error' | 'info' | 'warning';
30
- duration?: number;
31
- }
32
- /** Payload for actions.invoke capability */
33
- export interface ActionInvokePayload {
34
- action: string;
35
- payload?: Record<string, unknown>;
36
- }
37
- /** Context returned by context.read capability */
38
- export interface ContextData {
39
- customerId?: string;
40
- customerEmail?: string;
41
- [key: string]: unknown;
42
- }
43
- /** Union of all capability call types */
44
- export type CapabilityCall = {
45
- type: 'data.query';
46
- payload: ApiRequest;
47
- } | {
48
- type: 'data.fetch';
49
- payload: FetchRequest;
50
- } | {
51
- type: 'actions.toast';
52
- payload: ToastPayload;
53
- } | {
54
- type: 'actions.invoke';
55
- payload: ActionInvokePayload;
56
- } | {
57
- type: 'context.read';
58
- };
59
- export type CapabilityType = CapabilityCall['type'];
@@ -1,6 +0,0 @@
1
- /**
2
- * Capabilities Contract
3
- * Defines the host-mediated APIs that extensions can call via RPC.
4
- */
5
- export {};
6
- //# sourceMappingURL=capabilities.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"capabilities.js","sourceRoot":"","sources":["../src/capabilities.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
package/dist/common.d.ts DELETED
@@ -1,8 +0,0 @@
1
- /**
2
- * Shared primitive types used across contracts.
3
- */
4
- /** Lightweight reference to a named entity (e.g. extension, instance). */
5
- export interface NamedEntity {
6
- id: string;
7
- name: string;
8
- }
package/dist/common.js DELETED
@@ -1,5 +0,0 @@
1
- /**
2
- * Shared primitive types used across contracts.
3
- */
4
- export {};
5
- //# sourceMappingURL=common.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"common.js","sourceRoot":"","sources":["../src/common.ts"],"names":[],"mappings":"AAAA;;GAEG"}
@@ -1,18 +0,0 @@
1
- /**
2
- * UI Component Contract
3
- * Defines the fixed set of UI tags that extensions can render.
4
- * The host maps these to real React components.
5
- */
6
- export declare const UI_TAGS: readonly ["ui-card", "ui-card-content", "ui-card-header", "ui-button", "ui-text", "ui-heading", "ui-badge", "ui-input", "ui-stack", "ui-inline", "ui-separator", "ui-tabs", "ui-tabs-list", "ui-tabs-trigger", "ui-tabs-content", "ui-scroll-area", "ui-avatar", "ui-avatar-image", "ui-avatar-fallback", "ui-icon", "ui-link", "ui-menu", "ui-menu-item"];
7
- export type UITag = (typeof UI_TAGS)[number];
8
- /**
9
- * Allowed attributes per UI tag.
10
- * Host should reject any attributes not in this allowlist.
11
- */
12
- export declare const UI_TAG_ATTRIBUTES: Record<UITag, readonly string[]>;
13
- /**
14
- * Supported icon names (subset of lucide-react).
15
- * Extensions reference icons by name; host renders the actual icon component.
16
- */
17
- export declare const ALLOWED_ICONS: readonly ["arrow-left", "calendar", "check-circle-2", "chevron-left", "chevron-right", "clock", "credit-card", "external-link", "help-circle", "info", "loader-2", "mail", "map-pin", "message-circle", "message-square", "package", "phone", "search", "shopping-bag", "sparkles", "truck", "user", "x-circle", "alert-circle", "book-open"];
18
- export type AllowedIconName = (typeof ALLOWED_ICONS)[number];
@@ -1,91 +0,0 @@
1
- /**
2
- * UI Component Contract
3
- * Defines the fixed set of UI tags that extensions can render.
4
- * The host maps these to real React components.
5
- */
6
- export const UI_TAGS = [
7
- 'ui-card',
8
- 'ui-card-content',
9
- 'ui-card-header',
10
- 'ui-button',
11
- 'ui-text',
12
- 'ui-heading',
13
- 'ui-badge',
14
- 'ui-input',
15
- 'ui-stack',
16
- 'ui-inline',
17
- 'ui-separator',
18
- 'ui-tabs',
19
- 'ui-tabs-list',
20
- 'ui-tabs-trigger',
21
- 'ui-tabs-content',
22
- 'ui-scroll-area',
23
- 'ui-avatar',
24
- 'ui-avatar-image',
25
- 'ui-avatar-fallback',
26
- 'ui-icon',
27
- 'ui-link',
28
- 'ui-menu',
29
- 'ui-menu-item'
30
- ];
31
- /**
32
- * Allowed attributes per UI tag.
33
- * Host should reject any attributes not in this allowlist.
34
- */
35
- export const UI_TAG_ATTRIBUTES = {
36
- 'ui-card': ['className', 'onClick'],
37
- 'ui-card-content': ['className'],
38
- 'ui-card-header': ['className'],
39
- 'ui-button': ['variant', 'size', 'disabled', 'onClick', 'type', 'className', 'title'],
40
- 'ui-text': ['className', 'tone'],
41
- 'ui-heading': ['level', 'className'],
42
- 'ui-badge': ['variant', 'tone', 'className'],
43
- 'ui-input': ['type', 'placeholder', 'value', 'onChange', 'disabled', 'className', 'id'],
44
- 'ui-stack': ['gap', 'direction', 'align', 'className'],
45
- 'ui-inline': ['gap', 'align', 'className'],
46
- 'ui-separator': ['className'],
47
- 'ui-tabs': ['defaultValue', 'className'],
48
- 'ui-tabs-list': ['className'],
49
- 'ui-tabs-trigger': ['value', 'className'],
50
- 'ui-tabs-content': ['value', 'className'],
51
- 'ui-scroll-area': ['className'],
52
- 'ui-avatar': ['className'],
53
- 'ui-avatar-image': ['src', 'alt', 'className'],
54
- 'ui-avatar-fallback': ['className'],
55
- 'ui-icon': ['name', 'size', 'className'],
56
- 'ui-link': ['href', 'target', 'rel', 'className'],
57
- 'ui-menu-item': ['icon', 'label', 'description', 'onClick', 'className'],
58
- 'ui-menu': ['title', 'className'],
59
- };
60
- /**
61
- * Supported icon names (subset of lucide-react).
62
- * Extensions reference icons by name; host renders the actual icon component.
63
- */
64
- export const ALLOWED_ICONS = [
65
- 'arrow-left',
66
- 'calendar',
67
- 'check-circle-2',
68
- 'chevron-left',
69
- 'chevron-right',
70
- 'clock',
71
- 'credit-card',
72
- 'external-link',
73
- 'help-circle',
74
- 'info',
75
- 'loader-2',
76
- 'mail',
77
- 'map-pin',
78
- 'message-circle',
79
- 'message-square',
80
- 'package',
81
- 'phone',
82
- 'search',
83
- 'shopping-bag',
84
- 'sparkles',
85
- 'truck',
86
- 'user',
87
- 'x-circle',
88
- 'alert-circle',
89
- 'book-open'
90
- ];
91
- //# sourceMappingURL=components.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"components.js","sourceRoot":"","sources":["../src/components.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG;IACrB,SAAS;IACT,iBAAiB;IACjB,gBAAgB;IAChB,WAAW;IACX,SAAS;IACT,YAAY;IACZ,UAAU;IACV,UAAU;IACV,UAAU;IACV,WAAW;IACX,cAAc;IACd,SAAS;IACT,cAAc;IACd,iBAAiB;IACjB,iBAAiB;IACjB,gBAAgB;IAChB,WAAW;IACX,iBAAiB;IACjB,oBAAoB;IACpB,SAAS;IACT,SAAS;IACT,SAAS;IACT,cAAc;CACN,CAAA;AAIV;;;GAGG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAqC;IACjE,SAAS,EAAE,CAAC,WAAW,EAAE,SAAS,CAAC;IACnC,iBAAiB,EAAE,CAAC,WAAW,CAAC;IAChC,gBAAgB,EAAE,CAAC,WAAW,CAAC;IAC/B,WAAW,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,CAAC;IACrF,SAAS,EAAE,CAAC,WAAW,EAAE,MAAM,CAAC;IAChC,YAAY,EAAE,CAAC,OAAO,EAAE,WAAW,CAAC;IACpC,UAAU,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,WAAW,CAAC;IAC5C,UAAU,EAAE,CAAC,MAAM,EAAE,aAAa,EAAE,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,IAAI,CAAC;IACvF,UAAU,EAAE,CAAC,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,WAAW,CAAC;IACtD,WAAW,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,WAAW,CAAC;IAC1C,cAAc,EAAE,CAAC,WAAW,CAAC;IAC7B,SAAS,EAAE,CAAC,cAAc,EAAE,WAAW,CAAC;IACxC,cAAc,EAAE,CAAC,WAAW,CAAC;IAC7B,iBAAiB,EAAE,CAAC,OAAO,EAAE,WAAW,CAAC;IACzC,iBAAiB,EAAE,CAAC,OAAO,EAAE,WAAW,CAAC;IACzC,gBAAgB,EAAE,CAAC,WAAW,CAAC;IAC/B,WAAW,EAAE,CAAC,WAAW,CAAC;IAC1B,iBAAiB,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,WAAW,CAAC;IAC9C,oBAAoB,EAAE,CAAC,WAAW,CAAC;IACnC,SAAS,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,CAAC;IACxC,SAAS,EAAE,CAAC,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,WAAW,CAAC;IACjD,cAAc,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,WAAW,CAAC;IACxE,SAAS,EAAE,CAAC,OAAO,EAAE,WAAW,CAAC;CAClC,CAAA;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,YAAY;IACZ,UAAU;IACV,gBAAgB;IAChB,cAAc;IACd,eAAe;IACf,OAAO;IACP,aAAa;IACb,eAAe;IACf,aAAa;IACb,MAAM;IACN,UAAU;IACV,MAAM;IACN,SAAS;IACT,gBAAgB;IAChB,gBAAgB;IAChB,SAAS;IACT,OAAO;IACP,QAAQ;IACR,cAAc;IACd,UAAU;IACV,OAAO;IACP,MAAM;IACN,UAAU;IACV,cAAc;IACd,WAAW;CACH,CAAA"}
@@ -1,235 +0,0 @@
1
- /**
2
- * Ecommerce Type Definitions
3
- * Ported from zendesk-embedded-widget/app/src/types/ecommerce.ts
4
- */
5
- export interface Price {
6
- currency: string;
7
- amount: number;
8
- precise: number;
9
- rounded: string;
10
- formatted: string;
11
- }
12
- export interface Address {
13
- id: string;
14
- type: 'address';
15
- first_name: string;
16
- last_name: string;
17
- phone: string;
18
- line_1: string;
19
- line_2: string;
20
- city: string;
21
- region: string;
22
- postcode: string;
23
- country: string;
24
- meta?: {
25
- entity_id: string;
26
- };
27
- }
28
- export type DataFieldType = 'data_boolean' | 'data_text' | 'data_pill' | 'data_badge' | 'data_price' | 'data_highlight' | 'data_datestamp';
29
- export interface DataField {
30
- identifier: string;
31
- type: DataFieldType;
32
- value: unknown;
33
- editable?: boolean;
34
- label?: string;
35
- }
36
- export interface Customer {
37
- id: string;
38
- url: string;
39
- type: 'guest' | 'registered';
40
- name: string;
41
- status?: string;
42
- first_name: string;
43
- last_name: string;
44
- email: string;
45
- phone: string;
46
- data: Array<{
47
- data: DataField[];
48
- provider: string;
49
- }>;
50
- meta: {
51
- tags: {
52
- data: string[];
53
- };
54
- entity_id: string;
55
- total_orders: string;
56
- };
57
- relationships: {
58
- notes: Array<{
59
- id: string;
60
- type: 'note';
61
- messages: string[];
62
- editable: boolean;
63
- }>;
64
- metadata: Array<{
65
- identifier: string;
66
- data: DataField[];
67
- }>;
68
- addresses: Address[];
69
- };
70
- }
71
- export interface OrderStatus {
72
- vendor: string;
73
- color: string;
74
- abbreviation: string;
75
- label: string;
76
- }
77
- export interface OrderStatuses {
78
- note: string;
79
- alerts: unknown[];
80
- isPaid: boolean;
81
- isShipped: boolean;
82
- isRefunded: boolean;
83
- isCancelled: boolean;
84
- isRefundable: boolean;
85
- hasBalanceOwed: boolean;
86
- isCancellable: boolean;
87
- isModifiable: boolean;
88
- order: OrderStatus;
89
- payment: OrderStatus;
90
- shipping: OrderStatus;
91
- refund: OrderStatus;
92
- }
93
- export interface OrderItem {
94
- id: string;
95
- type: 'order_item' | 'custom_item';
96
- sku: string;
97
- name: string;
98
- quantity: number;
99
- refunded: number;
100
- modified?: number;
101
- url?: string;
102
- statuses?: {
103
- isShipped: boolean;
104
- isModifiable: boolean;
105
- };
106
- meta: {
107
- entity_id?: string;
108
- timestamps: {
109
- created_at: string;
110
- updated_at: string;
111
- };
112
- actions?: Array<{
113
- id: string;
114
- type: string;
115
- label: {
116
- key: string;
117
- };
118
- url?: string;
119
- }>;
120
- product?: unknown;
121
- price_mode?: string;
122
- display_price: {
123
- with_tax: {
124
- unit: Price;
125
- value: Price;
126
- };
127
- without_tax: {
128
- unit: Price;
129
- value: Price;
130
- };
131
- tax: {
132
- unit: Price;
133
- value: Price;
134
- };
135
- };
136
- discount_price?: {
137
- with_tax: {
138
- unit: Price;
139
- value: Price;
140
- };
141
- without_tax: {
142
- unit: Price;
143
- value: Price;
144
- };
145
- tax: {
146
- unit: Price;
147
- value: Price;
148
- };
149
- };
150
- vendor?: string;
151
- };
152
- relationships?: {
153
- shipping?: {
154
- parcels?: Array<{
155
- id: string;
156
- shipment_status: string;
157
- trackings: Array<{
158
- tracking_number: string;
159
- carrier: string;
160
- carrier_code: string;
161
- service_code?: string;
162
- url?: string;
163
- }>;
164
- name?: string;
165
- timestamps?: {
166
- created_at: string;
167
- };
168
- }>;
169
- };
170
- };
171
- }
172
- export interface Shipment {
173
- id: string;
174
- shipping_address: Address;
175
- }
176
- export interface OrderAction {
177
- id: string;
178
- type: 'order_action';
179
- label: {
180
- key: string;
181
- };
182
- url?: string;
183
- confirm?: boolean;
184
- }
185
- export interface Order {
186
- id: string;
187
- type: 'order';
188
- url: string;
189
- transaction_id: string;
190
- statuses: OrderStatuses;
191
- actions?: OrderAction[];
192
- billing_address?: Address;
193
- shipments: Shipment[];
194
- relationships: {
195
- items: {
196
- data: OrderItem[];
197
- };
198
- transactions?: {
199
- data: unknown[];
200
- };
201
- customer: {
202
- data: {
203
- type: 'customer';
204
- id: string;
205
- url: string;
206
- name: string;
207
- phone: string;
208
- email: string;
209
- };
210
- };
211
- };
212
- meta: {
213
- timestamps: {
214
- created_at: string;
215
- updated_at: string;
216
- };
217
- tax_mode: string;
218
- entity_id: string;
219
- tags: {
220
- data: string[];
221
- };
222
- display_price: {
223
- with_tax: Price;
224
- without_tax: Price;
225
- tax: Price;
226
- };
227
- display_balance_price?: {
228
- with_tax: Price;
229
- };
230
- refundable_balance_price?: {
231
- with_tax: Price;
232
- };
233
- };
234
- display_status?: OrderStatus;
235
- }
package/dist/ecommerce.js DELETED
@@ -1,6 +0,0 @@
1
- /**
2
- * Ecommerce Type Definitions
3
- * Ported from zendesk-embedded-widget/app/src/types/ecommerce.ts
4
- */
5
- export {};
6
- //# sourceMappingURL=ecommerce.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ecommerce.js","sourceRoot":"","sources":["../src/ecommerce.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,OAAO,CAAA;AACrB,cAAc,OAAO,CAAA;AACrB,cAAc,cAAc,CAAA;AAC5B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,YAAY,CAAA;AAC1B,cAAc,eAAe,CAAA;AAC7B,cAAc,YAAY,CAAA;AAC1B,cAAc,eAAe,CAAA;AAC7B,cAAc,WAAW,CAAA;AACzB,cAAc,OAAO,CAAA;AACrB,cAAc,aAAa,CAAA"}
@@ -1,13 +0,0 @@
1
- /**
2
- * Instance Contract
3
- * Shared types for extension instances used by both host and admin.
4
- */
5
- export type Theme = 'light' | 'dark';
6
- export type InstanceSettings = {
7
- theme?: Theme;
8
- } & Record<string, unknown>;
9
- export interface InstanceOption {
10
- id: string;
11
- name: string;
12
- settings?: InstanceSettings;
13
- }
package/dist/instance.js DELETED
@@ -1,6 +0,0 @@
1
- /**
2
- * Instance Contract
3
- * Shared types for extension instances used by both host and admin.
4
- */
5
- export {};
6
- //# sourceMappingURL=instance.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"instance.js","sourceRoot":"","sources":["../src/instance.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
@@ -1,42 +0,0 @@
1
- /**
2
- * Extension Manifest Schema
3
- * Declared by extension developers in manifest.json.
4
- */
5
- import type { Permission } from './permissions';
6
- /**
7
- * An extension point target identifier (e.g. "slot.header").
8
- * Apps define which targets they expose; this is not a fixed list.
9
- */
10
- export type Target = string;
11
- export interface ExtensionManifest {
12
- /** Human-readable extension name */
13
- name: string;
14
- /** Semver version string */
15
- version: string;
16
- /** Extension point targets this extension renders into */
17
- targets: string[];
18
- /** Permissions required by this extension */
19
- permissions: Permission[];
20
- /**
21
- * Hostnames this extension is permitted to reach via data.fetch.
22
- * Example: ["api.myservice.com", "cdn.myservice.com"]
23
- * Must be exact hostname strings — no wildcards, no paths.
24
- * Use an empty array for extensions that do not use data.fetch.
25
- */
26
- allowedDomains: string[];
27
- }
28
- /**
29
- * Registry entry for an installed extension (returned by /api/extensions).
30
- */
31
- export interface ExtensionRegistryEntry {
32
- /** Unique extension ID */
33
- id: string;
34
- /** Extension manifest */
35
- manifest: ExtensionManifest;
36
- /** URL to the extension's JS bundle */
37
- bundleUrl: string;
38
- /** Whether the extension is enabled */
39
- enabled: boolean;
40
- /** URL to the extension icon */
41
- iconUrl?: string;
42
- }
package/dist/manifest.js DELETED
@@ -1,6 +0,0 @@
1
- /**
2
- * Extension Manifest Schema
3
- * Declared by extension developers in manifest.json.
4
- */
5
- export {};
6
- //# sourceMappingURL=manifest.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"manifest.js","sourceRoot":"","sources":["../src/manifest.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
@@ -1,7 +0,0 @@
1
- import type { MarketplaceMetadata } from '@stackable-labs/lib-contracts';
2
- import type { ExtensionRegistryEntry } from './manifest';
3
- export type { MarketplaceMetadata, ExtensionCategory, ExtensionVisibility } from '@stackable-labs/lib-contracts';
4
- export { EXTENSION_CATEGORIES, EXTENSION_VISIBILITIES } from '@stackable-labs/lib-contracts';
5
- /** Full extension with marketplace fields — stays here because it extends ExtensionRegistryEntry */
6
- export interface MarketplaceExtension extends ExtensionRegistryEntry, MarketplaceMetadata {
7
- }
@@ -1,2 +0,0 @@
1
- export { EXTENSION_CATEGORIES, EXTENSION_VISIBILITIES } from '@stackable-labs/lib-contracts';
2
- //# sourceMappingURL=marketplace.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"marketplace.js","sourceRoot":"","sources":["../src/marketplace.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAA"}
@@ -1,11 +0,0 @@
1
- /**
2
- * Permissions Contract
3
- * Extensions declare required permissions in their manifest.
4
- * Host enforces: capability calls must be a subset of granted permissions.
5
- */
6
- export declare const PERMISSIONS: readonly ["context:read", "data:query", "data:fetch", "actions:toast", "actions:invoke"];
7
- export type Permission = (typeof PERMISSIONS)[number];
8
- /**
9
- * Maps capability types to the permission required to use them.
10
- */
11
- export declare const CAPABILITY_PERMISSION_MAP: Record<string, Permission>;
@@ -1,23 +0,0 @@
1
- /**
2
- * Permissions Contract
3
- * Extensions declare required permissions in their manifest.
4
- * Host enforces: capability calls must be a subset of granted permissions.
5
- */
6
- export const PERMISSIONS = [
7
- 'context:read',
8
- 'data:query',
9
- 'data:fetch',
10
- 'actions:toast',
11
- 'actions:invoke'
12
- ];
13
- /**
14
- * Maps capability types to the permission required to use them.
15
- */
16
- export const CAPABILITY_PERMISSION_MAP = {
17
- 'context.read': 'context:read',
18
- 'data.query': 'data:query',
19
- 'data.fetch': 'data:fetch',
20
- 'actions.toast': 'actions:toast',
21
- 'actions.invoke': 'actions:invoke',
22
- };
23
- //# sourceMappingURL=permissions.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"permissions.js","sourceRoot":"","sources":["../src/permissions.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,cAAc;IACd,YAAY;IACZ,YAAY;IACZ,eAAe;IACf,gBAAgB;CACR,CAAA;AAIV;;GAEG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAA+B;IACnE,cAAc,EAAE,cAAc;IAC9B,YAAY,EAAE,YAAY;IAC1B,YAAY,EAAE,YAAY;IAC1B,eAAe,EAAE,eAAe;IAChC,gBAAgB,EAAE,gBAAgB;CACnC,CAAA"}
package/dist/rpc.d.ts DELETED
@@ -1,38 +0,0 @@
1
- /**
2
- * RPC Protocol Types
3
- * Messages exchanged between sandbox (extension) and host for capability calls.
4
- */
5
- import type { CapabilityType } from './capabilities';
6
- /** Request from extension sandbox to host */
7
- export interface CapabilityRequest {
8
- type: 'capability-request';
9
- id: string;
10
- extensionId: string;
11
- capability: CapabilityType;
12
- payload: unknown;
13
- }
14
- /** Response from host to extension sandbox */
15
- export interface CapabilityResponse {
16
- type: 'capability-response';
17
- id: string;
18
- success: boolean;
19
- data?: unknown;
20
- error?: string;
21
- }
22
- /** All message types that can be sent between host and sandbox */
23
- export type HostToSandboxMessage = {
24
- type: 'surface-lifecycle';
25
- data: import('./surface.js').SurfaceLifecycleMessage;
26
- } | CapabilityResponse | {
27
- type: 'context-update';
28
- surfaceId: string;
29
- context: Record<string, unknown>;
30
- };
31
- export type SandboxToHostMessage = CapabilityRequest | {
32
- type: 'surface-ready';
33
- extensionId: string;
34
- surfaceId: string;
35
- } | {
36
- type: 'extension-ready';
37
- extensionId: string;
38
- };
package/dist/rpc.js DELETED
@@ -1,6 +0,0 @@
1
- /**
2
- * RPC Protocol Types
3
- * Messages exchanged between sandbox (extension) and host for capability calls.
4
- */
5
- export {};
6
- //# sourceMappingURL=rpc.js.map
package/dist/rpc.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"rpc.js","sourceRoot":"","sources":["../src/rpc.ts"],"names":[],"mappings":"AAAA;;;GAGG"}