@agentshouse/app-bridge 0.1.0-alpha.9 → 0.1.0-c094380be07ea

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.
Files changed (69) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +21 -79
  3. package/dist/calls.d.ts +117 -0
  4. package/dist/calls.js +1 -0
  5. package/dist/index.d.ts +152 -0
  6. package/dist/index.js +1 -0
  7. package/dist/mdmodel/blocks.d.ts +10 -0
  8. package/dist/mdmodel/condition.d.ts +149 -0
  9. package/dist/mdmodel/definition.d.ts +65 -0
  10. package/dist/mdmodel/divide.d.ts +2 -0
  11. package/dist/mdmodel/document.d.ts +15 -0
  12. package/dist/mdmodel/fields.d.ts +5 -0
  13. package/dist/mdmodel/index.d.ts +18 -0
  14. package/dist/mdmodel/paths.d.ts +17 -0
  15. package/dist/mdmodel/profile.d.ts +5 -0
  16. package/dist/mdmodel/project.d.ts +20 -0
  17. package/dist/mdmodel/references.d.ts +3 -0
  18. package/dist/mdmodel/types.d.ts +143 -0
  19. package/dist/mdmodel/validate.d.ts +7 -0
  20. package/dist/mdmodel/version.d.ts +1 -0
  21. package/dist/mdmodel/yaml.d.ts +55 -0
  22. package/dist/mdruntime/acquisition.d.ts +13 -0
  23. package/dist/mdruntime/adapter.d.ts +477 -0
  24. package/dist/mdruntime/binary.d.ts +22 -0
  25. package/dist/mdruntime/change-set.d.ts +34 -0
  26. package/dist/mdruntime/change.d.ts +88 -0
  27. package/dist/mdruntime/client.d.ts +81 -0
  28. package/dist/mdruntime/collection.d.ts +38 -0
  29. package/dist/mdruntime/connection.d.ts +138 -0
  30. package/dist/mdruntime/conversation.d.ts +103 -0
  31. package/dist/mdruntime/durability.d.ts +14 -0
  32. package/dist/mdruntime/failure.d.ts +12 -0
  33. package/dist/mdruntime/file.d.ts +19 -0
  34. package/dist/mdruntime/model.d.ts +56 -0
  35. package/dist/mdruntime/observation.d.ts +29 -0
  36. package/dist/mdruntime/open.d.ts +1 -0
  37. package/dist/mdruntime/outcome.d.ts +46 -0
  38. package/dist/mdruntime/overlay.d.ts +26 -0
  39. package/dist/mdruntime/query.d.ts +246 -0
  40. package/dist/mdruntime/reach.d.ts +45 -0
  41. package/dist/mdruntime/readiness.d.ts +52 -0
  42. package/dist/mdruntime/recovery.d.ts +24 -0
  43. package/dist/mdruntime/replica.d.ts +45 -0
  44. package/dist/mdruntime/room-draft.d.ts +143 -0
  45. package/dist/mdruntime/rows.d.ts +36 -0
  46. package/dist/mdruntime/save.d.ts +63 -0
  47. package/dist/mdruntime/search.d.ts +83 -0
  48. package/dist/mdruntime/shared.d.ts +10 -0
  49. package/dist/mdruntime/status.d.ts +26 -0
  50. package/dist/mdruntime/store.d.ts +159 -0
  51. package/dist/mdruntime/transfer.d.ts +9 -0
  52. package/dist/mdruntime/turn.d.ts +6 -0
  53. package/dist/mdruntime/wire.d.ts +104 -0
  54. package/dist/test-host.d.ts +33 -0
  55. package/dist/test-host.js +200 -0
  56. package/docs/families.md +136 -0
  57. package/package.json +11 -14
  58. package/client/src/bridge.d.ts +0 -35
  59. package/client/src/bridge.js +0 -229
  60. package/client/src/index.d.ts +0 -3
  61. package/client/src/index.js +0 -2
  62. package/client/src/test-host.d.ts +0 -30
  63. package/client/src/test-host.js +0 -159
  64. package/client/src/wire.d.ts +0 -69
  65. package/client/src/wire.js +0 -1
  66. package/src/apps/remainder.d.ts +0 -2
  67. package/src/apps/remainder.js +0 -16
  68. package/src/apps/tab.d.ts +0 -6
  69. package/src/apps/tab.js +0 -27
