apps 0.0.1-beta.94 → 0.0.1-beta.95

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,6 +1,6 @@
1
1
  import {
2
2
  getWithReads
3
- } from "./chunk-JJZZLNJY.js";
3
+ } from "./chunk-7YH74PGP.js";
4
4
  import {
5
5
  fromPromise,
6
6
  method,
@@ -11,7 +11,7 @@ import {
11
11
  } from "./chunk-6WC2OWHV.js";
12
12
  import {
13
13
  wrap
14
- } from "./chunk-RKFLB36H.js";
14
+ } from "./chunk-VAI3EVCS.js";
15
15
  import {
16
16
  JsonObject
17
17
  } from "./chunk-7HG422GB.js";
@@ -10,7 +10,7 @@ import {
10
10
  import {
11
11
  decoderOf,
12
12
  schemaArgument
13
- } from "./chunk-RKFLB36H.js";
13
+ } from "./chunk-VAI3EVCS.js";
14
14
  import {
15
15
  Effect_exports,
16
16
  Schema_exports
@@ -15,7 +15,7 @@ import {
15
15
  } from "./chunk-6WC2OWHV.js";
16
16
  import {
17
17
  decoderOf
18
- } from "./chunk-RKFLB36H.js";
18
+ } from "./chunk-VAI3EVCS.js";
19
19
  import {
20
20
  captureTelemetry,
21
21
  owned,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  prepareElicitation
3
- } from "./chunk-FA5MLNYL.js";
3
+ } from "./chunk-VIFIFPDC.js";
4
4
  import {
5
5
  failOnNetworkRefusal
6
6
  } from "./chunk-2GPX2E57.js";
@@ -33,7 +33,7 @@ import {
33
33
  jsonSchemaDecoder,
34
34
  nestJsonSchema,
35
35
  preparedJsonSchemaDecoder
36
- } from "./chunk-RKFLB36H.js";
36
+ } from "./chunk-VAI3EVCS.js";
37
37
  import {
38
38
  captureTelemetry,
39
39
  owned
@@ -2,7 +2,7 @@ import {
2
2
  declaredOperations,
3
3
  nativeOperation,
4
4
  nativeRouter
5
- } from "./chunk-6F3WAXVN.js";
5
+ } from "./chunk-7N2UOAMJ.js";
6
6
  import {
7
7
  fromPromise,
8
8
  method
@@ -23,7 +23,7 @@ import {
23
23
  isSchema,
24
24
  jsonSchemaDocument,
25
25
  schemaArgument
26
- } from "./chunk-RKFLB36H.js";
26
+ } from "./chunk-VAI3EVCS.js";
27
27
  import {
28
28
  JsonValue
29
29
  } from "./chunk-7HG422GB.js";
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  fixedRouter
3
- } from "./chunk-DYE2CKHG.js";
3
+ } from "./chunk-RLV4NKW3.js";
4
4
  import {
5
5
  nativeOperation,
6
6
  operationDeclaration,
7
7
  routerDeclaration
8
- } from "./chunk-6F3WAXVN.js";
8
+ } from "./chunk-7N2UOAMJ.js";
9
9
 
10
10
  // src/implementation/protocol-operations.ts
11
11
  var protocolOperations = (operations, kinds = {}) => {
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  joinPath,
6
6
  mergeMeta
7
- } from "./chunk-6F3WAXVN.js";
7
+ } from "./chunk-7N2UOAMJ.js";
8
8
  import {
9
9
  isShortenedUpstream,
10
10
  parseProviderError,
@@ -38,7 +38,7 @@ import {
38
38
  } from "./chunk-4PIQKACY.js";
39
39
  import {
40
40
  jsonSchemaDocument
41
- } from "./chunk-RKFLB36H.js";
41
+ } from "./chunk-VAI3EVCS.js";
42
42
  import {
43
43
  AccountId,
44
44
  HttpUrl,
@@ -1264,6 +1264,65 @@ var nestJsonSchema = (input, pointer) => {
1264
1264
  Schema_exports.Record(Schema_exports.String, Schema_exports.Json)
1265
1265
  )(rewrite(document));
1266
1266
  };
