apps 0.0.1-beta.87 → 0.0.1-beta.88

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.
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  fixedRouter
3
- } from "./chunk-2P7BTRWZ.js";
3
+ } from "./chunk-EXARUCNH.js";
4
4
  import {
5
5
  nativeOperation,
6
6
  operationDeclaration,
7
7
  routerDeclaration
8
- } from "./chunk-JF6FO6YA.js";
8
+ } from "./chunk-6YMYQSTQ.js";
9
9
 
10
10
  // src/implementation/protocol-operations.ts
11
11
  var protocolOperations = (operations, kinds = {}) => {
@@ -6,7 +6,7 @@ import {
6
6
  RouterKey,
7
7
  RouterMeta,
8
8
  reservedRouterKeys
9
- } from "./chunk-WUPLD4VN.js";
9
+ } from "./chunk-S22ADZID.js";
10
10
  import {
11
11
  decoderOf,
12
12
  schemaArgument
@@ -12,7 +12,7 @@ import {
12
12
  parseSkillLoadFailed,
13
13
  readCatalog,
14
14
  routerSkills
15
- } from "./chunk-2P7BTRWZ.js";
15
+ } from "./chunk-EXARUCNH.js";
16
16
  import {
17
17
  appInvocationFetch
18
18
  } from "./chunk-I6Q7ZPKJ.js";
@@ -26,12 +26,12 @@ import {
26
26
  makeEmitter,
27
27
  toEffectApp,
28
28
  withPlacements
29
- } from "./chunk-OEZI25CT.js";
29
+ } from "./chunk-FIVMUILF.js";
30
30
  import {
31
31
  declaredOperations,
32
32
  locate,
33
33
  nativeOperation
34
- } from "./chunk-JF6FO6YA.js";
34
+ } from "./chunk-6YMYQSTQ.js";
35
35
  import {
36
36
  accountProviderError,
37
37
  appCode,
@@ -91,7 +91,7 @@ import {
91
91
  reservedTablePrefix,
92
92
  sqlBindingsLimit,
93
93
  workflowDurationMillis
94
- } from "./chunk-WUPLD4VN.js";
94
+ } from "./chunk-S22ADZID.js";
95
95
  import {
96
96
  AppSkills,
97
97
  SkillFile
@@ -1153,7 +1153,7 @@ function providerDeclaration(provider) {
1153
1153
  `Account provider "${provider.name}" has an invalid declaration`
1154
1154
  );
1155
1155
  }
