@fungi.computer/puffball 0.0.0-stage → 0.0.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.
Files changed (110) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +443 -2
  3. package/dist/app-api.d.ts +7 -0
  4. package/dist/app-api.js +61 -0
  5. package/dist/app-backend-binding-vocabulary.d.ts +299 -0
  6. package/dist/app-backend-binding-vocabulary.js +257 -0
  7. package/dist/app-backend-bindings.d.ts +21 -0
  8. package/dist/app-backend-bindings.js +47 -0
  9. package/dist/app-declaration.d.ts +46 -0
  10. package/dist/app-declaration.js +115 -0
  11. package/dist/app-event-facts.d.ts +40 -0
  12. package/dist/app-event-facts.js +28 -0
  13. package/dist/app-method-context.d.ts +109 -0
  14. package/dist/app-method-context.js +9 -0
  15. package/dist/app-method-runtime.d.ts +86 -0
  16. package/dist/app-method-runtime.js +122 -0
  17. package/dist/app-origin-paths.d.ts +6 -0
  18. package/dist/app-origin-paths.js +6 -0
  19. package/dist/app-vocabulary.d.ts +189 -0
  20. package/dist/app-vocabulary.js +103 -0
  21. package/dist/app.d.ts +379 -0
  22. package/dist/app.js +71 -0
  23. package/dist/artifact-dispositions.d.ts +115 -0
  24. package/dist/artifact-dispositions.js +234 -0
  25. package/dist/assets.d.ts +54 -0
  26. package/dist/assets.js +89 -0
  27. package/dist/backend.d.ts +41 -0
  28. package/dist/backend.js +29 -0
  29. package/dist/background-replay.d.ts +115 -0
  30. package/dist/background-replay.js +175 -0
  31. package/dist/buyer-references.d.ts +69 -0
  32. package/dist/buyer-references.js +154 -0
  33. package/dist/cloudflare-assets.d.ts +48 -0
  34. package/dist/cloudflare-assets.js +105 -0
  35. package/dist/cloudflare.d.ts +254 -0
  36. package/dist/cloudflare.js +1619 -0
  37. package/dist/effect.d.ts +73 -0
  38. package/dist/effect.js +325 -0
  39. package/dist/git-representation.d.ts +13 -0
  40. package/dist/git-representation.js +16 -0
  41. package/dist/inbox.d.ts +132 -0
  42. package/dist/inbox.js +81 -0
  43. package/dist/index.d.ts +31 -0
  44. package/dist/index.js +85 -0
  45. package/dist/internal/app-description.d.ts +14 -0
  46. package/dist/internal/app-description.js +98 -0
  47. package/dist/internal/app-release-artifact-reader.d.ts +26 -0
  48. package/dist/internal/app-release-artifact-reader.js +1 -0
  49. package/dist/internal/app-release-contract.d.ts +540 -0
  50. package/dist/internal/app-release-contract.js +169 -0
  51. package/dist/internal/app-release-schema.d.ts +1676 -0
  52. package/dist/internal/app-release-schema.js +386 -0
  53. package/dist/internal/app-release-store.d.ts +47 -0
  54. package/dist/internal/app-release-store.js +1 -0
  55. package/dist/internal/background-sync.d.ts +7 -0
  56. package/dist/internal/background-sync.js +10 -0
  57. package/dist/internal/deterministic-memory-app-release-store.d.ts +14 -0
  58. package/dist/internal/deterministic-memory-app-release-store.js +319 -0
  59. package/dist/internal/failure.d.ts +2 -0
  60. package/dist/internal/failure.js +9 -0
  61. package/dist/internal/immutable-release-material.d.ts +3 -0
  62. package/dist/internal/immutable-release-material.js +13 -0
  63. package/dist/internal/promise-app-release-store-adapter.d.ts +9 -0
  64. package/dist/internal/promise-app-release-store-adapter.js +65 -0
  65. package/dist/internal/promise-artifact-reader-adapter.d.ts +9 -0
  66. package/dist/internal/promise-artifact-reader-adapter.js +18 -0
  67. package/dist/internal/public-route-sql.d.ts +10 -0
  68. package/dist/internal/public-route-sql.js +239 -0
  69. package/dist/internal/public-website-authority.d.ts +338 -0
  70. package/dist/internal/public-website-authority.js +50 -0
  71. package/dist/internal/public-website-delivery.d.ts +59 -0
  72. package/dist/internal/public-website-delivery.js +232 -0
  73. package/dist/internal/public-website-fetch.d.ts +8 -0
  74. package/dist/internal/public-website-fetch.js +54 -0
  75. package/dist/internal/release-transition-material.d.ts +3 -0
  76. package/dist/internal/release-transition-material.js +11 -0
  77. package/dist/internal/verified-artifact-snapshot.d.ts +41 -0
  78. package/dist/internal/verified-artifact-snapshot.js +91 -0
  79. package/dist/public-route-moderation.d.ts +83 -0
  80. package/dist/public-route-moderation.js +236 -0
  81. package/dist/public-route-policy.d.ts +51 -0
  82. package/dist/public-route-policy.js +88 -0
  83. package/dist/public-routes.d.ts +34 -0
  84. package/dist/public-routes.js +136 -0
  85. package/dist/publisher.d.ts +61 -0
  86. package/dist/publisher.js +16 -0
  87. package/dist/safety-takedown.d.ts +56 -0
  88. package/dist/safety-takedown.js +146 -0
  89. package/dist/seller-closure-notice.d.ts +14 -0
  90. package/dist/seller-closure-notice.js +14 -0
  91. package/dist/seller-closure.d.ts +15 -0
  92. package/dist/seller-closure.js +31 -0
  93. package/dist/testing.d.ts +8 -0
  94. package/dist/testing.js +47 -0
  95. package/docs/api/README.md +26 -0
  96. package/docs/api/app-backend-binding-vocabulary.md +276 -0
  97. package/docs/api/app-backend-bindings.md +141 -0
  98. package/docs/api/app-event-facts.md +110 -0
  99. package/docs/api/app-method-context.md +166 -0
  100. package/docs/api/app-method-runtime.md +330 -0
  101. package/docs/api/backend.md +108 -0
  102. package/docs/api/background-replay.md +516 -0
  103. package/docs/api/cloudflare.md +1044 -0
  104. package/docs/api/effect.md +2429 -0
  105. package/docs/api/git-representation.md +56 -0
  106. package/docs/api/inbox.md +289 -0
  107. package/docs/api/index.md +2868 -0
  108. package/docs/api/publisher.md +147 -0
  109. package/docs/api/testing.md +31 -0
  110. package/package.json +158 -3