1267
+ var identifiers = /* @__PURE__ */ new Set([
1268
+ "$id",
1269
+ "id",
1270
+ "$anchor",
1271
+ "$recursiveAnchor",
1272
+ "$recursiveRef",
1273
+ "$dynamicAnchor",
1274
+ "$dynamicRef"
1275
+ ]);
1276
+ var ownDefinition = (reference) => {
1277
+ if (typeof reference !== "string" || !reference.startsWith("#/$defs/")) return void 0;
1278
+ const segments = pointerSegments(reference);
1279
+ return segments.length === 2 ? segments[1] : void 0;
1280
+ };
1281
+ var rootDefinitions = (schema) => {
1282
+ const definitions = schema.$defs ?? {};
1283
+ if (!isJsonRecord(definitions)) return void 0;
1284
+ const pending = [schema];
1285
+ for (let value = pending.pop(); value !== void 0; value = pending.pop()) {
1286
+ if (!isSchemaObject(value)) continue;
1287
+ for (const [key, item] of Object.entries(value)) {
1288
+ if (identifiers.has(key)) return void 0;
1289
+ if (key === "$ref") {
1290
+ const name = ownDefinition(item);
1291
+ if (name === void 0 || !Object.hasOwn(definitions, name)) return void 0;
1292
+ } else if (Array.isArray(item)) {
1293
+ if (schemaArrays.has(key) || key === "items") pending.push(...item);
1294
+ } else if (schemaMaps.has(key) || key === "dependencies") {
1295
+ if (isJsonRecord(item)) pending.push(...Object.values(item));
1296
+ } else if (schemaNodes.has(key)) pending.push(item);
1297
+ }
1298
+ }
1299
+ return definitions;
1300
+ };
1301
+ var combineJsonSchemas = (schemas, pointer) => {
1302
+ const shared = {};
1303
+ const texts = /* @__PURE__ */ new Map();
1304
+ const combined = schemas.map((schema, index) => {
1305
+ const definitions = rootDefinitions(schema);
1306
+ const entries = Object.entries(definitions ?? {}).map(
1307
+ ([name, definition]) => [name, definition, JSON.stringify(definition)]
1308
+ );
1309
+ if (definitions === void 0 || entries.some(([name, , text]) => texts.has(name) && texts.get(name) !== text))
1310
+ return nestJsonSchema(schema, pointer(index));
1311
+ for (const [name, definition, text] of entries) {
1312
+ if (texts.has(name)) continue;
1313
+ texts.set(name, text);
1314
+ Object.defineProperty(shared, name, {
1315
+ value: definition,
1316
+ enumerable: true,
1317
+ writable: true,
1318
+ configurable: true
1319
+ });
1320
+ }
1321
+ const { $defs: _, ...rest } = schema;
1322
+ return rest;
1323
+ });
1324
+ return texts.size === 0 ? { schemas: combined } : { $defs: shared, schemas: combined };
1325
+ };
1267
1326
  var schemaMaps = /* @__PURE__ */ new Set([
1268
1327
  "$defs",
1269
1328
  "definitions",
@@ -1924,6 +1983,7 @@ export {
1924
1983
  once,
1925
1984
  withLazyJsonSchemaDocument,
1926
1985
  nestJsonSchema,
1986
+ combineJsonSchemas,
1927
1987
  echoableKey,
1928
1988
  objectShape,
1929
1989
  allowedValues,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  authorCache,
3
3
  unavailableCache
4
- } from "./chunk-JJZZLNJY.js";
4
+ } from "./chunk-7YH74PGP.js";
5
5
  import {
6
6
  accountSecrets,
7
7
  boundFailureMessage,
@@ -12,7 +12,7 @@ import {
12
12
  parseSkillLoadFailed,
13
13
  readCatalog,
14
14
  routerSkills
15
- } from "./chunk-DYE2CKHG.js";
15
+ } from "./chunk-RLV4NKW3.js";
16
16
  import {
17
17
  appInvocationFetch
18
18
  } from "./chunk-2GPX2E57.js";
@@ -26,12 +26,12 @@ import {
26
26
  makeEmitter,
27
27
  toEffectApp,
28
28
  withPlacements
29
- } from "./chunk-TNVB3KLB.js";
29
+ } from "./chunk-EQVLEJTX.js";
30
30
  import {
31
31
  declaredOperations,
32
32
  locate,
33
33
  nativeOperation
34
- } from "./chunk-6F3WAXVN.js";
34
+ } from "./chunk-7N2UOAMJ.js";
35
35
  import {
36
36
  accountProviderError,
37
37
  appCode,
@@ -108,7 +108,7 @@ import {
108
108
  missingKeyText,
109
109
  objectShape,
110
110
  unionShape
111
- } from "./chunk-RKFLB36H.js";
111
+ } from "./chunk-VAI3EVCS.js";
112
112
  import {
113
113
  captureTelemetry,
114
114
  makeOwnershipAccounting,
package/js/client.js CHANGED
@@ -12,7 +12,7 @@ import {
12
12
  } from "./chunk-KLSEU35Y.js";
13
13
  import {
14
14
  decoderOf
15
- } from "./chunk-RKFLB36H.js";
15
+ } from "./chunk-VAI3EVCS.js";
16
16
  import {
17
17
  OtlpExporter_exports,
18
18
  externalTrace,
package/js/effect.js CHANGED
@@ -3,13 +3,13 @@ import {
3
3
  ApprovalDecision,
4
4
  createAppHandler,
5
5
  prepareElicitation
6
- } from "./chunk-FA5MLNYL.js";
7
- import "./chunk-JJZZLNJY.js";
8
- import "./chunk-DYE2CKHG.js";
6
+ } from "./chunk-VIFIFPDC.js";
7
+ import "./chunk-7YH74PGP.js";
8
+ import "./chunk-RLV4NKW3.js";
9
9
  import "./chunk-2GPX2E57.js";