@@ -1,69 +0,0 @@
1
- import type { TabChange } from '../../src/apps/tab.js';
2
- export interface HouseBridgeEvent {
3
- readonly data: unknown;
4
- readonly ports: readonly HouseMessagePort[];
5
- }
6
- export interface HouseMessagePort {
7
- postMessage(message: unknown): void;
8
- addEventListener(type: 'message', listener: (event: HouseBridgeEvent) => void): void;
9
- start(): void;
10
- }
11
- export type HouseBridgePort = HouseMessagePort;
12
- export interface HouseSyncState {
13
- readonly state: string;
14
- readonly providerUnreachable: boolean;
15
- }
16
- export interface HouseCredentialState {
17
- readonly state: 'none' | 'held' | 'rejected';
18
- readonly expires_at: number | null;
19
- }
20
- export type HouseGaChoice = 'accept' | 'decline';
21
- export interface HouseGa {
22
- readonly measures: boolean;
23
- readonly choice: HouseGaChoice | null;
24
- }
25
- export interface HouseStatus {
26
- readonly app: string;
27
- readonly runtime: string;
28
- readonly credential: HouseCredentialState;
29
- readonly sync: HouseSyncState | null;
30
- readonly refusal: {
31
- readonly reason: string;
32
- } | null;
33
- readonly loss: string | null;
34
- readonly release: unknown;
35
- readonly ga: HouseGa;
36
- readonly service_mode: 'open' | 'write-halted' | null;
37
- }
38
- export type HouseNavigationMode = 'push' | 'replace';
39
- interface HouseRelease {
40
- readonly app_ref: string;
41
- readonly release: string;
42
- }
43
- export interface HouseSourceTop extends HouseRelease {
44
- readonly folders: readonly string[];
45
- readonly files: readonly {
46
- readonly name: string;
47
- readonly size: number;
48
- }[];
49
- readonly readme: string | null;
50
- }
51
- export type HouseSourceFile = {
52
- readonly path: string;
53
- readonly size: number;
54
- } & ({
55
- readonly text: string;
56
- } | {
57
- readonly base64: string;
58
- });
59
- export interface HouseSourceDownload extends HouseRelease {
60
- readonly files: readonly HouseSourceFile[];
61
- }
62
- export interface HouseSourceRefusal {
63
- readonly error: {
64
- readonly code: string;
65
- };
66
- }
67
- export type HouseTab = TabChange;
68
- export declare const HOUSE_ADDRESS_MAX_CHARS = 1000;
69
- export {};
@@ -1 +0,0 @@
1
- export const HOUSE_ADDRESS_MAX_CHARS = 1000;
@@ -1,2 +0,0 @@
1
- export declare function appAddressOf(root: string, address: string): string;
2
- export declare function shellAddressOf(root: string, appAddress: string): string;
@@ -1,16 +0,0 @@
1
- function split(address) {
2
- const mark = address.search(/[?#]/u);
3
- return mark < 0
4
- ? { path: address, rest: '' }
5
- : { path: address.slice(0, mark), rest: address.slice(mark) };
6
- }
7
- export function appAddressOf(root, address) {
8
- const { path, rest } = split(address);
9
- const below = root === '/' ? path : path.slice(root.length);
10
- return `${below.startsWith('/') ? below : `/${below}`}${rest}`;
11
- }
12
- export function shellAddressOf(root, appAddress) {
13
- const { path, rest } = split(appAddress);
14
- const below = path === '/' ? '' : path;
15
- return `${root === '/' ? '' : root}${below}${rest}` || '/';
16
- }
package/src/apps/tab.d.ts DELETED
@@ -1,6 +0,0 @@
1
- export declare const TAB_IMAGE: RegExp;
2
- export interface TabChange {
3
- readonly title?: string;
4
- readonly icon?: string;
5
- }
6
- export declare function tabChange(asked: unknown): TabChange | null;
package/src/apps/tab.js DELETED
@@ -1,27 +0,0 @@
1
- const TAB_TITLE_MAX_CHARS = 200;
2
- const TAB_ICON_MAX_CHARS = 1_048_576;
3
- function caseless(text) {
4
- return text.replace(/[a-z]/gu, (letter) => `[${letter}${letter.toUpperCase()}]`);
5
- }
6
- export const TAB_IMAGE = new RegExp(`^${caseless('data:image/')}(?:svg\\+xml|${['png', 'gif', 'webp'].map(caseless).join('|')});${caseless('base64')},[A-Za-z0-9+/]+={0,2}$`, 'u');
7
- function admittedTitle(title) {
8
- return typeof title === 'string' && title.length <= TAB_TITLE_MAX_CHARS;
9
- }
10
- function admittedIcon(icon) {
11
- return typeof icon === 'string' && icon.length <= TAB_ICON_MAX_CHARS && TAB_IMAGE.test(icon);
12
- }
13
- export function tabChange(asked) {
14
- if (asked === null || typeof asked !== 'object')
15
- return null;
16
- const { title, icon } = asked;
17
- if (title === undefined && icon === undefined)
18
- return null;
19
- if (title !== undefined && !admittedTitle(title))
20
- return null;
21
- if (icon !== undefined && !admittedIcon(icon))
22
- return null;
23
- return {
24
- ...(title === undefined ? {} : { title: title }),
25
- ...(icon === undefined ? {} : { icon: icon }),
26
- };
27
- }