1156
- function requirements(slots, sql, events) {
1156
+ function requirements(slots, sql, events, icons) {
1157
1157
  return Effect_exports.gen(function* () {
1158
1158
  const accounts = /* @__PURE__ */ new Map();
1159
1159
  for (const [slot, selection] of Object.entries(slots)) {
@@ -1173,7 +1173,8 @@ function requirements(slots, sql, events) {
1173
1173
  () => declaredEvents(events),
1174
1174
  "The app's event declarations are invalid"
1175
1175
  )
1176
- }
1176
+ },
1177
+ ...icons === void 0 ? {} : { icons }
1177
1178
  }).pipe(
1178
1179
  Effect_exports.mapError(
1179
1180
  (cause) => declarationInvalid("The app's account declarations are invalid", cause)
@@ -1293,7 +1294,7 @@ function dispatch(app, request, context, signal, emitted) {
1293
1294
  const native = toEffectApp(app);
1294
1295
  const secrets = accountSecrets(context.accounts);
1295
1296
  const ownsSql = hasMigrations(context.files ?? []);
1296
- const declared = yield* requirements(native.accounts, ownsSql, native.events);
1297
+ const declared = yield* requirements(native.accounts, ownsSql, native.events, native.icons);
1297
1298
  if (request.operation === "requirements")
1298
1299
  return yield* safe2(
1299
1300
  () => Schema_exports.decodeUnknownEffect(JsonValue)(declared),
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  joinPath,
6
6
  mergeMeta
7
- } from "./chunk-JF6FO6YA.js";
7
+ } from "./chunk-6YMYQSTQ.js";
8
8
  import {
9
9
  isShortenedUpstream,
10
10
  parseProviderError,
@@ -21,7 +21,7 @@ import {
21
21
  McpError,
22
22
  McpError2,
23
23
  SkillLoadFailed as SkillLoadFailed2
24
- } from "./chunk-WUPLD4VN.js";
24
+ } from "./chunk-S22ADZID.js";
25
25
  import {
26
26
  CacheError,
27
27
  FailureCode,
@@ -2,7 +2,7 @@ import {
2
2
  declaredOperations,
3
3
  nativeOperation,
4
4
  nativeRouter
5
- } from "./chunk-JF6FO6YA.js";
5
+ } from "./chunk-6YMYQSTQ.js";
6
6
  import {
7
7
  fromPromise,
8
8
  method
@@ -12,11 +12,12 @@ import {
12
12
  EventName,
13
13
  Placement,
14
14
  ScheduleTiming,
15
+ appIconsProblem,
15
16
  defaultEventLimits,
16
17
  normalizePlacements,
17
18
  placementFields,
18
19
  renderPlacement
19
- } from "./chunk-WUPLD4VN.js";
20
+ } from "./chunk-S22ADZID.js";
20
21
  import {
21
22
  decoderOf,
22
23
  isSchema,
@@ -393,9 +394,13 @@ var defineApp = (requirements, definition) => {
393
394
  return [name, native2];
394
395
  })
395
396
  );
397
+ const iconsProblem = requirements.icons === void 0 ? void 0 : appIconsProblem(requirements.icons);
398
+ if (iconsProblem !== void 0)
399
+ throw new TypeError(`The app's icons are invalid: ${iconsProblem}`);
396
400
  const native = {
397
401
  accounts: requirements.accounts,
398
402
  ...events === void 0 ? {} : { events },
403
+ ...requirements.icons === void 0 || requirements.icons.length === 0 ? {} : { icons: requirements.icons },
399
404
  evaluate: (context) => factory(context).pipe(Effect_exports.map((value2) => adaptDefinition(value2)))
400
405
  };
401
406
  return {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  prepareElicitation
3
- } from "./chunk-EZUX2YJS.js";
3
+ } from "./chunk-EVTBFNHI.js";
4
4
  import {
5
5
  failOnNetworkRefusal
6
6
  } from "./chunk-I6Q7ZPKJ.js";
@@ -26,7 +26,7 @@ import {
26
26
  defaultMcpClientLimits,
27
27
  mcpHealthReserveMs,
28
28
  mcpSdkTimerCeilingMs
29
- } from "./chunk-WUPLD4VN.js";
29
+ } from "./chunk-S22ADZID.js";
30
30
  import {
31
31
  NetworkRefused,
32
32
  ProviderError
@@ -2100,6 +2100,37 @@ var EmittedEvents = Schema_exports.Array(EmittedEvent).check(
2100
2100
  Schema_exports.isMaxLength(defaultEventLimits.maxEventsPerInvocation)
2101
2101
  );
2102
2102
 
2103
+ // src/contracts/icons.ts
2104
+ var appIconLimits = { icons: 8, characters: 32 * 1024 };
2105
+ var appIconSource = /^(?:data:image\/(?:svg\+xml|png|webp|jpeg);base64,[A-Za-z0-9+/]*={0,2}|https:\/\/\S+)$/u;
2106
+ var AppIcon = Schema_exports.Struct({
2107
+ ...RouterIcon.fields,
2108
+ src: Schema_exports.String.check(
2109
+ Schema_exports.isPattern(appIconSource),
2110
+ Schema_exports.isMaxLength(appIconLimits.characters)
2111
+ )
2112
+ });
2113
+ var AppIcons = Schema_exports.Array(AppIcon).check(
2114
+ Schema_exports.isMaxLength(appIconLimits.icons),
2115
+ Schema_exports.makeFilter((icons) => JSON.stringify(icons).length <= appIconLimits.characters, {
2116
+ message: `An app's icons total at most ${appIconLimits.characters} characters`
2117
+ })
2118
+ );
2119
+ var appIconsProblem = (icons) => {
2120
+ if (!Array.isArray(icons)) return "icons must be an array of { src, mimeType?, sizes?, theme? }";
2121
+ if (icons.length > appIconLimits.icons)
2122
+ return `An app declares at most ${appIconLimits.icons} icons; this one declares ${icons.length}`;
2123
+ for (const [index, icon] of icons.entries()) {
2124
+ const src = typeof icon === "object" && icon !== null ? icon.src : void 0;
2125
+ if (typeof src !== "string" || !appIconSource.test(src))
2126
+ return `icons[${index}].src must be a base64 data:image/svg+xml, image/png, image/webp or image/jpeg URI, or an https: URL`;
2127
+ }
2128
+ const size = JSON.stringify(icons).length;
2129
+ if (size > appIconLimits.characters)
2130
+ return `An app's icons total at most 32 KiB; these take ${Math.ceil(size / 1024)} KiB`;
2131
+ return Schema_exports.is(AppIcons)(icons) ? void 0 : 'Each icon is { src, mimeType?: string, sizes?: string[], theme?: "light" | "dark" }';
2132
+ };
2133
+
2103
2134
  // src/contracts/placement.ts
2104
2135
  var PlacementField = Schema_exports.Struct({ field: Schema_exports.NonEmptyString });
2105
2136
  var PlacementText = Schema_exports.Union([Schema_exports.String, PlacementField]);
@@ -4007,7 +4038,9 @@ var DeclaredRequirements6 = Schema_exports.Struct({
4007
4038
  /** The build has SQL files in `migrations/` and owns a raw SQLite database. */
4008
4039
  sql: Schema_exports.optionalKey(Schema_exports.Literal(true)),
4009
4040
  /** The events the app declares, so a host lists them without evaluating the app. */
4010
- events: Schema_exports.optionalKey(DeclaredEvents)
4041
+ events: Schema_exports.optionalKey(DeclaredEvents),
4042
+ /** The icons the app declares, so a host shows them without evaluating the app. */
4043
+ icons: Schema_exports.optionalKey(AppIcons)
4011
4044
  });
4012
4045
  var ResolvedAccount4 = Schema_exports.Struct({
4013
4046
  id: AccountId,
@@ -4436,6 +4469,10 @@ export {
4436
4469
  DeclaredEvents,
4437
4470
  EmittedEvent,
4438
4471
  EmittedEvents,
4472
+ appIconLimits,
4473
+ AppIcon,
4474
+ AppIcons,
4475
+ appIconsProblem,
4439
4476
  frameworkProtocol,
4440
4477
  protocol1,
4441
4478
  protocol2,
package/js/contracts.js CHANGED
@@ -3,6 +3,8 @@ import {
3
3
  AccountCheckResult,
4
4
  AccountInfo,
5
5
  ApiErrorResponse,
6
+ AppIcon,
7
+ AppIcons,
6
8
  ApprovalElicitation,
7
9
  ApprovalResponse,
8
10
  CalendarSchedule,
@@ -113,6 +115,7 @@ import {
113
115
  WorkflowRunPage,
114
116
  WorkflowStepOptions,
115
117
  WorkflowValue,
118
+ appIconLimits,
116
119
  approvalElicitation,
117
120
  current,
118
121
  defaultElicitationLimits,
@@ -146,7 +149,7 @@ import {
146
149
  skillCatalog,
147
150
  skillsCommand,
148
151
  workflowDurationMillis
149
- } from "./chunk-WUPLD4VN.js";
152
+ } from "./chunk-S22ADZID.js";
150
153
  import {
151
154
  FailureCode,
152
155
  FailureDetail,
@@ -197,6 +200,8 @@ export {
197
200
  AccountId,
198
201
  AccountInfo,
199
202
  ApiErrorResponse,
203
+ AppIcon,
204
+ AppIcons,
200
205
  AppSkillMetadata,
201
206
  AppSkillName,
202
207
  AppSkillSource,
@@ -330,6 +335,7 @@ export {
330
335
  WorkflowRunPage,
331
336
  WorkflowStepOptions,
332
337
  WorkflowValue,
338
+ appIconLimits,
333
339
  approvalElicitation,
334
340
  defaultElicitationLimits,
335
341
  defaultEventLimits,
package/js/effect.js CHANGED
@@ -3,17 +3,17 @@ import {
3
3
  ApprovalDecision,
4
4
  createAppHandler,
5
5
  prepareElicitation
6
- } from "./chunk-EZUX2YJS.js";
6
+ } from "./chunk-EVTBFNHI.js";
7
7
  import "./chunk-XBHWCCNB.js";
8
- import "./chunk-2P7BTRWZ.js";
8
+ import "./chunk-EXARUCNH.js";
9
9
  import "./chunk-I6Q7ZPKJ.js";
10
10
  import "./chunk-XBG7HHXC.js";
11
- import "./chunk-OEZI25CT.js";
12
- import "./chunk-JF6FO6YA.js";
11
+ import "./chunk-FIVMUILF.js";
12
+ import "./chunk-6YMYQSTQ.js";
13
13
  import "./chunk-W6XCQAXP.js";
14
14
  import {
15
15
  ToolAnnotations
16
- } from "./chunk-WUPLD4VN.js";
16
+ } from "./chunk-S22ADZID.js";
17
17
  import "./chunk-Q4IZAUIF.js";
18
18
  import "./chunk-H72MEDMN.js";
19
19
  import {
package/js/graphql.js CHANGED
@@ -4,28 +4,28 @@ import {
4
4
  } from "./chunk-FVYCYTYL.js";
5
5
  import {
6
6
  protocolOperations
7
- } from "./chunk-7NTL2NOR.js";
7
+ } from "./chunk-3K3VA76C.js";
8
8
  import "./chunk-BCSNKUAC.js";
9
- import "./chunk-EZUX2YJS.js";
9
+ import "./chunk-EVTBFNHI.js";
10
10
  import {
11
11
  cacheKey
12
12
  } from "./chunk-XBHWCCNB.js";
13
- import "./chunk-2P7BTRWZ.js";
13
+ import "./chunk-EXARUCNH.js";
14
14
  import {
15
15
  failOnNetworkRefusal
16
16
  } from "./chunk-I6Q7ZPKJ.js";
17
17
  import "./chunk-XBG7HHXC.js";
18
- import "./chunk-OEZI25CT.js";
18
+ import "./chunk-FIVMUILF.js";
19
19
  import {
20
20
  nativeOperation,
21
21
  routerDeclaration
22
- } from "./chunk-JF6FO6YA.js";
22
+ } from "./chunk-6YMYQSTQ.js";
23
23
  import {
24
24
  accountProviderError,
25
25
  graphqlProviderError,
26
26
  httpProviderError
27
27
  } from "./chunk-W6XCQAXP.js";
28
- import "./chunk-WUPLD4VN.js";
28
+ import "./chunk-S22ADZID.js";
29
29
  import {
30
30
  NetworkRefused,
31
31
  ProviderError
package/js/host.js CHANGED
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  createAppHandler
3
- } from "./chunk-EZUX2YJS.js";
3
+ } from "./chunk-EVTBFNHI.js";
4
4
  import "./chunk-XBHWCCNB.js";
5
- import "./chunk-2P7BTRWZ.js";
5
+ import "./chunk-EXARUCNH.js";
6
6
  import "./chunk-I6Q7ZPKJ.js";
7
7
  import "./chunk-XBG7HHXC.js";
8
- import "./chunk-OEZI25CT.js";
9
- import "./chunk-JF6FO6YA.js";
8
+ import "./chunk-FIVMUILF.js";
9
+ import "./chunk-6YMYQSTQ.js";
10
10
  import "./chunk-W6XCQAXP.js";
11
11
  import {
12
12
  ElicitationFailed,
@@ -22,7 +22,7 @@ import {
22
22
  WorkflowRun,
23
23
  WorkflowRunId,
24
24
  WorkflowRunPage
25
- } from "./chunk-WUPLD4VN.js";
25
+ } from "./chunk-S22ADZID.js";
26
26
  import {
27
27
  CacheCommand,
28
28
  CacheError,
package/js/index.js CHANGED
@@ -11,7 +11,7 @@ import {
11
11
  query,
12
12
  t,
13
13
  workflow
14
- } from "./chunk-OEZI25CT.js";
14
+ } from "./chunk-FIVMUILF.js";
15
15
  import {
16
16
  dynamicRouter,
17
17
  mutation,
@@ -25,7 +25,7 @@ import {
25
25
  toolAnnotations,
26
26
  withApproval,
27
27
  withApprovals
28
- } from "./chunk-JF6FO6YA.js";
28
+ } from "./chunk-6YMYQSTQ.js";
29
29
  import {
30
30
  accountProviderError,
31
31
  fromPromise
@@ -44,7 +44,7 @@ import {
44
44
  ScheduleTiming,
45
45
  SecretsMethod,
46
46
  WorkflowFailure
47
- } from "./chunk-WUPLD4VN.js";
47
+ } from "./chunk-S22ADZID.js";
48
48
  import {
49
49
  CacheError,
50
50
  FetchOptionUnsupported,
package/js/mcp/effect.js CHANGED
@@ -2,17 +2,17 @@ import {
2
2
  mcpClientEffect,
3
3
  mcpHealthEffect,
4
4
  mcpToolsEffect
5
- } from "../chunk-7R73XVF3.js";
5
+ } from "../chunk-Q4WQMUEO.js";
6
6
  import "../chunk-BCSNKUAC.js";
7
- import "../chunk-EZUX2YJS.js";
7
+ import "../chunk-EVTBFNHI.js";
8
8
  import "../chunk-XBHWCCNB.js";
9
- import "../chunk-2P7BTRWZ.js";
9
+ import "../chunk-EXARUCNH.js";
10
10
  import "../chunk-I6Q7ZPKJ.js";
11
11
  import "../chunk-XBG7HHXC.js";
12
- import "../chunk-OEZI25CT.js";
13
- import "../chunk-JF6FO6YA.js";
12
+ import "../chunk-FIVMUILF.js";
13
+ import "../chunk-6YMYQSTQ.js";
14
14
  import "../chunk-W6XCQAXP.js";
15
- import "../chunk-WUPLD4VN.js";
15
+ import "../chunk-S22ADZID.js";
16
16
  import "../chunk-Q4IZAUIF.js";
17
17
  import "../chunk-H72MEDMN.js";
18
18
  import "../chunk-A3HPRNJC.js";
package/js/mcp.js CHANGED
@@ -4,27 +4,27 @@ import {
4
4
  } from "./chunk-FVYCYTYL.js";
5
5
  import {
6
6
  protocolOperations
7
- } from "./chunk-7NTL2NOR.js";
7
+ } from "./chunk-3K3VA76C.js";
8
8
  import {
9
9
  adaptMcpTool,
10
10
  mcpClientEffect,
11
11
  mcpHealthEffect
12
- } from "./chunk-7R73XVF3.js";
12
+ } from "./chunk-Q4WQMUEO.js";
13
13
  import "./chunk-BCSNKUAC.js";
14
- import "./chunk-EZUX2YJS.js";
14
+ import "./chunk-EVTBFNHI.js";
15
15
  import {
16
16
  cacheKey
17
17
  } from "./chunk-XBHWCCNB.js";
18
18
  import {
19
19
  operationDescription
20
- } from "./chunk-2P7BTRWZ.js";
20
+ } from "./chunk-EXARUCNH.js";
21
21
  import "./chunk-I6Q7ZPKJ.js";
22
22
  import "./chunk-XBG7HHXC.js";
23
- import "./chunk-OEZI25CT.js";
23
+ import "./chunk-FIVMUILF.js";
24
24
  import {
25
25
  nativeOperation,
26
26
  routerDeclaration
27
- } from "./chunk-JF6FO6YA.js";
27
+ } from "./chunk-6YMYQSTQ.js";
28
28
  import {
29
29
  fromPromise,
30
30
  method
@@ -35,7 +35,7 @@ import {
35
35
  McpServerHeader,
36
36
  McpToolMetadata,
37
37
  McpToolsOptions
38
- } from "./chunk-WUPLD4VN.js";
38
+ } from "./chunk-S22ADZID.js";
39
39
  import "./chunk-Q4IZAUIF.js";