@@ -0,0 +1,189 @@
1
+ import type { AppDeclaredGill } from "@fungi.computer/gills";
2
+ /**
3
+ * Roles a user may assign to an App: the shell routes "open my inbox", file
4
+ * navigation, media and Session conversations to the App the Team chose.
5
+ * `dashboard` marks an App that can open as a Team's dashboard; the Team's
6
+ * shell selection, not a role choice, picks among them.
7
+ * Extend this list here; the Hub role projection then requires the new role.
8
+ * A role's intent and payload wire format lives in `@fungi.computer/agar/roles`.
9
+ */
10
+ export declare const appRoles: readonly ["dashboard", "inbox", "files", "media", "sessions", "terminal"];
11
+ /** One assignable App role. */
12
+ export type AppRole = (typeof appRoles)[number];
13
+ /** The directory facts role resolution needs from one listed App. */
14
+ export type RoleCandidate = Readonly<{
15
+ surfaceId: string;
16
+ availability: "available" | "unavailable";
17
+ roles: readonly AppRole[];
18
+ }>;
19
+ /** One role's effective App and whether the Team chose it. */
20
+ export type EffectiveAppRole = Readonly<{
21
+ surfaceId: string | null;
22
+ chosen: boolean;
23
+ }>;
24
+ /**
25
+ * Project committed role choices onto the Apps a directory lists now. A
26
+ * choice is a routing preference, never a grant. When no choice exists, or
27
+ * the chosen App no longer declares the role or is unavailable, the
28
+ * effective holder is the first available listed App declaring that role
29
+ * (see ADR "no-privileged-apps-and-app-roles").
30
+ */
31
+ export declare function resolveAppRoles(choices: ReadonlyMap<AppRole, string>, candidates: readonly RoleCandidate[]): {
32
+ dashboard: Readonly<{
33
+ surfaceId: string | null;
34
+ chosen: boolean;
35
+ }>;
36
+ inbox: Readonly<{
37
+ surfaceId: string | null;
38
+ chosen: boolean;
39
+ }>;
40
+ files: Readonly<{
41
+ surfaceId: string | null;
42
+ chosen: boolean;
43
+ }>;
44
+ media: Readonly<{
45
+ surfaceId: string | null;
46
+ chosen: boolean;
47
+ }>;
48
+ sessions: Readonly<{
49
+ surfaceId: string | null;
50
+ chosen: boolean;
51
+ }>;
52
+ terminal: Readonly<{
53
+ surfaceId: string | null;
54
+ chosen: boolean;
55
+ }>;
56
+ };
57
+ /**
58
+ * Host capabilities an App may request. A request is never authority; the
59
+ * Team's installation grants decide. Extend this list here.
60
+ */
61
+ export declare const appCapabilityIds: readonly ["agent.list", "agent.manage", "agent.rename", "agent.toolPolicy", "agent.read", "agent.send", "computer.list", "computer.readFile", "computer.writeFile", "computer.execute", "llm.generation", "media.generation", "games:servers", "git.repository", "apps.open", "apps.call", "app.storage", "app.events.emit", "team.workbenchHost", "marketplace.browse", "marketplace.purchase", "workflow.run", "workflow.publish", "workflow.arm", "world", "channels.read", "channels.personal.manage"];
62
+ /** One requestable host capability id. */
63
+ export type AppCapabilityId = (typeof appCapabilityIds)[number];
64
+ /** Backend requests are narrower than the App capabilities a Team approves. */
65
+ export type { AppBackendBinding } from "./app-backend-binding-vocabulary.js";
66
+ import type { AppBackendBinding } from "./app-backend-binding-vocabulary.js";
67
+ /** Build-generated method and event metadata. This data-only projection grants no authority. */
68
+ export type AppApi = Readonly<{
69
+ methods: Readonly<Record<string, Readonly<{
70
+ description: string;
71
+ input: object;
72
+ output: object;
73
+ effect: "read" | "write" | "external";
74
+ requires: readonly AppCapabilityId[];
75
+ /** This method may return Agar's shared Pending result while working. */
76
+ pending?: true | undefined;
77
+ /** Omit from Workflow and tool discovery, without changing direct-call authority. */
78
+ hidden?: true | undefined;
79
+ /** Request anonymous read admission; declaration alone grants no authority. */
80
+ anonymous?: true | undefined;
81
+ }>>>;
82
+ /** A signed dynamic tool namespace; its methods remain subject to ordinary admission. */
83
+ toolFamily?: Readonly<{
84
+ name: string;
85
+ list: string;
86
+ call: string;
87
+ }>;
88
+ /** Declared event payload schemas; hosts validate emits against the selected Release. */
89
+ events?: Readonly<Record<string, Readonly<{
90
+ description: string;
91
+ payload: object;
92
+ }>>>;
93
+ }>;
94
+ /** Navigation requests an App can handle for the shell. */
95
+ export declare const appHandlers: readonly ["file.open"];
96
+ /** One shell navigation request an App can handle. */
97
+ export type AppHandler = (typeof appHandlers)[number];
98
+ /**
99
+ * One command an App declares so the backend can advertise it before the App
100
+ * is open: the identity, labels and projections of a Whistle definition.
101
+ * Availability, typed action schemas and slash argument grammars are runtime
102
+ * facts the mounted App registers, so they are not part of the declaration.
103
+ */
104
+ export type AppDeclaredCommand = Readonly<{
105
+ id: string;
106
+ title: string;
107
+ category: string;
108
+ description?: string | undefined;
109
+ /** Optional Sigil to use in command rows. */
110
+ sigil?: string | undefined;
111
+ projections?: Readonly<{
112
+ bindings?: (Readonly<{
113
+ order?: number | undefined;
114
+ }> & Readonly<{
115
+ values: readonly string[];
116
+ }>) | undefined;
117
+ agent?: (Readonly<{
118
+ order?: number | undefined;
119
+ }> & Readonly<{
120
+ keybind?: string | undefined;
121
+ }>) | undefined;
122
+ help?: Readonly<{
123
+ order?: number | undefined;
124
+ }> | undefined;
125
+ menu?: Readonly<{
126
+ order?: number | undefined;
127
+ }> | undefined;
128
+ palette?: Readonly<{
129
+ order?: number | undefined;
130
+ }> | undefined;
131
+ slash?: (Readonly<{
132
+ order?: number | undefined;
133
+ }> & Readonly<{
134
+ aliases: readonly string[];
135
+ }>) | undefined;
136
+ }> | undefined;
137
+ }>;
138
+ /** A declared layer of the App's own JSON data; never a cross-Team scope. */
139
+ export declare const appStorageScopes: readonly ["team", "member"];
140
+ /** The shared Team default or the calling member's private override. */
141
+ export type AppStorageScope = (typeof appStorageScopes)[number];
142
+ /** One digest-covered key and the bounds its App agrees to use. */
143
+ export type AppStorageKey = Readonly<{
144
+ key: string;
145
+ scopes: readonly AppStorageScope[];
146
+ maxBytes: number;
147
+ }>;
148
+ /**
149
+ * What an App asks of the host, covered by its Release digest. Every App,
150
+ * first-party or not, uses this same declaration; there is no other source.
151
+ */
152
+ export type AppDeclaration = Readonly<{
153
+ /** Generated from the backend's typed method definitions during its build. */
154
+ api?: AppApi;
155
+ displayName?: string | undefined;
156
+ capabilities: readonly AppCapabilityId[];
157
+ /** Member-only calls to named Apps; a declaration never lends target grants. */
158
+ calls?: readonly Readonly<{
159
+ appId: string;
160
+ methods: readonly string[];
161
+ }>[] | undefined;
162
+ /**
163
+ * Instructions the App gives every Agent the Team has granted it. The Hub
164
+ * relays the text; it writes none of its own for any one App.
165
+ */
166
+ guidance?: string | undefined;
167
+ handlers: readonly AppHandler[];
168
+ /** Host-delivered lifecycle facts requested by this Release; never method names. */
169
+ receives?: readonly "git.push"[] | undefined;
170
+ icon?: string;
171
+ roles: readonly AppRole[];
172
+ /** Bounded, digest-covered keys for this installation’s own data. */
173
+ storage?: readonly AppStorageKey[] | undefined;
174
+ /** The App's command catalog; omitted when it declares none. */
175
+ commands?: readonly AppDeclaredCommand[] | undefined;
176
+ /** Compact data views are optional and remain bound to this Release digest. */
177
+ gills?: readonly AppDeclaredGill[] | undefined;
178
+ backend?: Readonly<{
179
+ bindings: readonly AppBackendBinding[];
180
+ /** Ordinary write continuation, freshly admitted as the retained member. */
181
+ sync?: Readonly<{
182
+ method: string;
183
+ }>;
184
+ }> | undefined;
185
+ }>;
186
+ /** The declaration of an App that asks for nothing. */
187
+ export declare const emptyAppDeclaration: AppDeclaration;
188
+ /** An empty declaration is omitted from the manifest to keep digests stable. */
189
+ export declare const isEmptyAppDeclaration: (declaration: AppDeclaration) => boolean;
@@ -0,0 +1,103 @@
1
+ /**
2
+ * Roles a user may assign to an App: the shell routes "open my inbox", file
3
+ * navigation, media and Session conversations to the App the Team chose.
4
+ * `dashboard` marks an App that can open as a Team's dashboard; the Team's
5
+ * shell selection, not a role choice, picks among them.
6
+ * Extend this list here; the Hub role projection then requires the new role.
7
+ * A role's intent and payload wire format lives in `@fungi.computer/agar/roles`.
8
+ */
9
+ export const appRoles = [
10
+ "dashboard",
11
+ "inbox",
12
+ "files",
13
+ "media",
14
+ "sessions",
15
+ "terminal",
16
+ ];
17
+ /**
18
+ * Project committed role choices onto the Apps a directory lists now. A
19
+ * choice is a routing preference, never a grant. When no choice exists, or
20
+ * the chosen App no longer declares the role or is unavailable, the
21
+ * effective holder is the first available listed App declaring that role
22
+ * (see ADR "no-privileged-apps-and-app-roles").
23
+ */
24
+ export function resolveAppRoles(choices, candidates) {
25
+ const fills = (candidate, role) => candidate.availability === "available" && candidate.roles.includes(role);
26
+ const resolve = (role) => {
27
+ const chosen = choices.get(role);
28
+ const selected = chosen === undefined
29
+ ? undefined
30
+ : candidates.find((candidate) => candidate.surfaceId === chosen && fills(candidate, role));
31
+ const effective = selected ?? candidates.find((candidate) => fills(candidate, role));
32
+ return {
33
+ surfaceId: effective?.surfaceId ?? null,
34
+ chosen: selected !== undefined,
35
+ };
36
+ };
37
+ // A new role in the vocabulary fails here until the directory projects it.
38
+ return {
39
+ dashboard: resolve("dashboard"),
40
+ inbox: resolve("inbox"),
41
+ files: resolve("files"),
42
+ media: resolve("media"),
43
+ sessions: resolve("sessions"),
44
+ terminal: resolve("terminal"),
45
+ };
46
+ }
47
+ /**
48
+ * Host capabilities an App may request. A request is never authority; the
49
+ * Team's installation grants decide. Extend this list here.
50
+ */
51
+ export const appCapabilityIds = [
52
+ "agent.list",
53
+ "agent.manage",
54
+ "agent.rename",
55
+ "agent.toolPolicy",
56
+ "agent.read",
57
+ "agent.send",
58
+ "computer.list",
59
+ "computer.readFile",
60
+ "computer.writeFile",
61
+ "computer.execute",
62
+ "llm.generation",
63
+ "media.generation",
64
+ "games:servers",
65
+ "git.repository",
66
+ "apps.open",
67
+ "apps.call",
68
+ "app.storage",
69
+ "app.events.emit",
70
+ "team.workbenchHost",
71
+ "marketplace.browse",
72
+ "marketplace.purchase",
73
+ "workflow.run",
74
+ "workflow.publish",
75
+ "workflow.arm",
76
+ "world",
77
+ "channels.read",
78
+ "channels.personal.manage",
79
+ ];
80
+ /** Navigation requests an App can handle for the shell. */
81
+ export const appHandlers = ["file.open"];
82
+ /** A declared layer of the App's own JSON data; never a cross-Team scope. */
83
+ export const appStorageScopes = ["team", "member"];
84
+ /** The declaration of an App that asks for nothing. */
85
+ export const emptyAppDeclaration = Object.freeze({
86
+ capabilities: [],
87
+ handlers: [],
88
+ roles: [],
89
+ });
90
+ /** An empty declaration is omitted from the manifest to keep digests stable. */
91
+ export const isEmptyAppDeclaration = (declaration) => declaration.api === undefined &&
92
+ declaration.displayName === undefined &&
93
+ declaration.capabilities.length === 0 &&
94
+ (declaration.calls?.length ?? 0) === 0 &&
95
+ declaration.handlers.length === 0 &&
96
+ (declaration.receives?.length ?? 0) === 0 &&
97
+ declaration.roles.length === 0 &&
98
+ declaration.icon === undefined &&
99
+ declaration.guidance === undefined &&
100
+ (declaration.commands?.length ?? 0) === 0 &&
101
+ (declaration.gills?.length ?? 0) === 0 &&
102
+ (declaration.storage?.length ?? 0) === 0 &&
103
+ (declaration.backend?.bindings.length ?? 0) === 0;
package/dist/app.d.ts ADDED
@@ -0,0 +1,379 @@
1
+ export { appMethodCallContextSchema, type AppMethodCallContext, type HostActor, type WorkflowAttestation, } from "./app-method-context.js";
2
+ export { appBackendBindingKinds, appBackendBindingOperation, scopeOperationToMethod, appBackendBindingsSchema, appBackendShardBindingsSchema, } from "./app-backend-bindings.js";
3
+ export type { AppBackendBindingMethod, AppBackendBindingName, AppBackendBindingOperation, } from "./app-backend-bindings.js";
4
+ import * as Schema from "effect/Schema";
5
+ export { appApiSchema, appApiReservedMethodNames, appApiMethodNameSchema, } from "./app-api.js";
6
+ export type { AppApi } from "./app-vocabulary.js";
7
+ import { type AppDeclaration } from "./app-vocabulary.js";
8
+ /** One immutable Release root binds every surface published by the App. */
9
+ export declare const appMediaType: "application/vnd.fungi.app+json";
10
+ declare const appUiBuildSchema: Schema.Struct<{
11
+ readonly mediaType: Schema.Literals<readonly ["text/html; charset=utf-8", "application/vnd.fungi.app-assets+json"]>;
12
+ readonly artifactRef: Schema.refine<import("./internal/app-release-contract.js").ArtifactRef, Schema.String>;
13
+ readonly digest: Schema.refine<import("./internal/app-release-contract.js").Sha256Digest, Schema.String>;
14
+ readonly version: Schema.String;
15
+ readonly byteLength: Schema.Number;
16
+ }>;
17
+ declare const appBackendBuildSchema: Schema.Struct<{
18
+ readonly mediaType: Schema.Literal<"application/vnd.fungi.app-backend+json">;
19
+ readonly artifactRef: Schema.refine<import("./internal/app-release-contract.js").ArtifactRef, Schema.String>;
20
+ readonly digest: Schema.refine<import("./internal/app-release-contract.js").Sha256Digest, Schema.String>;
21
+ readonly version: Schema.String;
22
+ readonly byteLength: Schema.Number;
23
+ }>;
24
+ /**
25
+ * Closed child formats prevent recursive manifests and independent selection.
26
+ * An App may be visual, headless, or both, but never empty.
27
+ */
28
+ export declare const appBuildSchema: Schema.Union<readonly [Schema.Struct<{
29
+ readonly declaration: Schema.optionalKey<Schema.Codec<Readonly<{
30
+ api?: import("./app-vocabulary.js").AppApi;
31
+ displayName?: string | undefined;
32
+ capabilities: readonly import("./app-vocabulary.js").AppCapabilityId[];
33
+ calls?: readonly Readonly<{
34
+ appId: string;
35
+ methods: readonly string[];
36
+ }>[] | undefined;
37
+ guidance?: string | undefined;
38
+ handlers: readonly import("./app-vocabulary.js").AppHandler[];
39
+ receives?: readonly "git.push"[] | undefined;
40
+ icon?: string;
41
+ roles: readonly import("./app-vocabulary.js").AppRole[];
42
+ storage?: readonly import("./app-vocabulary.js").AppStorageKey[] | undefined;
43
+ commands?: readonly import("./app-vocabulary.js").AppDeclaredCommand[] | undefined;
44
+ gills?: readonly import("@fungi.computer/gills").AppDeclaredGill[] | undefined;
45
+ backend?: Readonly<{
46
+ bindings: readonly import("./app-backend-binding-vocabulary.js").AppBackendBinding[];
47
+ sync?: Readonly<{
48
+ method: string;
49
+ }>;
50
+ }> | undefined;
51
+ }>, Readonly<{
52
+ api?: import("./app-vocabulary.js").AppApi;
53
+ displayName?: string | undefined;
54
+ capabilities: readonly import("./app-vocabulary.js").AppCapabilityId[];
55
+ calls?: readonly Readonly<{
56
+ appId: string;
57
+ methods: readonly string[];
58
+ }>[] | undefined;
59
+ guidance?: string | undefined;
60
+ handlers: readonly import("./app-vocabulary.js").AppHandler[];
61
+ receives?: readonly "git.push"[] | undefined;
62
+ icon?: string;
63
+ roles: readonly import("./app-vocabulary.js").AppRole[];
64
+ storage?: readonly import("./app-vocabulary.js").AppStorageKey[] | undefined;
65
+ commands?: readonly import("./app-vocabulary.js").AppDeclaredCommand[] | undefined;
66
+ gills?: readonly import("@fungi.computer/gills").AppDeclaredGill[] | undefined;
67
+ backend?: Readonly<{
68
+ bindings: readonly import("./app-backend-binding-vocabulary.js").AppBackendBinding[];
69
+ sync?: Readonly<{
70
+ method: string;
71
+ }>;
72
+ }> | undefined;
73
+ }>, never, never>>;
74
+ readonly format: Schema.Literal<"fungi-app-v1">;
75
+ readonly ui: Schema.Struct<{
76
+ readonly mediaType: Schema.Literals<readonly ["text/html; charset=utf-8", "application/vnd.fungi.app-assets+json"]>;
77
+ readonly artifactRef: Schema.refine<import("./internal/app-release-contract.js").ArtifactRef, Schema.String>;
78
+ readonly digest: Schema.refine<import("./internal/app-release-contract.js").Sha256Digest, Schema.String>;
79
+ readonly version: Schema.String;
80
+ readonly byteLength: Schema.Number;
81
+ }>;
82
+ readonly backend: Schema.Struct<{
83
+ readonly mediaType: Schema.Literal<"application/vnd.fungi.app-backend+json">;
84
+ readonly artifactRef: Schema.refine<import("./internal/app-release-contract.js").ArtifactRef, Schema.String>;
85
+ readonly digest: Schema.refine<import("./internal/app-release-contract.js").Sha256Digest, Schema.String>;
86
+ readonly version: Schema.String;
87
+ readonly byteLength: Schema.Number;
88
+ }>;
89
+ }>, Schema.Struct<{
90
+ readonly declaration: Schema.optionalKey<Schema.Codec<Readonly<{
91
+ api?: import("./app-vocabulary.js").AppApi;
92
+ displayName?: string | undefined;
93
+ capabilities: readonly import("./app-vocabulary.js").AppCapabilityId[];
94
+ calls?: readonly Readonly<{
95
+ appId: string;
96
+ methods: readonly string[];
97
+ }>[] | undefined;
98
+ guidance?: string | undefined;
99
+ handlers: readonly import("./app-vocabulary.js").AppHandler[];
100
+ receives?: readonly "git.push"[] | undefined;
101
+ icon?: string;
102
+ roles: readonly import("./app-vocabulary.js").AppRole[];
103
+ storage?: readonly import("./app-vocabulary.js").AppStorageKey[] | undefined;
104
+ commands?: readonly import("./app-vocabulary.js").AppDeclaredCommand[] | undefined;
105
+ gills?: readonly import("@fungi.computer/gills").AppDeclaredGill[] | undefined;
106
+ backend?: Readonly<{
107
+ bindings: readonly import("./app-backend-binding-vocabulary.js").AppBackendBinding[];
108
+ sync?: Readonly<{
109
+ method: string;
110
+ }>;
111
+ }> | undefined;
112
+ }>, Readonly<{
113
+ api?: import("./app-vocabulary.js").AppApi;
114
+ displayName?: string | undefined;
115
+ capabilities: readonly import("./app-vocabulary.js").AppCapabilityId[];
116
+ calls?: readonly Readonly<{
117
+ appId: string;
118
+ methods: readonly string[];
119
+ }>[] | undefined;
120
+ guidance?: string | undefined;
121
+ handlers: readonly import("./app-vocabulary.js").AppHandler[];
122
+ receives?: readonly "git.push"[] | undefined;
123
+ icon?: string;
124
+ roles: readonly import("./app-vocabulary.js").AppRole[];
125
+ storage?: readonly import("./app-vocabulary.js").AppStorageKey[] | undefined;
126
+ commands?: readonly import("./app-vocabulary.js").AppDeclaredCommand[] | undefined;
127
+ gills?: readonly import("@fungi.computer/gills").AppDeclaredGill[] | undefined;
128
+ backend?: Readonly<{
129
+ bindings: readonly import("./app-backend-binding-vocabulary.js").AppBackendBinding[];
130
+ sync?: Readonly<{
131
+ method: string;
132
+ }>;
133
+ }> | undefined;
134
+ }>, never, never>>;
135
+ readonly format: Schema.Literal<"fungi-app-v1">;
136
+ readonly ui: Schema.Struct<{
137
+ readonly mediaType: Schema.Literals<readonly ["text/html; charset=utf-8", "application/vnd.fungi.app-assets+json"]>;
138
+ readonly artifactRef: Schema.refine<import("./internal/app-release-contract.js").ArtifactRef, Schema.String>;
139
+ readonly digest: Schema.refine<import("./internal/app-release-contract.js").Sha256Digest, Schema.String>;
140
+ readonly version: Schema.String;
141
+ readonly byteLength: Schema.Number;
142
+ }>;
143
+ }>, Schema.Struct<{
144
+ readonly declaration: Schema.optionalKey<Schema.Codec<Readonly<{
145
+ api?: import("./app-vocabulary.js").AppApi;
146
+ displayName?: string | undefined;
147
+ capabilities: readonly import("./app-vocabulary.js").AppCapabilityId[];
148
+ calls?: readonly Readonly<{
149
+ appId: string;
150
+ methods: readonly string[];
151
+ }>[] | undefined;
152
+ guidance?: string | undefined;
153
+ handlers: readonly import("./app-vocabulary.js").AppHandler[];
154
+ receives?: readonly "git.push"[] | undefined;
155
+ icon?: string;
156
+ roles: readonly import("./app-vocabulary.js").AppRole[];
157
+ storage?: readonly import("./app-vocabulary.js").AppStorageKey[] | undefined;
158
+ commands?: readonly import("./app-vocabulary.js").AppDeclaredCommand[] | undefined;
159
+ gills?: readonly import("@fungi.computer/gills").AppDeclaredGill[] | undefined;
160
+ backend?: Readonly<{
161
+ bindings: readonly import("./app-backend-binding-vocabulary.js").AppBackendBinding[];
162
+ sync?: Readonly<{
163
+ method: string;
164
+ }>;
165
+ }> | undefined;
166
+ }>, Readonly<{
167
+ api?: import("./app-vocabulary.js").AppApi;
168
+ displayName?: string | undefined;
169
+ capabilities: readonly import("./app-vocabulary.js").AppCapabilityId[];
170
+ calls?: readonly Readonly<{
171
+ appId: string;
172
+ methods: readonly string[];
173
+ }>[] | undefined;
174
+ guidance?: string | undefined;
175
+ handlers: readonly import("./app-vocabulary.js").AppHandler[];
176
+ receives?: readonly "git.push"[] | undefined;
177
+ icon?: string;
178
+ roles: readonly import("./app-vocabulary.js").AppRole[];
179
+ storage?: readonly import("./app-vocabulary.js").AppStorageKey[] | undefined;
180
+ commands?: readonly import("./app-vocabulary.js").AppDeclaredCommand[] | undefined;
181
+ gills?: readonly import("@fungi.computer/gills").AppDeclaredGill[] | undefined;
182
+ backend?: Readonly<{
183
+ bindings: readonly import("./app-backend-binding-vocabulary.js").AppBackendBinding[];
184
+ sync?: Readonly<{
185
+ method: string;
186
+ }>;
187
+ }> | undefined;
188
+ }>, never, never>>;
189
+ readonly format: Schema.Literal<"fungi-app-v1">;
190
+ readonly backend: Schema.Struct<{
191
+ readonly mediaType: Schema.Literal<"application/vnd.fungi.app-backend+json">;
192
+ readonly artifactRef: Schema.refine<import("./internal/app-release-contract.js").ArtifactRef, Schema.String>;
193
+ readonly digest: Schema.refine<import("./internal/app-release-contract.js").Sha256Digest, Schema.String>;
194
+ readonly version: Schema.String;
195
+ readonly byteLength: Schema.Number;
196
+ }>;
197
+ }>]>;
198
+ /** Digest-covered App description, not mutable selection or permission. */
199
+ export type AppBuild = Schema.Schema.Type<typeof appBuildSchema>;
200
+ export type AppUiBuild = Schema.Schema.Type<typeof appUiBuildSchema>;
201
+ export type AppBackendBuild = Schema.Schema.Type<typeof appBackendBuildSchema>;
202
+ /** Maintained codec shared by artifact producers and consumers. */
203
+ export declare const appBuildJsonSchema: Schema.fromJsonString<Schema.Union<readonly [Schema.Struct<{
204
+ readonly declaration: Schema.optionalKey<Schema.Codec<Readonly<{
205
+ api?: import("./app-vocabulary.js").AppApi;
206
+ displayName?: string | undefined;
207
+ capabilities: readonly import("./app-vocabulary.js").AppCapabilityId[];
208
+ calls?: readonly Readonly<{
209
+ appId: string;
210
+ methods: readonly string[];
211
+ }>[] | undefined;
212
+ guidance?: string | undefined;
213
+ handlers: readonly import("./app-vocabulary.js").AppHandler[];
214
+ receives?: readonly "git.push"[] | undefined;
215
+ icon?: string;
216
+ roles: readonly import("./app-vocabulary.js").AppRole[];
217
+ storage?: readonly import("./app-vocabulary.js").AppStorageKey[] | undefined;
218
+ commands?: readonly import("./app-vocabulary.js").AppDeclaredCommand[] | undefined;
219
+ gills?: readonly import("@fungi.computer/gills").AppDeclaredGill[] | undefined;
220
+ backend?: Readonly<{
221
+ bindings: readonly import("./app-backend-binding-vocabulary.js").AppBackendBinding[];
222
+ sync?: Readonly<{
223
+ method: string;
224
+ }>;
225
+ }> | undefined;
226
+ }>, Readonly<{
227
+ api?: import("./app-vocabulary.js").AppApi;
228
+ displayName?: string | undefined;
229
+ capabilities: readonly import("./app-vocabulary.js").AppCapabilityId[];
230
+ calls?: readonly Readonly<{
231
+ appId: string;
232
+ methods: readonly string[];
233
+ }>[] | undefined;
234
+ guidance?: string | undefined;
235
+ handlers: readonly import("./app-vocabulary.js").AppHandler[];
236
+ receives?: readonly "git.push"[] | undefined;
237
+ icon?: string;
238
+ roles: readonly import("./app-vocabulary.js").AppRole[];
239
+ storage?: readonly import("./app-vocabulary.js").AppStorageKey[] | undefined;
240
+ commands?: readonly import("./app-vocabulary.js").AppDeclaredCommand[] | undefined;
241
+ gills?: readonly import("@fungi.computer/gills").AppDeclaredGill[] | undefined;
242
+ backend?: Readonly<{
243
+ bindings: readonly import("./app-backend-binding-vocabulary.js").AppBackendBinding[];
244
+ sync?: Readonly<{
245
+ method: string;
246
+ }>;
247
+ }> | undefined;
248
+ }>, never, never>>;
249
+ readonly format: Schema.Literal<"fungi-app-v1">;
250
+ readonly ui: Schema.Struct<{
251
+ readonly mediaType: Schema.Literals<readonly ["text/html; charset=utf-8", "application/vnd.fungi.app-assets+json"]>;
252
+ readonly artifactRef: Schema.refine<import("./internal/app-release-contract.js").ArtifactRef, Schema.String>;
253
+ readonly digest: Schema.refine<import("./internal/app-release-contract.js").Sha256Digest, Schema.String>;
254
+ readonly version: Schema.String;
255
+ readonly byteLength: Schema.Number;
256
+ }>;
257
+ readonly backend: Schema.Struct<{
258
+ readonly mediaType: Schema.Literal<"application/vnd.fungi.app-backend+json">;
259
+ readonly artifactRef: Schema.refine<import("./internal/app-release-contract.js").ArtifactRef, Schema.String>;
260
+ readonly digest: Schema.refine<import("./internal/app-release-contract.js").Sha256Digest, Schema.String>;
261
+ readonly version: Schema.String;
262
+ readonly byteLength: Schema.Number;
263
+ }>;
264
+ }>, Schema.Struct<{
265
+ readonly declaration: Schema.optionalKey<Schema.Codec<Readonly<{
266
+ api?: import("./app-vocabulary.js").AppApi;
267
+ displayName?: string | undefined;
268
+ capabilities: readonly import("./app-vocabulary.js").AppCapabilityId[];
269
+ calls?: readonly Readonly<{
270
+ appId: string;
271
+ methods: readonly string[];
272
+ }>[] | undefined;
273
+ guidance?: string | undefined;
274
+ handlers: readonly import("./app-vocabulary.js").AppHandler[];
275
+ receives?: readonly "git.push"[] | undefined;
276
+ icon?: string;
277
+ roles: readonly import("./app-vocabulary.js").AppRole[];
278
+ storage?: readonly import("./app-vocabulary.js").AppStorageKey[] | undefined;
279
+ commands?: readonly import("./app-vocabulary.js").AppDeclaredCommand[] | undefined;
280
+ gills?: readonly import("@fungi.computer/gills").AppDeclaredGill[] | undefined;
281
+ backend?: Readonly<{
282
+ bindings: readonly import("./app-backend-binding-vocabulary.js").AppBackendBinding[];
283
+ sync?: Readonly<{
284
+ method: string;
285
+ }>;
286
+ }> | undefined;
287
+ }>, Readonly<{
288
+ api?: import("./app-vocabulary.js").AppApi;
289
+ displayName?: string | undefined;
290
+ capabilities: readonly import("./app-vocabulary.js").AppCapabilityId[];
291
+ calls?: readonly Readonly<{
292
+ appId: string;
293
+ methods: readonly string[];
294
+ }>[] | undefined;
295
+ guidance?: string | undefined;
296
+ handlers: readonly import("./app-vocabulary.js").AppHandler[];
297
+ receives?: readonly "git.push"[] | undefined;
298
+ icon?: string;
299
+ roles: readonly import("./app-vocabulary.js").AppRole[];
300
+ storage?: readonly import("./app-vocabulary.js").AppStorageKey[] | undefined;
301
+ commands?: readonly import("./app-vocabulary.js").AppDeclaredCommand[] | undefined;
302
+ gills?: readonly import("@fungi.computer/gills").AppDeclaredGill[] | undefined;
303
+ backend?: Readonly<{
304
+ bindings: readonly import("./app-backend-binding-vocabulary.js").AppBackendBinding[];
305
+ sync?: Readonly<{
306
+ method: string;
307
+ }>;
308
+ }> | undefined;
309
+ }>, never, never>>;
310
+ readonly format: Schema.Literal<"fungi-app-v1">;
311
+ readonly ui: Schema.Struct<{
312
+ readonly mediaType: Schema.Literals<readonly ["text/html; charset=utf-8", "application/vnd.fungi.app-assets+json"]>;
313
+ readonly artifactRef: Schema.refine<import("./internal/app-release-contract.js").ArtifactRef, Schema.String>;
314
+ readonly digest: Schema.refine<import("./internal/app-release-contract.js").Sha256Digest, Schema.String>;
315
+ readonly version: Schema.String;
316
+ readonly byteLength: Schema.Number;
317
+ }>;
318
+ }>, Schema.Struct<{
319
+ readonly declaration: Schema.optionalKey<Schema.Codec<Readonly<{
320
+ api?: import("./app-vocabulary.js").AppApi;
321
+ displayName?: string | undefined;
322
+ capabilities: readonly import("./app-vocabulary.js").AppCapabilityId[];
323
+ calls?: readonly Readonly<{
324
+ appId: string;
325
+ methods: readonly string[];
326
+ }>[] | undefined;
327
+ guidance?: string | undefined;
328
+ handlers: readonly import("./app-vocabulary.js").AppHandler[];
329
+ receives?: readonly "git.push"[] | undefined;
330
+ icon?: string;
331
+ roles: readonly import("./app-vocabulary.js").AppRole[];
332
+ storage?: readonly import("./app-vocabulary.js").AppStorageKey[] | undefined;
333
+ commands?: readonly import("./app-vocabulary.js").AppDeclaredCommand[] | undefined;
334
+ gills?: readonly import("@fungi.computer/gills").AppDeclaredGill[] | undefined;
335
+ backend?: Readonly<{
336
+ bindings: readonly import("./app-backend-binding-vocabulary.js").AppBackendBinding[];
337
+ sync?: Readonly<{
338
+ method: string;
339
+ }>;
340
+ }> | undefined;
341
+ }>, Readonly<{
342
+ api?: import("./app-vocabulary.js").AppApi;
343
+ displayName?: string | undefined;
344
+ capabilities: readonly import("./app-vocabulary.js").AppCapabilityId[];
345
+ calls?: readonly Readonly<{
346
+ appId: string;
347
+ methods: readonly string[];
348
+ }>[] | undefined;
349
+ guidance?: string | undefined;
350
+ handlers: readonly import("./app-vocabulary.js").AppHandler[];
351
+ receives?: readonly "git.push"[] | undefined;
352
+ icon?: string;
353
+ roles: readonly import("./app-vocabulary.js").AppRole[];
354
+ storage?: readonly import("./app-vocabulary.js").AppStorageKey[] | undefined;
355
+ commands?: readonly import("./app-vocabulary.js").AppDeclaredCommand[] | undefined;
356
+ gills?: readonly import("@fungi.computer/gills").AppDeclaredGill[] | undefined;
357
+ backend?: Readonly<{
358
+ bindings: readonly import("./app-backend-binding-vocabulary.js").AppBackendBinding[];
359
+ sync?: Readonly<{
360
+ method: string;
361
+ }>;
362
+ }> | undefined;
363
+ }>, never, never>>;
364
+ readonly format: Schema.Literal<"fungi-app-v1">;
365
+ readonly backend: Schema.Struct<{
366
+ readonly mediaType: Schema.Literal<"application/vnd.fungi.app-backend+json">;
367
+ readonly artifactRef: Schema.refine<import("./internal/app-release-contract.js").ArtifactRef, Schema.String>;
368
+ readonly digest: Schema.refine<import("./internal/app-release-contract.js").Sha256Digest, Schema.String>;
369
+ readonly version: Schema.String;
370
+ readonly byteLength: Schema.Number;
371
+ }>;
372
+ }>]>>;
373
+ /** Construct one non-empty App root without leaking union mechanics to adapters. */
374
+ export declare function createAppBuild(ui: AppUiBuild | null, backend: AppBackendBuild | null, appDeclaration?: AppDeclaration): AppBuild;
375
+ export { appCapabilityIdSchema, appDeclarationSchema, appDeclaredCommandSchema, appHandlerSchema, appRoleSchema, appStorageKeySchema, appStorageKeyNameSchema, } from "./app-declaration.js";
376
+ export { appCapabilityIds, appHandlers, appRoles, appStorageScopes, emptyAppDeclaration, isEmptyAppDeclaration, resolveAppRoles, } from "./app-vocabulary.js";
377
+ export type { AppBackendBinding, AppCapabilityId, AppDeclaration, AppDeclaredCommand, AppHandler, AppRole, AppStorageScope, AppStorageKey, EffectiveAppRole, RoleCandidate, } from "./app-vocabulary.js";
378
+ export type { AppDescription, AppUi, ResolvedApp, } from "./internal/app-release-contract.js";
379
+ export { appCallsSchema } from "./app-declaration.js";