10
10
  import "./chunk-PBGPES67.js";
11
- import "./chunk-TNVB3KLB.js";
12
- import "./chunk-6F3WAXVN.js";
11
+ import "./chunk-EQVLEJTX.js";
12
+ import "./chunk-7N2UOAMJ.js";
13
13
  import "./chunk-MN5XVRKW.js";
14
14
  import {
15
15
  ToolAnnotations
@@ -20,7 +20,7 @@ import {
20
20
  decoderOf,
21
21
  jsonSchemaDecoder,
22
22
  wrap
23
- } from "./chunk-RKFLB36H.js";
23
+ } from "./chunk-VAI3EVCS.js";
24
24
  import "./chunk-URKOTNDA.js";
25
25
  import "./chunk-YDW7DX3A.js";
26
26
  import "./chunk-OWN3DP2W.js";
package/js/graphql.js CHANGED
@@ -1,25 +1,25 @@
1
1
  import {
2
2
  catalogCache,
3
3
  catalogScope
4
- } from "./chunk-6C2I6JLA.js";
4
+ } from "./chunk-4CCDS4U7.js";
5
5
  import {
6
6
  protocolOperations
7
- } from "./chunk-ATBBIJ5O.js";
7
+ } from "./chunk-OGUGI2I6.js";
8
8
  import "./chunk-BCSNKUAC.js";
9
- import "./chunk-FA5MLNYL.js";
9
+ import "./chunk-VIFIFPDC.js";
10
10
  import {
11
11
  cacheKey
12
- } from "./chunk-JJZZLNJY.js";
13
- import "./chunk-DYE2CKHG.js";
12
+ } from "./chunk-7YH74PGP.js";
13
+ import "./chunk-RLV4NKW3.js";
14
14
  import {
15
15
  failOnNetworkRefusal
16
16
  } from "./chunk-2GPX2E57.js";