40
40
  import "./chunk-H72MEDMN.js";
41
41
  import "./chunk-A3HPRNJC.js";
package/js/openapi.js CHANGED
@@ -8,7 +8,7 @@ import {
8
8
  import {
9
9
  protocolOperations,
10
10
  protocolRouter
11
- } from "./chunk-7NTL2NOR.js";
11
+ } from "./chunk-3K3VA76C.js";
12
12
  import {
13
13
  OpenapiCompileError,
14
14
  OpenapiCompileErrorCode,
@@ -29,7 +29,7 @@ import {
29
29
  isOpenapiTextMedia,
30
30
  openapiBinaryResultSchema,
31
31
  openapiMediaKind
32
- } from "./chunk-2P7BTRWZ.js";
32
+ } from "./chunk-EXARUCNH.js";
33
33
  import {
34
34
  failOnNetworkRefusal
35
35
  } from "./chunk-I6Q7ZPKJ.js";
@@ -37,7 +37,7 @@ import "./chunk-XBG7HHXC.js";
37
37
  import {
38
38
  nativeOperation,
39
39
  routerDeclaration
40
- } from "./chunk-JF6FO6YA.js";
40
+ } from "./chunk-6YMYQSTQ.js";
41
41
  import {
42
42
  accountProviderError,
43
43
  bodyUpstreamError,
@@ -53,7 +53,7 @@ import {
53
53
  OpenapiResponseError,
54
54
  RouterMeta,
55
55
  defaultOpenapiErrorLimits
56
- } from "./chunk-WUPLD4VN.js";
56
+ } from "./chunk-S22ADZID.js";
57
57
  import {
58
58
  NetworkRefused,
59
59
  ProviderError,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "apps",
3
- "version": "0.0.1-beta.87",
3
+ "version": "0.0.1-beta.88",
4
4
  "description": "TypeScript apps with typed tools, accounts, storage, and UI.",
5
5
  "type": "module",
6
6
  "sideEffects": false,