17
17
  import "./chunk-PBGPES67.js";
18
- import "./chunk-TNVB3KLB.js";
18
+ import "./chunk-EQVLEJTX.js";
19
19
  import {
20
20
  nativeOperation,
21
21
  routerDeclaration
22
- } from "./chunk-6F3WAXVN.js";
22
+ } from "./chunk-7N2UOAMJ.js";
23
23
  import {
24
24
  accountProviderError,
25
25
  graphqlProviderError,
@@ -32,7 +32,7 @@ import {
32
32
  import "./chunk-4PIQKACY.js";
33
33
  import {
34
34
  jsonSchemaDecoder
35
- } from "./chunk-RKFLB36H.js";
35
+ } from "./chunk-VAI3EVCS.js";
36
36
  import {
37
37
  owned
38
38
  } from "./chunk-URKOTNDA.js";
package/js/host.js CHANGED
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  createAppHandler
3
- } from "./chunk-FA5MLNYL.js";
4
- import "./chunk-JJZZLNJY.js";
5
- import "./chunk-DYE2CKHG.js";
3
+ } from "./chunk-VIFIFPDC.js";
4
+ import "./chunk-7YH74PGP.js";
5
+ import "./chunk-RLV4NKW3.js";
6
6
  import "./chunk-2GPX2E57.js";
7
7
  import "./chunk-PBGPES67.js";
8
- import "./chunk-TNVB3KLB.js";
9
- import "./chunk-6F3WAXVN.js";
8
+ import "./chunk-EQVLEJTX.js";
9
+ import "./chunk-7N2UOAMJ.js";
10
10
  import "./chunk-MN5XVRKW.js";
11
11
  import {
12
12
  CacheCommand,
@@ -27,7 +27,7 @@ import {
27
27
  WorkflowRunPage
28
28
  } from "./chunk-6WC2OWHV.js";
29
29
  import "./chunk-4PIQKACY.js";
30
- import "./chunk-RKFLB36H.js";
30
+ import "./chunk-VAI3EVCS.js";
31
31
  import {
32
32
  collectTelemetry,
33
33
  withRemoteSpan
package/js/index.js CHANGED
@@ -11,7 +11,7 @@ import {
11
11
  query,
12
12
  t,
13
13
  workflow
14
- } from "./chunk-TNVB3KLB.js";
14
+ } from "./chunk-EQVLEJTX.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-6F3WAXVN.js";
28
+ } from "./chunk-7N2UOAMJ.js";
29
29
  import {
30
30
  accountProviderError,
31
31
  fromPromise
@@ -53,6 +53,7 @@ import "./chunk-4PIQKACY.js";
53
53
  import {
54
54
  array,
55
55
  boolean,
56
+ combineJsonSchemas,
56
57
  decoderOf,
57
58
  fieldExposure,
58
59
  importedJsonSchema,
@@ -60,7 +61,6 @@ import {
60
61
  json,
61
62
  jsonSchema,
62
63
  literal,
63
- nestJsonSchema,
64
64
  number,
65
65
  object,
66
66
  once,
@@ -72,7 +72,7 @@ import {
72
72
  string,
73
73
  withLazyJsonSchemaDocument,
74
74
  wrap
75
- } from "./chunk-RKFLB36H.js";
75
+ } from "./chunk-VAI3EVCS.js";
76
76
  import "./chunk-URKOTNDA.js";
77
77
  import "./chunk-YDW7DX3A.js";
78
78
  import "./chunk-OWN3DP2W.js";
@@ -147,23 +147,34 @@ var accountBranches = (variants) => {
147
147
  if (group === void 0) groups.set(key, { schema, first: accountId, rest: [] });
148
148
  else group.rest.push(accountId);
149
149
  }
150
+ const branches = [...groups.values()];
151
+ const { $defs, schemas } = combineJsonSchemas(
152
+ branches.map(({ schema }) => schema),
153
+ (index) => `#/anyOf/${index}/properties/input`
154
+ );
150
155
  return {
151
156
  type: "object",
152
- anyOf: [...groups.values()].map(({ schema, first, rest }, index) => ({
153
- type: "object",
154
- properties: {
155
- accountId: rest.length === 0 ? { type: "string", const: first } : { type: "string", enum: [first, ...rest] },
156
- input: nestJsonSchema(schema, `#/anyOf/${index}/properties/input`)
157
- },
158
- required: ["accountId", "input"]
159
- }))
157
+ ...$defs === void 0 ? {} : { $defs },
158
+ anyOf: schemas.map((input, index) => {
159
+ const { first, rest } = branches[index];
160
+ return {
161
+ type: "object",
162
+ properties: {
163
+ accountId: rest.length === 0 ? { type: "string", const: first } : { type: "string", enum: [first, ...rest] },
164
+ input
165
+ },
166
+ required: ["accountId", "input"]
167
+ };
168
+ })
160
169
  };
161
170
  };
162
- var outputBranches = (outputs) => ({
163
- anyOf: [...new Map(outputs.map((output) => [JSON.stringify(output), output])).values()].map(
164
- (output, index) => nestJsonSchema(output, `#/anyOf/${index}`)
165
- )
166
- });
171
+ var outputBranches = (outputs) => {
172
+ const { $defs, schemas } = combineJsonSchemas(
173
+ [...new Map(outputs.map((output) => [JSON.stringify(output), output])).values()],
174
+ (index) => `#/anyOf/${index}`
175
+ );
176
+ return { ...$defs === void 0 ? {} : { $defs }, anyOf: schemas };
177
+ };
167
178
  var declaresOutput = (operation) => {
168
179
  if (operation.output !== void 0) return true;
169
180
  const property = Object.getOwnPropertyDescriptor(operation, "outputSchema");
package/js/mcp/effect.js CHANGED
@@ -2,19 +2,19 @@ import {
2
2
  mcpClientEffect,
3
3
  mcpHealthEffect,
4
4
  mcpToolsEffect
5
- } from "../chunk-MBCUKNUA.js";
5
+ } from "../chunk-DXZEKRIW.js";
6
6
  import "../chunk-BCSNKUAC.js";
7
- import "../chunk-FA5MLNYL.js";
8
- import "../chunk-JJZZLNJY.js";
9
- import "../chunk-DYE2CKHG.js";
7
+ import "../chunk-VIFIFPDC.js";
8
+ import "../chunk-7YH74PGP.js";
9
+ import "../chunk-RLV4NKW3.js";
10
10
  import "../chunk-2GPX2E57.js";
11
11
  import "../chunk-PBGPES67.js";
12
- import "../chunk-TNVB3KLB.js";
13
- import "../chunk-6F3WAXVN.js";
12
+ import "../chunk-EQVLEJTX.js";
13
+ import "../chunk-7N2UOAMJ.js";
14
14
  import "../chunk-MN5XVRKW.js";
15
15
  import "../chunk-6WC2OWHV.js";
16
16
  import "../chunk-4PIQKACY.js";
17
- import "../chunk-RKFLB36H.js";
17
+ import "../chunk-VAI3EVCS.js";
18
18
  import "../chunk-URKOTNDA.js";
19
19
  import "../chunk-YDW7DX3A.js";
20
20
  import "../chunk-OWN3DP2W.js";
package/js/mcp.js CHANGED
@@ -1,30 +1,30 @@
1
1
  import {
2
2
  catalogCache,
3
3
  catalogScope
4
- } from "./chunk-6C2I6JLA.js";
4
+ } from "./chunk-4CCDS4U7.js";
5
5
  import {
6
6
  protocolOperations
7
- } from "./chunk-ATBBIJ5O.js";
7
+ } from "./chunk-OGUGI2I6.js";
8
8
  import {
9
9
  adaptMcpTool,
10
10
  mcpClientEffect,
11
11
  mcpHealthEffect
12
- } from "./chunk-MBCUKNUA.js";
12
+ } from "./chunk-DXZEKRIW.js";
13
13
  import "./chunk-BCSNKUAC.js";
14
- import "./chunk-FA5MLNYL.js";
14
+ import "./chunk-VIFIFPDC.js";
15
15
  import {
16
16
  cacheKey
17
- } from "./chunk-JJZZLNJY.js";
17
+ } from "./chunk-7YH74PGP.js";
18
18
  import {
19
19
  operationDescription
20
- } from "./chunk-DYE2CKHG.js";
20
+ } from "./chunk-RLV4NKW3.js";
21
21
  import "./chunk-2GPX2E57.js";
22
22
  import "./chunk-PBGPES67.js";
23
- import "./chunk-TNVB3KLB.js";
23
+ import "./chunk-EQVLEJTX.js";
24
24
  import {
25
25
  nativeOperation,
26
26
  routerDeclaration
27
- } from "./chunk-6F3WAXVN.js";
27
+ } from "./chunk-7N2UOAMJ.js";
28
28
  import {
29
29
  fromPromise,
30
30
  method
@@ -37,7 +37,7 @@ import {
37
37
  McpToolsOptions
38
38
  } from "./chunk-6WC2OWHV.js";
39
39
  import "./chunk-4PIQKACY.js";
40
- import "./chunk-RKFLB36H.js";
40
+ import "./chunk-VAI3EVCS.js";
41
41
  import "./chunk-URKOTNDA.js";
42
42
  import "./chunk-YDW7DX3A.js";
43
43
  import "./chunk-OWN3DP2W.js";
package/js/openapi.js CHANGED
@@ -8,7 +8,7 @@ import {
8
8
  import {
9
9
  protocolOperations,
10
10
  protocolRouter
11
- } from "./chunk-ATBBIJ5O.js";
11
+ } from "./chunk-OGUGI2I6.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-DYE2CKHG.js";
32
+ } from "./chunk-RLV4NKW3.js";
33
33
  import {
34
34
  failOnNetworkRefusal
35
35
  } from "./chunk-2GPX2E57.js";
@@ -37,7 +37,7 @@ import "./chunk-PBGPES67.js";
37
37
  import {
38
38
  nativeOperation,
39
39
  routerDeclaration
40
- } from "./chunk-6F3WAXVN.js";
40
+ } from "./chunk-7N2UOAMJ.js";
41
41
  import {
42
42
  accountProviderError,
43
43
  bodyUpstreamError,
@@ -64,7 +64,7 @@ import {
64
64
  lazyJsonSchemaDecoder,
65
65
  once,
66
66
  wrap
67
- } from "./chunk-RKFLB36H.js";
67
+ } from "./chunk-VAI3EVCS.js";
68
68
  import {
69
69
  owned
70
70
  } from "./chunk-URKOTNDA.js";
package/js/skills.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  catalogCache,
3
3
  catalogScope
4
- } from "./chunk-6C2I6JLA.js";
5
- import "./chunk-JJZZLNJY.js";
4
+ } from "./chunk-4CCDS4U7.js";
5
+ import "./chunk-7YH74PGP.js";
6
6
  import {
7
7
  failOnNetworkRefusal
8
8
  } from "./chunk-2GPX2E57.js";
@@ -34,7 +34,7 @@ import {
34
34
  } from "./chunk-4PIQKACY.js";
35
35
  import {
36
36
  wrap
37
- } from "./chunk-RKFLB36H.js";
37
+ } from "./chunk-VAI3EVCS.js";
38
38
  import "./chunk-URKOTNDA.js";
39
39
  import {
40
40
  FetchHttpClient_exports
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "apps",
3
- "version": "0.0.1-beta.94",
3
+ "version": "0.0.1-beta.95",
4
4
  "description": "TypeScript apps with typed tools, accounts, storage, and UI.",
5
5
  "type": "module",
6
6
  "sideEffects": false,