@takeshape/schema 11.144.1 → 11.154.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.
- package/examples/latest/all-fields-shapes-inline.json +1 -1
- package/examples/latest/all-fields-shapes.json +1 -1
- package/examples/latest/betzino.json +1 -1
- package/examples/latest/blog-schema.json +1 -1
- package/examples/latest/brewery-schema.json +1 -1
- package/examples/latest/chat-agent-schema.json +1 -1
- package/examples/latest/clear-cache-schema.json +1 -1
- package/examples/latest/complex-project-schema.json +1 -1
- package/examples/latest/complex-schema.json +1 -1
- package/examples/latest/edit-schema.json +1 -1
- package/examples/latest/frank-and-fred-schema.json +1 -1
- package/examples/latest/generate-agent-schema.json +1 -1
- package/examples/latest/klirr-schema.json +1 -1
- package/examples/latest/layers/rick-and-morty-layer.json +1 -1
- package/examples/latest/layers/shopify-layer-2023-01.json +1 -1
- package/examples/latest/layers/shopify-storefront-2023-04.json +1 -1
- package/examples/latest/layers/wordpress-2024-01.json +1 -1
- package/examples/latest/massive-schema.json +1 -1
- package/examples/latest/mill-components-schema.json +1 -1
- package/examples/latest/nested-shape-arrays.json +1 -1
- package/examples/latest/one-earth.json +1 -1
- package/examples/latest/pet-oneof-array.json +1 -1
- package/examples/latest/post-schema.json +1 -1
- package/examples/latest/pruned-shopify-product-schema.json +1 -1
- package/examples/latest/rag-example.json +1 -1
- package/examples/latest/real-world-schema.json +1 -1
- package/examples/latest/recursive-repeater-schema.json +1 -1
- package/examples/latest/recursive-schema.json +1 -1
- package/examples/latest/rick-and-morty-ast.json +1 -1
- package/examples/latest/rick-and-morty-graphql.json +1 -1
- package/examples/latest/rick-and-morty-rest.json +1 -1
- package/examples/latest/rick-and-morty-user-schema.json +1 -1
- package/examples/latest/rick-and-morty-with-indexing.json +1 -1
- package/examples/latest/schema-where-filter.json +1 -1
- package/examples/latest/schema-with-repeater-draftjs.json +1 -1
- package/examples/latest/schema-with-rick-and-morty.json +1 -1
- package/examples/latest/shape-books-v3_2_0.json +1 -1
- package/examples/latest/shape-books.json +1 -1
- package/examples/latest/shape-editor-schema-edited.json +1 -1
- package/examples/latest/shape-editor-schema-initial.json +1 -1
- package/examples/latest/shapedb-crud-every-prop-type.json +1 -1
- package/examples/latest/shopify-lookbook.json +1 -1
- package/examples/latest/shopify-product-2022-07.json +1 -1
- package/examples/latest/shopify-product-2023-04.json +1 -1
- package/examples/latest/shopify-store-with-widget.json +1 -1
- package/examples/latest/stripe-product-runtime-schema.json +1 -1
- package/examples/latest/stripe-starter-resolved.json +1 -1
- package/examples/latest/user-schema-no-required.json +1 -1
- package/examples/latest/user-schema-with-defaults.json +1 -1
- package/examples/latest/valvoline-ai-demo.json +1461 -1421
- package/examples/latest/vector-search-schema.json +1 -1
- package/package.json +10 -9
- package/dist/agents.d.ts +0 -62
- package/dist/agents.js +0 -338
- package/dist/api-version.d.ts +0 -5
- package/dist/api-version.js +0 -17
- package/dist/auth-schemas.d.ts +0 -128
- package/dist/auth-schemas.js +0 -7
- package/dist/auth-utils.d.ts +0 -5
- package/dist/auth-utils.js +0 -6
- package/dist/builtin-schema.d.ts +0 -18
- package/dist/builtin-schema.js +0 -683
- package/dist/constants.d.ts +0 -1
- package/dist/constants.js +0 -1
- package/dist/content-schema-transform.d.ts +0 -35
- package/dist/content-schema-transform.js +0 -162
- package/dist/create-input-schema.d.ts +0 -9
- package/dist/create-input-schema.js +0 -68
- package/dist/enum.d.ts +0 -2
- package/dist/enum.js +0 -9
- package/dist/flatten-templates.d.ts +0 -2
- package/dist/flatten-templates.js +0 -20
- package/dist/get-is-leaf.d.ts +0 -3
- package/dist/get-is-leaf.js +0 -56
- package/dist/index.d.ts +0 -62
- package/dist/index.js +0 -59
- package/dist/interfaces.d.ts +0 -14
- package/dist/interfaces.js +0 -86
- package/dist/layers/layers.d.ts +0 -26
- package/dist/layers/layers.js +0 -301
- package/dist/layers/refs.d.ts +0 -102
- package/dist/layers/refs.js +0 -220
- package/dist/layers/type-utils.d.ts +0 -59
- package/dist/layers/type-utils.js +0 -118
- package/dist/layers/visitor.d.ts +0 -5
- package/dist/layers/visitor.js +0 -38
- package/dist/migration/index.d.ts +0 -73
- package/dist/migration/index.js +0 -103
- package/dist/migration/to/v3.0.0.d.ts +0 -4
- package/dist/migration/to/v3.0.0.js +0 -212
- package/dist/migration/to/v3.1.0.d.ts +0 -4
- package/dist/migration/to/v3.1.0.js +0 -194
- package/dist/migration/to/v3.10.0.d.ts +0 -4
- package/dist/migration/to/v3.10.0.js +0 -67
- package/dist/migration/to/v3.11.0.d.ts +0 -4
- package/dist/migration/to/v3.11.0.js +0 -85
- package/dist/migration/to/v3.12.3.d.ts +0 -4
- package/dist/migration/to/v3.12.3.js +0 -87
- package/dist/migration/to/v3.13.0.d.ts +0 -4
- package/dist/migration/to/v3.13.0.js +0 -17
- package/dist/migration/to/v3.17.0.d.ts +0 -4
- package/dist/migration/to/v3.17.0.js +0 -22
- package/dist/migration/to/v3.18.0.d.ts +0 -4
- package/dist/migration/to/v3.18.0.js +0 -64
- package/dist/migration/to/v3.18.1.d.ts +0 -4
- package/dist/migration/to/v3.18.1.js +0 -12
- package/dist/migration/to/v3.18.2.d.ts +0 -4
- package/dist/migration/to/v3.18.2.js +0 -19
- package/dist/migration/to/v3.20.0.d.ts +0 -4
- package/dist/migration/to/v3.20.0.js +0 -24
- package/dist/migration/to/v3.22.0.d.ts +0 -4
- package/dist/migration/to/v3.22.0.js +0 -25
- package/dist/migration/to/v3.24.0.d.ts +0 -4
- package/dist/migration/to/v3.24.0.js +0 -11
- package/dist/migration/to/v3.25.0.d.ts +0 -4
- package/dist/migration/to/v3.25.0.js +0 -11
- package/dist/migration/to/v3.3.0.d.ts +0 -4
- package/dist/migration/to/v3.3.0.js +0 -13
- package/dist/migration/to/v3.31.0.d.ts +0 -4
- package/dist/migration/to/v3.31.0.js +0 -38
- package/dist/migration/to/v3.32.0.d.ts +0 -4
- package/dist/migration/to/v3.32.0.js +0 -59
- package/dist/migration/to/v3.34.0.d.ts +0 -6
- package/dist/migration/to/v3.34.0.js +0 -111
- package/dist/migration/to/v3.36.0.d.ts +0 -4
- package/dist/migration/to/v3.36.0.js +0 -22
- package/dist/migration/to/v3.39.0.d.ts +0 -4
- package/dist/migration/to/v3.39.0.js +0 -45
- package/dist/migration/to/v3.40.0.d.ts +0 -4
- package/dist/migration/to/v3.40.0.js +0 -26
- package/dist/migration/to/v3.46.0.d.ts +0 -4
- package/dist/migration/to/v3.46.0.js +0 -35
- package/dist/migration/to/v3.57.0.d.ts +0 -4
- package/dist/migration/to/v3.57.0.js +0 -18
- package/dist/migration/to/v3.9.0.d.ts +0 -4
- package/dist/migration/to/v3.9.0.js +0 -79
- package/dist/migration/types.d.ts +0 -26
- package/dist/migration/types.js +0 -3
- package/dist/migration/utils.d.ts +0 -2
- package/dist/migration/utils.js +0 -6
- package/dist/mocks.d.ts +0 -14
- package/dist/mocks.js +0 -58
- package/dist/models/agent.d.ts +0 -3
- package/dist/models/agent.js +0 -29
- package/dist/models/project-schema.d.ts +0 -18
- package/dist/models/project-schema.js +0 -119
- package/dist/models/query.d.ts +0 -3
- package/dist/models/query.js +0 -38
- package/dist/models/runtime-schema.d.ts +0 -9
- package/dist/models/runtime-schema.js +0 -20
- package/dist/models/shape.d.ts +0 -4
- package/dist/models/shape.js +0 -36
- package/dist/models/types.d.ts +0 -36
- package/dist/models/types.js +0 -1
- package/dist/models/user-schema.d.ts +0 -7
- package/dist/models/user-schema.js +0 -9
- package/dist/patterns.d.ts +0 -12
- package/dist/patterns.js +0 -1
- package/dist/project-schema/index.d.ts +0 -211
- package/dist/project-schema/index.js +0 -83
- package/dist/project-schema/latest.d.ts +0 -2619
- package/dist/project-schema/latest.js +0 -7
- package/dist/project-schema/migrate.d.ts +0 -4
- package/dist/project-schema/migrate.js +0 -218
- package/dist/project-schema/v1.0.0.d.ts +0 -299
- package/dist/project-schema/v1.0.0.js +0 -7
- package/dist/project-schema/v3.0.0.d.ts +0 -478
- package/dist/project-schema/v3.0.0.js +0 -7
- package/dist/project-schema/v3.1.0.d.ts +0 -621
- package/dist/project-schema/v3.1.0.js +0 -7
- package/dist/project-schema/v3.10.0.d.ts +0 -1201
- package/dist/project-schema/v3.10.0.js +0 -7
- package/dist/project-schema/v3.11.0.d.ts +0 -1210
- package/dist/project-schema/v3.11.0.js +0 -7
- package/dist/project-schema/v3.12.0.d.ts +0 -1214
- package/dist/project-schema/v3.12.0.js +0 -7
- package/dist/project-schema/v3.12.1.d.ts +0 -1273
- package/dist/project-schema/v3.12.1.js +0 -7
- package/dist/project-schema/v3.12.2.d.ts +0 -1283
- package/dist/project-schema/v3.12.2.js +0 -7
- package/dist/project-schema/v3.12.3.d.ts +0 -1306
- package/dist/project-schema/v3.12.3.js +0 -7
- package/dist/project-schema/v3.13.0.d.ts +0 -1317
- package/dist/project-schema/v3.13.0.js +0 -7
- package/dist/project-schema/v3.13.1.d.ts +0 -1412
- package/dist/project-schema/v3.13.1.js +0 -7
- package/dist/project-schema/v3.14.0.d.ts +0 -1436
- package/dist/project-schema/v3.14.0.js +0 -7
- package/dist/project-schema/v3.15.0.d.ts +0 -1458
- package/dist/project-schema/v3.15.0.js +0 -7
- package/dist/project-schema/v3.16.0.d.ts +0 -1470
- package/dist/project-schema/v3.16.0.js +0 -7
- package/dist/project-schema/v3.17.0.d.ts +0 -1467
- package/dist/project-schema/v3.17.0.js +0 -7
- package/dist/project-schema/v3.17.1.d.ts +0 -1468
- package/dist/project-schema/v3.17.1.js +0 -7
- package/dist/project-schema/v3.18.0.d.ts +0 -1333
- package/dist/project-schema/v3.18.0.js +0 -7
- package/dist/project-schema/v3.18.1.d.ts +0 -1332
- package/dist/project-schema/v3.18.1.js +0 -7
- package/dist/project-schema/v3.18.2.d.ts +0 -1332
- package/dist/project-schema/v3.18.2.js +0 -7
- package/dist/project-schema/v3.19.0.d.ts +0 -1336
- package/dist/project-schema/v3.19.0.js +0 -7
- package/dist/project-schema/v3.2.0.d.ts +0 -632
- package/dist/project-schema/v3.2.0.js +0 -7
- package/dist/project-schema/v3.20.0.d.ts +0 -1336
- package/dist/project-schema/v3.20.0.js +0 -7
- package/dist/project-schema/v3.21.0.d.ts +0 -1338
- package/dist/project-schema/v3.21.0.js +0 -7
- package/dist/project-schema/v3.22.0.d.ts +0 -1344
- package/dist/project-schema/v3.22.0.js +0 -7
- package/dist/project-schema/v3.23.0.d.ts +0 -1376
- package/dist/project-schema/v3.23.0.js +0 -7
- package/dist/project-schema/v3.24.0.d.ts +0 -1364
- package/dist/project-schema/v3.24.0.js +0 -7
- package/dist/project-schema/v3.25.0.d.ts +0 -1363
- package/dist/project-schema/v3.25.0.js +0 -7
- package/dist/project-schema/v3.26.0.d.ts +0 -1388
- package/dist/project-schema/v3.26.0.js +0 -7
- package/dist/project-schema/v3.27.0.d.ts +0 -1397
- package/dist/project-schema/v3.27.0.js +0 -7
- package/dist/project-schema/v3.28.0.d.ts +0 -1416
- package/dist/project-schema/v3.28.0.js +0 -7
- package/dist/project-schema/v3.29.0.d.ts +0 -1423
- package/dist/project-schema/v3.29.0.js +0 -7
- package/dist/project-schema/v3.3.0.d.ts +0 -632
- package/dist/project-schema/v3.3.0.js +0 -7
- package/dist/project-schema/v3.30.0.d.ts +0 -1416
- package/dist/project-schema/v3.30.0.js +0 -7
- package/dist/project-schema/v3.31.0.d.ts +0 -1448
- package/dist/project-schema/v3.31.0.js +0 -7
- package/dist/project-schema/v3.32.0.d.ts +0 -1439
- package/dist/project-schema/v3.32.0.js +0 -7
- package/dist/project-schema/v3.33.0.d.ts +0 -1445
- package/dist/project-schema/v3.33.0.js +0 -7
- package/dist/project-schema/v3.34.0.d.ts +0 -1445
- package/dist/project-schema/v3.34.0.js +0 -7
- package/dist/project-schema/v3.35.0.d.ts +0 -1464
- package/dist/project-schema/v3.35.0.js +0 -7
- package/dist/project-schema/v3.36.0.d.ts +0 -1470
- package/dist/project-schema/v3.36.0.js +0 -7
- package/dist/project-schema/v3.37.0.d.ts +0 -1522
- package/dist/project-schema/v3.37.0.js +0 -7
- package/dist/project-schema/v3.38.0.d.ts +0 -1522
- package/dist/project-schema/v3.38.0.js +0 -7
- package/dist/project-schema/v3.39.0.d.ts +0 -1529
- package/dist/project-schema/v3.39.0.js +0 -7
- package/dist/project-schema/v3.4.0.d.ts +0 -624
- package/dist/project-schema/v3.4.0.js +0 -7
- package/dist/project-schema/v3.40.0.d.ts +0 -1530
- package/dist/project-schema/v3.40.0.js +0 -7
- package/dist/project-schema/v3.41.0.d.ts +0 -1530
- package/dist/project-schema/v3.41.0.js +0 -7
- package/dist/project-schema/v3.42.0.d.ts +0 -1534
- package/dist/project-schema/v3.42.0.js +0 -7
- package/dist/project-schema/v3.43.0.d.ts +0 -1536
- package/dist/project-schema/v3.43.0.js +0 -7
- package/dist/project-schema/v3.44.0.d.ts +0 -1621
- package/dist/project-schema/v3.44.0.js +0 -7
- package/dist/project-schema/v3.45.0.d.ts +0 -1650
- package/dist/project-schema/v3.45.0.js +0 -7
- package/dist/project-schema/v3.46.0.d.ts +0 -1703
- package/dist/project-schema/v3.46.0.js +0 -7
- package/dist/project-schema/v3.47.0.d.ts +0 -1736
- package/dist/project-schema/v3.47.0.js +0 -7
- package/dist/project-schema/v3.48.0.d.ts +0 -2208
- package/dist/project-schema/v3.48.0.js +0 -7
- package/dist/project-schema/v3.49.0.d.ts +0 -2217
- package/dist/project-schema/v3.49.0.js +0 -7
- package/dist/project-schema/v3.5.0.d.ts +0 -649
- package/dist/project-schema/v3.5.0.js +0 -7
- package/dist/project-schema/v3.5.1.d.ts +0 -649
- package/dist/project-schema/v3.5.1.js +0 -7
- package/dist/project-schema/v3.50.0.d.ts +0 -2269
- package/dist/project-schema/v3.50.0.js +0 -7
- package/dist/project-schema/v3.51.0.d.ts +0 -2269
- package/dist/project-schema/v3.51.0.js +0 -7
- package/dist/project-schema/v3.52.0.d.ts +0 -2269
- package/dist/project-schema/v3.52.0.js +0 -7
- package/dist/project-schema/v3.53.0.d.ts +0 -2350
- package/dist/project-schema/v3.53.0.js +0 -7
- package/dist/project-schema/v3.54.0.d.ts +0 -2369
- package/dist/project-schema/v3.54.0.js +0 -7
- package/dist/project-schema/v3.55.0.d.ts +0 -2369
- package/dist/project-schema/v3.55.0.js +0 -7
- package/dist/project-schema/v3.56.0.d.ts +0 -2405
- package/dist/project-schema/v3.56.0.js +0 -7
- package/dist/project-schema/v3.57.0.d.ts +0 -2601
- package/dist/project-schema/v3.57.0.js +0 -7
- package/dist/project-schema/v3.58.0.d.ts +0 -2601
- package/dist/project-schema/v3.58.0.js +0 -7
- package/dist/project-schema/v3.59.0.d.ts +0 -2619
- package/dist/project-schema/v3.59.0.js +0 -7
- package/dist/project-schema/v3.6.0.d.ts +0 -658
- package/dist/project-schema/v3.6.0.js +0 -7
- package/dist/project-schema/v3.7.0.d.ts +0 -961
- package/dist/project-schema/v3.7.0.js +0 -7
- package/dist/project-schema/v3.8.0.d.ts +0 -979
- package/dist/project-schema/v3.8.0.js +0 -7
- package/dist/project-schema/v3.9.0.d.ts +0 -1178
- package/dist/project-schema/v3.9.0.js +0 -7
- package/dist/project-schema/v4.0.0.d.ts +0 -1328
- package/dist/project-schema/v4.0.0.js +0 -7
- package/dist/refs.d.ts +0 -218
- package/dist/refs.js +0 -616
- package/dist/relationships.d.ts +0 -40
- package/dist/relationships.js +0 -302
- package/dist/resolvers/ai/abort-agent-message-args.d.ts +0 -16
- package/dist/resolvers/ai/abort-agent-message-args.js +0 -13
- package/dist/resolvers/ai/abort-agent-message-response.d.ts +0 -39
- package/dist/resolvers/ai/abort-agent-message-response.js +0 -19
- package/dist/resolvers/ai/agent-chat-args.d.ts +0 -17
- package/dist/resolvers/ai/agent-chat-args.js +0 -14
- package/dist/resolvers/ai/agent-chat-payload.d.ts +0 -35
- package/dist/resolvers/ai/agent-chat-payload.js +0 -26
- package/dist/resolvers/ai/agent-chat-response.d.ts +0 -289
- package/dist/resolvers/ai/agent-chat-response.js +0 -21
- package/dist/resolvers/ai/agent-generate-args.d.ts +0 -17
- package/dist/resolvers/ai/agent-generate-args.js +0 -14
- package/dist/resolvers/ai/agent-message-input.d.ts +0 -73
- package/dist/resolvers/ai/agent-message-input.js +0 -39
- package/dist/resolvers/ai/agent-message-output.d.ts +0 -169
- package/dist/resolvers/ai/agent-message-output.js +0 -77
- package/dist/resolvers/ai/agent-message-payload.d.ts +0 -507
- package/dist/resolvers/ai/agent-message-payload.js +0 -156
- package/dist/resolvers/ai/agent-run-mode.d.ts +0 -7
- package/dist/resolvers/ai/agent-run-mode.js +0 -9
- package/dist/resolvers/ai/agent-session-payload.d.ts +0 -515
- package/dist/resolvers/ai/agent-session-payload.js +0 -175
- package/dist/resolvers/ai/create-agent-session-response.d.ts +0 -199
- package/dist/resolvers/ai/create-agent-session-response.js +0 -9
- package/dist/resolvers/ai/embedding-search.d.ts +0 -54
- package/dist/resolvers/ai/embedding-search.js +0 -46
- package/dist/resolvers/ai/get-agent-message-args.d.ts +0 -16
- package/dist/resolvers/ai/get-agent-message-args.js +0 -13
- package/dist/resolvers/ai/get-agent-message-response.d.ts +0 -805
- package/dist/resolvers/ai/get-agent-message-response.js +0 -63
- package/dist/resolvers/ai/inspect-agent-args.d.ts +0 -16
- package/dist/resolvers/ai/inspect-agent-args.js +0 -13
- package/dist/resolvers/ai/inspect-agent-response.d.ts +0 -504
- package/dist/resolvers/ai/inspect-agent-response.js +0 -48
- package/dist/resolvers/ai/send-agent-feedback-args.d.ts +0 -52
- package/dist/resolvers/ai/send-agent-feedback-args.js +0 -16
- package/dist/resolvers/ai/send-agent-message-args.d.ts +0 -48
- package/dist/resolvers/ai/send-agent-message-args.js +0 -36
- package/dist/resolvers/ai/send-agent-message-response.d.ts +0 -353
- package/dist/resolvers/ai/send-agent-message-response.js +0 -51
- package/dist/resolvers/ai/types.d.ts +0 -6
- package/dist/resolvers/ai/types.js +0 -1
- package/dist/resolvers/takeshape/assets/asset-image-meta.d.ts +0 -79
- package/dist/resolvers/takeshape/assets/asset-image-meta.js +0 -98
- package/dist/resolvers/takeshape/assets/asset-image-params.d.ts +0 -901
- package/dist/resolvers/takeshape/assets/asset-image-params.js +0 -726
- package/dist/resolvers/takeshape/assets/asset-image.d.ts +0 -17
- package/dist/resolvers/takeshape/assets/asset-image.js +0 -15
- package/dist/resolvers/takeshape/assets/asset.d.ts +0 -125
- package/dist/resolvers/takeshape/assets/asset.js +0 -107
- package/dist/resolvers/takeshape/assets/constants.d.ts +0 -11
- package/dist/resolvers/takeshape/assets/constants.js +0 -11
- package/dist/resolvers/takeshape/builtins/constants.d.ts +0 -1
- package/dist/resolvers/takeshape/builtins/constants.js +0 -1
- package/dist/runtime-schema.d.ts +0 -6
- package/dist/runtime-schema.js +0 -85
- package/dist/scalars.d.ts +0 -2
- package/dist/scalars.js +0 -4
- package/dist/schema-transform.d.ts +0 -19
- package/dist/schema-transform.js +0 -74
- package/dist/schema-util.d.ts +0 -266
- package/dist/schema-util.js +0 -1127
- package/dist/schemas/auth-schemas.json +0 -374
- package/dist/schemas/index.d.ts +0 -4
- package/dist/schemas/index.js +0 -170
- package/dist/schemas/project-schema/experimental-2025-07.json +0 -1297
- package/dist/schemas/project-schema/latest.d.ts +0 -180
- package/dist/schemas/project-schema/latest.js +0 -11
- package/dist/schemas/project-schema/latest.json +0 -4846
- package/dist/schemas/project-schema/meta-schema-v1.0.0.json +0 -193
- package/dist/schemas/project-schema/meta-schema-v3.0.0.json +0 -608
- package/dist/schemas/project-schema/meta-schema-v3.1.0.json +0 -608
- package/dist/schemas/project-schema/meta-schema-v3.2.0.json +0 -612
- package/dist/schemas/project-schema/meta-schema-v3.3.0.json +0 -612
- package/dist/schemas/project-schema/meta-schema-v3.4.0.json +0 -637
- package/dist/schemas/project-schema/meta-schema-v3.5.0.json +0 -626
- package/dist/schemas/project-schema/meta-schema-v3.5.1.json +0 -626
- package/dist/schemas/project-schema/meta-schema-v3.6.0.json +0 -629
- package/dist/schemas/project-schema/meta-schema-v3.7.0.json +0 -1137
- package/dist/schemas/project-schema/meta-schema-v3.8.0.json +0 -1137
- package/dist/schemas/project-schema/meta-schema-v3.9.0.json +0 -1477
- package/dist/schemas/project-schema/v1.0.0.json +0 -321
- package/dist/schemas/project-schema/v3.0.0.json +0 -414
- package/dist/schemas/project-schema/v3.1.0.json +0 -572
- package/dist/schemas/project-schema/v3.10.0.json +0 -2097
- package/dist/schemas/project-schema/v3.11.0.json +0 -2141
- package/dist/schemas/project-schema/v3.12.0.json +0 -2144
- package/dist/schemas/project-schema/v3.12.1.json +0 -2282
- package/dist/schemas/project-schema/v3.12.2.json +0 -2304
- package/dist/schemas/project-schema/v3.12.3.json +0 -2357
- package/dist/schemas/project-schema/v3.13.0.json +0 -2377
- package/dist/schemas/project-schema/v3.14.0.json +0 -2385
- package/dist/schemas/project-schema/v3.15.0.json +0 -2365
- package/dist/schemas/project-schema/v3.16.0.json +0 -2373
- package/dist/schemas/project-schema/v3.17.0.json +0 -2378
- package/dist/schemas/project-schema/v3.17.1.json +0 -2380
- package/dist/schemas/project-schema/v3.18.0.json +0 -2356
- package/dist/schemas/project-schema/v3.18.1.json +0 -2357
- package/dist/schemas/project-schema/v3.18.2.json +0 -2357
- package/dist/schemas/project-schema/v3.19.0.json +0 -2369
- package/dist/schemas/project-schema/v3.2.0.json +0 -580
- package/dist/schemas/project-schema/v3.20.0.json +0 -2369
- package/dist/schemas/project-schema/v3.21.0.json +0 -2376
- package/dist/schemas/project-schema/v3.22.0.json +0 -2381
- package/dist/schemas/project-schema/v3.23.0.json +0 -2456
- package/dist/schemas/project-schema/v3.24.0.json +0 -2556
- package/dist/schemas/project-schema/v3.25.0.json +0 -2552
- package/dist/schemas/project-schema/v3.26.0.json +0 -2599
- package/dist/schemas/project-schema/v3.27.0.json +0 -2611
- package/dist/schemas/project-schema/v3.28.0.json +0 -2656
- package/dist/schemas/project-schema/v3.29.0.json +0 -2670
- package/dist/schemas/project-schema/v3.3.0.json +0 -581
- package/dist/schemas/project-schema/v3.30.0.json +0 -2656
- package/dist/schemas/project-schema/v3.31.0.json +0 -2714
- package/dist/schemas/project-schema/v3.32.0.json +0 -2708
- package/dist/schemas/project-schema/v3.33.0.json +0 -2715
- package/dist/schemas/project-schema/v3.34.0.json +0 -2715
- package/dist/schemas/project-schema/v3.35.0.json +0 -2748
- package/dist/schemas/project-schema/v3.36.0.json +0 -2756
- package/dist/schemas/project-schema/v3.37.0.json +0 -2821
- package/dist/schemas/project-schema/v3.38.0.json +0 -2819
- package/dist/schemas/project-schema/v3.39.0.json +0 -2827
- package/dist/schemas/project-schema/v3.4.0.json +0 -571
- package/dist/schemas/project-schema/v3.40.0.json +0 -2830
- package/dist/schemas/project-schema/v3.41.0.json +0 -2830
- package/dist/schemas/project-schema/v3.42.0.json +0 -2835
- package/dist/schemas/project-schema/v3.43.0.json +0 -2841
- package/dist/schemas/project-schema/v3.44.0.json +0 -3013
- package/dist/schemas/project-schema/v3.45.0.json +0 -3064
- package/dist/schemas/project-schema/v3.46.0.json +0 -3136
- package/dist/schemas/project-schema/v3.47.0.json +0 -3189
- package/dist/schemas/project-schema/v3.48.0.json +0 -3196
- package/dist/schemas/project-schema/v3.49.0.json +0 -3239
- package/dist/schemas/project-schema/v3.5.0.json +0 -571
- package/dist/schemas/project-schema/v3.5.1.json +0 -571
- package/dist/schemas/project-schema/v3.50.0.json +0 -3320
- package/dist/schemas/project-schema/v3.51.0.json +0 -3326
- package/dist/schemas/project-schema/v3.52.0.json +0 -3326
- package/dist/schemas/project-schema/v3.53.0.json +0 -3476
- package/dist/schemas/project-schema/v3.54.0.json +0 -3512
- package/dist/schemas/project-schema/v3.55.0.json +0 -3515
- package/dist/schemas/project-schema/v3.56.0.json +0 -3530
- package/dist/schemas/project-schema/v3.57.0.json +0 -4815
- package/dist/schemas/project-schema/v3.58.0.json +0 -4815
- package/dist/schemas/project-schema/v3.59.0.json +0 -4846
- package/dist/schemas/project-schema/v3.6.0.json +0 -587
- package/dist/schemas/project-schema/v3.7.0.json +0 -587
- package/dist/schemas/project-schema/v3.8.0.json +0 -604
- package/dist/schemas/project-schema/v3.9.0.json +0 -604
- package/dist/schemas/project-schema/v4.0.0.json +0 -2316
- package/dist/schemas/project-schema.json +0 -214
- package/dist/service-dependencies.d.ts +0 -13
- package/dist/service-dependencies.js +0 -165
- package/dist/services/services.d.ts +0 -31
- package/dist/services/services.js +0 -145
- package/dist/services/types.d.ts +0 -11
- package/dist/services/types.js +0 -1
- package/dist/services/util.d.ts +0 -16
- package/dist/services/util.js +0 -36
- package/dist/shape-paths.d.ts +0 -7
- package/dist/shape-paths.js +0 -28
- package/dist/taxonomies.d.ts +0 -15
- package/dist/taxonomies.js +0 -24
- package/dist/template-shapes/index.d.ts +0 -7
- package/dist/template-shapes/index.js +0 -33
- package/dist/template-shapes/names.d.ts +0 -10
- package/dist/template-shapes/names.js +0 -21
- package/dist/template-shapes/templates.d.ts +0 -32
- package/dist/template-shapes/templates.js +0 -316
- package/dist/template-shapes/types.d.ts +0 -15
- package/dist/template-shapes/types.js +0 -7
- package/dist/template-shapes/where.d.ts +0 -37
- package/dist/template-shapes/where.js +0 -400
- package/dist/types/index.d.ts +0 -3
- package/dist/types/index.js +0 -2
- package/dist/types/transforms.d.ts +0 -15
- package/dist/types/transforms.js +0 -1
- package/dist/types/types.d.ts +0 -200
- package/dist/types/types.js +0 -10
- package/dist/types/utils.d.ts +0 -112
- package/dist/types/utils.js +0 -269
- package/dist/unions.d.ts +0 -14
- package/dist/unions.js +0 -77
- package/dist/util/ai-tools.d.ts +0 -2
- package/dist/util/ai-tools.js +0 -14
- package/dist/util/api-indexing.d.ts +0 -9
- package/dist/util/api-indexing.js +0 -57
- package/dist/util/coerce-value.d.ts +0 -9
- package/dist/util/coerce-value.js +0 -32
- package/dist/util/detect-cycles.d.ts +0 -7
- package/dist/util/detect-cycles.js +0 -45
- package/dist/util/expressions.d.ts +0 -34
- package/dist/util/expressions.js +0 -350
- package/dist/util/find-shape-at-path.d.ts +0 -21
- package/dist/util/find-shape-at-path.js +0 -53
- package/dist/util/form-config.d.ts +0 -11
- package/dist/util/form-config.js +0 -62
- package/dist/util/get-conflicting-properties.d.ts +0 -6
- package/dist/util/get-conflicting-properties.js +0 -55
- package/dist/util/get-return-shape.d.ts +0 -4
- package/dist/util/get-return-shape.js +0 -30
- package/dist/util/has-arg.d.ts +0 -6
- package/dist/util/has-arg.js +0 -25
- package/dist/util/is-asset-property.d.ts +0 -3
- package/dist/util/is-asset-property.js +0 -11
- package/dist/util/mcp.d.ts +0 -8
- package/dist/util/mcp.js +0 -21
- package/dist/util/merge.d.ts +0 -15
- package/dist/util/merge.js +0 -254
- package/dist/util/patch-schema.d.ts +0 -8
- package/dist/util/patch-schema.js +0 -51
- package/dist/util/query-field-path.d.ts +0 -9
- package/dist/util/query-field-path.js +0 -23
- package/dist/util/shapes.d.ts +0 -5
- package/dist/util/shapes.js +0 -22
- package/dist/validate/ai.d.ts +0 -6
- package/dist/validate/ai.js +0 -183
- package/dist/validate/errors.d.ts +0 -3
- package/dist/validate/errors.js +0 -20
- package/dist/validate/types.d.ts +0 -1
- package/dist/validate/types.js +0 -1
- package/dist/validate/util.d.ts +0 -3
- package/dist/validate/util.js +0 -28
- package/dist/validate/validate.d.ts +0 -80
- package/dist/validate/validate.js +0 -1058
- package/dist/versions.d.ts +0 -4
- package/dist/versions.js +0 -4
- package/dist/workflows.d.ts +0 -14
- package/dist/workflows.js +0 -66
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@takeshape/schema",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.154.1",
|
|
4
4
|
"description": "TakeShape Schema",
|
|
5
5
|
"homepage": "https://www.takeshape.io",
|
|
6
6
|
"repository": {
|
|
@@ -44,6 +44,7 @@
|
|
|
44
44
|
"examples"
|
|
45
45
|
],
|
|
46
46
|
"dependencies": {
|
|
47
|
+
"@0no-co/graphql.web": "1.2.0",
|
|
47
48
|
"@jsep-plugin/object": "1.2.2",
|
|
48
49
|
"ajv": "8.13.0",
|
|
49
50
|
"ajv-formats": "3.0.1",
|
|
@@ -56,27 +57,27 @@
|
|
|
56
57
|
"p-reduce": "3.0.0",
|
|
57
58
|
"semver": "7.7.2",
|
|
58
59
|
"tiny-invariant": "1.3.3",
|
|
59
|
-
"@takeshape/errors": "11.
|
|
60
|
-
"@takeshape/json-schema": "11.
|
|
61
|
-
"@takeshape/util": "11.
|
|
60
|
+
"@takeshape/errors": "11.154.1",
|
|
61
|
+
"@takeshape/json-schema": "11.154.1",
|
|
62
|
+
"@takeshape/util": "11.154.1"
|
|
62
63
|
},
|
|
63
64
|
"devDependencies": {
|
|
64
65
|
"@takeshape/json-schema-to-typescript": "11.0.0",
|
|
65
66
|
"@types/blueimp-md5": "2.7.0",
|
|
66
|
-
"@types/glob": "
|
|
67
|
+
"@types/glob": "8.1.0",
|
|
67
68
|
"@types/json-schema": "7.0.15",
|
|
68
69
|
"@types/lodash": "4.17.20",
|
|
69
70
|
"@types/minimatch": "3.0.5",
|
|
70
71
|
"@types/semver": "7.5.8",
|
|
71
72
|
"@types/shortid": "0.0.29",
|
|
72
|
-
"ai": "
|
|
73
|
+
"ai": "5.0.95",
|
|
73
74
|
"fast-xml-parser": "4.4.1",
|
|
74
75
|
"fs-extra": "8.1.0",
|
|
75
|
-
"glob": "
|
|
76
|
+
"glob": "11.0.1",
|
|
76
77
|
"json-schema-to-ts": "3.1.1",
|
|
77
78
|
"shortid": "2.2.16",
|
|
78
|
-
"@takeshape/infra": "11.
|
|
79
|
-
"@takeshape/logger": "11.
|
|
79
|
+
"@takeshape/infra": "11.154.1",
|
|
80
|
+
"@takeshape/logger": "11.154.1"
|
|
80
81
|
},
|
|
81
82
|
"engines": {
|
|
82
83
|
"node": ">=22"
|
package/dist/agents.d.ts
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import type { AgentJSON, AgentMap, GuardJSON, GuardMap, ProjectSchemaJSON, QueryJSON } from './project-schema/index.ts';
|
|
2
|
-
/**
|
|
3
|
-
* Special transition destination ID for a newly created, never started session.
|
|
4
|
-
*/
|
|
5
|
-
export declare const AGENT_SESSION_CREATED = "SESSION_CREATED";
|
|
6
|
-
/**
|
|
7
|
-
* Special transition destination ID for a started session.
|
|
8
|
-
*/
|
|
9
|
-
export declare const START_AGENT_EXECUTION = "START";
|
|
10
|
-
/**
|
|
11
|
-
* Special transition destination ID for agent transitions that end the agent execution.
|
|
12
|
-
*/
|
|
13
|
-
export declare const END_AGENT_EXECUTION = "END";
|
|
14
|
-
/**
|
|
15
|
-
* Special history strategy ID that indicates the history should be cleared.
|
|
16
|
-
*/
|
|
17
|
-
export declare const CLEAR_HISTORY_STRATEGY_ID = "clearHistory";
|
|
18
|
-
export declare const EXECUTION_TYPE_CHAT = "chat";
|
|
19
|
-
export declare const EXECUTION_TYPE_GENERATE = "generate";
|
|
20
|
-
export declare const EXECUTION_TYPE_GRAPHQL = "graphql";
|
|
21
|
-
export declare function getAgentEndStates(agent: AgentJSON, includeSuspend?: boolean): Set<string>;
|
|
22
|
-
export declare const getCreateAgentSessionMutationName: (agentName: string) => string;
|
|
23
|
-
export declare const getInspectAgentQueryName: (agentName: string) => string;
|
|
24
|
-
export declare const getSendAgentFeedbackMutationName: (agentName: string) => string;
|
|
25
|
-
export declare const getGetAgentMessageQueryName: (agentName: string) => string;
|
|
26
|
-
export declare const getAbortAgentMessageMutationName: (agentName: string) => string;
|
|
27
|
-
export declare const getSendAgentMessageMutationName: (inputName: string) => string;
|
|
28
|
-
export declare function getAgentFeatures(agents: AgentMap): Pick<ProjectSchemaJSON, 'queries' | 'mutations' | 'shapes'>;
|
|
29
|
-
export declare function isValidAgentMutation(projectSchema: ProjectSchemaJSON, name: string): boolean;
|
|
30
|
-
export declare function addAiQueries(projectSchema: ProjectSchemaJSON): ProjectSchemaJSON;
|
|
31
|
-
/**
|
|
32
|
-
* Where guards live in the schema.
|
|
33
|
-
*/
|
|
34
|
-
export declare const GUARDS_SCHEMA_PATH: readonly ["guards"];
|
|
35
|
-
export declare const AGENTS_SCHEMA_PATH: readonly ["agents"];
|
|
36
|
-
/**
|
|
37
|
-
* Check if a guard is enabled.
|
|
38
|
-
*/
|
|
39
|
-
export declare const isGuardEnabled: (guard: GuardJSON | undefined) => boolean;
|
|
40
|
-
export declare function getGuardMap(schema: ProjectSchemaJSON): GuardMap | undefined;
|
|
41
|
-
export declare function getGuards(schema: ProjectSchemaJSON): (GuardJSON & {
|
|
42
|
-
id: string;
|
|
43
|
-
})[];
|
|
44
|
-
export declare function setGuardMap<S extends Partial<ProjectSchemaJSON>>(schema: S, guards: GuardMap): S;
|
|
45
|
-
export declare function setGuard<S extends Partial<ProjectSchemaJSON>>(schema: S, id: string, guard: GuardJSON): S;
|
|
46
|
-
/**
|
|
47
|
-
* Get a guard configuration from the project schema.
|
|
48
|
-
*/
|
|
49
|
-
export declare function getGuardConfig(schema: ProjectSchemaJSON, guardId: string): GuardJSON | undefined;
|
|
50
|
-
/**
|
|
51
|
-
* Get a guard configuration from the project schema, but only if it is enabled.
|
|
52
|
-
*/
|
|
53
|
-
export declare function getEnabledGuardConfig(schema: ProjectSchemaJSON, guardId: string): GuardJSON | undefined;
|
|
54
|
-
export declare function getAgentMap(projectSchema: Pick<ProjectSchemaJSON, 'agents'>): AgentMap | undefined;
|
|
55
|
-
export declare function getAgents(projectSchema: Pick<ProjectSchemaJSON, 'agents'>): (AgentJSON & {
|
|
56
|
-
name: string;
|
|
57
|
-
})[] | undefined;
|
|
58
|
-
export declare function setAgentMap<S extends Partial<ProjectSchemaJSON>>(projectSchema: S, agents: AgentMap): S;
|
|
59
|
-
export declare function setAgent<S extends Partial<ProjectSchemaJSON>>(projectSchema: S, name: string, agent: AgentJSON): S;
|
|
60
|
-
export declare function getAgent(projectSchema: ProjectSchemaJSON, name: string): AgentJSON | undefined;
|
|
61
|
-
export declare function ensureAgent(projectSchema: ProjectSchemaJSON, name: string): AgentJSON;
|
|
62
|
-
export declare function isAgentQuery(query: QueryJSON, agentName: string): boolean;
|
package/dist/agents.js
DELETED
|
@@ -1,338 +0,0 @@
|
|
|
1
|
-
import { assert } from '@takeshape/util';
|
|
2
|
-
import set from 'lodash/fp/set.js';
|
|
3
|
-
import get from 'lodash/get.js';
|
|
4
|
-
import uniq from 'lodash/uniq.js';
|
|
5
|
-
import upperFirst from 'lodash/upperFirst.js';
|
|
6
|
-
import * as abortAgentMessageResponse from "./resolvers/ai/abort-agent-message-response.js";
|
|
7
|
-
import * as agentChatPayload from "./resolvers/ai/agent-chat-payload.js";
|
|
8
|
-
import * as agentSessionPayload from "./resolvers/ai/agent-session-payload.js";
|
|
9
|
-
import * as getAgentMessageArgs from "./resolvers/ai/get-agent-message-args.js";
|
|
10
|
-
import * as getAgentMessageResponse from "./resolvers/ai/get-agent-message-response.js";
|
|
11
|
-
import * as inspectAgentArgs from "./resolvers/ai/inspect-agent-args.js";
|
|
12
|
-
import * as inspectAgentResponse from "./resolvers/ai/inspect-agent-response.js";
|
|
13
|
-
import * as sendAgentFeedbackArgs from "./resolvers/ai/send-agent-feedback-args.js";
|
|
14
|
-
import * as sendAgentMessageArgs from "./resolvers/ai/send-agent-message-args.js";
|
|
15
|
-
import * as sendAgentMessageResponse from "./resolvers/ai/send-agent-message-response.js";
|
|
16
|
-
import { JSON_SHAPE_NAME } from "./resolvers/takeshape/builtins/constants.js";
|
|
17
|
-
/**
|
|
18
|
-
* Special transition destination ID for a newly created, never started session.
|
|
19
|
-
*/
|
|
20
|
-
export const AGENT_SESSION_CREATED = 'SESSION_CREATED';
|
|
21
|
-
/**
|
|
22
|
-
* Special transition destination ID for a started session.
|
|
23
|
-
*/
|
|
24
|
-
export const START_AGENT_EXECUTION = 'START';
|
|
25
|
-
/**
|
|
26
|
-
* Special transition destination ID for agent transitions that end the agent execution.
|
|
27
|
-
*/
|
|
28
|
-
export const END_AGENT_EXECUTION = 'END';
|
|
29
|
-
/**
|
|
30
|
-
* Special history strategy ID that indicates the history should be cleared.
|
|
31
|
-
*/
|
|
32
|
-
export const CLEAR_HISTORY_STRATEGY_ID = 'clearHistory';
|
|
33
|
-
export const EXECUTION_TYPE_CHAT = 'chat';
|
|
34
|
-
export const EXECUTION_TYPE_GENERATE = 'generate';
|
|
35
|
-
export const EXECUTION_TYPE_GRAPHQL = 'graphql';
|
|
36
|
-
function canEndOnState(state, includeSuspend = false) {
|
|
37
|
-
const { transitions } = state;
|
|
38
|
-
if (!transitions?.length) {
|
|
39
|
-
return true;
|
|
40
|
-
}
|
|
41
|
-
for (const step of transitions) {
|
|
42
|
-
if (includeSuspend && step.type === 'suspend') {
|
|
43
|
-
return true;
|
|
44
|
-
}
|
|
45
|
-
if (step.destination === END_AGENT_EXECUTION) {
|
|
46
|
-
return true;
|
|
47
|
-
}
|
|
48
|
-
if (step.condition === undefined) {
|
|
49
|
-
return false;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
return true;
|
|
53
|
-
}
|
|
54
|
-
export function getAgentEndStates(agent, includeSuspend = false) {
|
|
55
|
-
const endStates = new Set();
|
|
56
|
-
for (const [stateId, state] of Object.entries(agent.states)) {
|
|
57
|
-
if (canEndOnState(state, includeSuspend)) {
|
|
58
|
-
endStates.add(stateId);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
return endStates;
|
|
62
|
-
}
|
|
63
|
-
// Agent Scoped Names
|
|
64
|
-
export const getCreateAgentSessionMutationName = (agentName) => {
|
|
65
|
-
return `create${upperFirst(agentName)}Session`;
|
|
66
|
-
};
|
|
67
|
-
export const getInspectAgentQueryName = (agentName) => {
|
|
68
|
-
return `inspect${upperFirst(agentName)}`;
|
|
69
|
-
};
|
|
70
|
-
export const getSendAgentFeedbackMutationName = (agentName) => {
|
|
71
|
-
return `send${upperFirst(agentName)}Feedback`;
|
|
72
|
-
};
|
|
73
|
-
export const getGetAgentMessageQueryName = (agentName) => {
|
|
74
|
-
return `get${upperFirst(agentName)}Message`;
|
|
75
|
-
};
|
|
76
|
-
export const getAbortAgentMessageMutationName = (agentName) => {
|
|
77
|
-
return `abort${upperFirst(agentName)}Message`;
|
|
78
|
-
};
|
|
79
|
-
// Agent Input Scopes Names
|
|
80
|
-
export const getSendAgentMessageMutationName = (inputName) => {
|
|
81
|
-
return `send${upperFirst(inputName)}Message`;
|
|
82
|
-
};
|
|
83
|
-
function createAssertValidName(key, result) {
|
|
84
|
-
const singular = key === 'shapes' ? 'shape' : key === 'mutations' ? 'mutation' : 'query';
|
|
85
|
-
return (name) => {
|
|
86
|
-
assert(result[key][name] === undefined, `Schema already has a ${singular} with the name "${name}"`);
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
export function getAgentFeatures(agents) {
|
|
90
|
-
const result = {
|
|
91
|
-
queries: {},
|
|
92
|
-
mutations: {},
|
|
93
|
-
shapes: {}
|
|
94
|
-
};
|
|
95
|
-
const assertValidShapeName = createAssertValidName('shapes', result);
|
|
96
|
-
const assertValidQueryName = createAssertValidName('queries', result);
|
|
97
|
-
const assertValidMutationName = createAssertValidName('mutations', result);
|
|
98
|
-
for (const [agentName, agent] of Object.entries(agents)) {
|
|
99
|
-
// Get valid return types based on states that could possibly be the end state
|
|
100
|
-
// TODO In the future the agent will have a return type defined and we will instead validate
|
|
101
|
-
// that all the return states will return the correct shape.
|
|
102
|
-
const returnStates = [...getAgentEndStates(agent, true)];
|
|
103
|
-
const returnTypes = uniq(returnStates.map((stateId) => {
|
|
104
|
-
const { execution } = agent.states[stateId];
|
|
105
|
-
if (execution.type === EXECUTION_TYPE_CHAT) {
|
|
106
|
-
return agentChatPayload.shapeName;
|
|
107
|
-
}
|
|
108
|
-
if (execution.type === EXECUTION_TYPE_GENERATE) {
|
|
109
|
-
return execution.outputShape ? execution.outputShape : 'string';
|
|
110
|
-
}
|
|
111
|
-
return JSON_SHAPE_NAME;
|
|
112
|
-
}));
|
|
113
|
-
const agentOutput = returnTypes.length === 0 ? 'string' : returnTypes.length === 1 ? returnTypes[0] : JSON_SHAPE_NAME;
|
|
114
|
-
const agentOutputSchema = agentOutput === 'string' ? { type: 'string' } : { '@ref': agentOutput };
|
|
115
|
-
const agentSessionShapeName = agentSessionPayload.shapeName;
|
|
116
|
-
const agentMessageShapeName = getAgentMessageResponse.createUserShapeName(agentName);
|
|
117
|
-
assertValidShapeName(agentMessageShapeName);
|
|
118
|
-
result.shapes[agentMessageShapeName] = {
|
|
119
|
-
id: agentMessageShapeName,
|
|
120
|
-
name: agentMessageShapeName,
|
|
121
|
-
title: agentMessageShapeName,
|
|
122
|
-
schema: getAgentMessageResponse.createUserShapeSchema({
|
|
123
|
-
properties: {
|
|
124
|
-
output: agentOutputSchema
|
|
125
|
-
}
|
|
126
|
-
})
|
|
127
|
-
};
|
|
128
|
-
const sendAgentMessageResponseShapeName = sendAgentMessageResponse.createUserShapeName(agentName);
|
|
129
|
-
assertValidShapeName(sendAgentMessageResponseShapeName);
|
|
130
|
-
result.shapes[sendAgentMessageResponseShapeName] = {
|
|
131
|
-
id: sendAgentMessageResponseShapeName,
|
|
132
|
-
name: sendAgentMessageResponseShapeName,
|
|
133
|
-
title: sendAgentMessageResponseShapeName,
|
|
134
|
-
schema: sendAgentMessageResponse.createUserShapeSchema({
|
|
135
|
-
properties: {
|
|
136
|
-
output: agentOutputSchema
|
|
137
|
-
}
|
|
138
|
-
})
|
|
139
|
-
};
|
|
140
|
-
const inspectAgentResponseShapeName = inspectAgentResponse.createUserShapeName(agentName);
|
|
141
|
-
assertValidShapeName(inspectAgentResponseShapeName);
|
|
142
|
-
result.shapes[inspectAgentResponseShapeName] = {
|
|
143
|
-
id: inspectAgentResponseShapeName,
|
|
144
|
-
name: inspectAgentResponseShapeName,
|
|
145
|
-
title: inspectAgentResponseShapeName,
|
|
146
|
-
schema: inspectAgentResponse.createUserShapeSchema()
|
|
147
|
-
};
|
|
148
|
-
const getAgentMessageQueryName = getGetAgentMessageQueryName(agentName);
|
|
149
|
-
assertValidQueryName(getAgentMessageQueryName);
|
|
150
|
-
result.queries[getAgentMessageQueryName] = {
|
|
151
|
-
description: `Get a message for the ${agentName} agent`,
|
|
152
|
-
shape: agentMessageShapeName,
|
|
153
|
-
resolver: {
|
|
154
|
-
name: 'ai:getAgentMessage',
|
|
155
|
-
agentName
|
|
156
|
-
},
|
|
157
|
-
args: {
|
|
158
|
-
...getAgentMessageArgs.schema
|
|
159
|
-
}
|
|
160
|
-
};
|
|
161
|
-
const abortAgentMessageMutationName = getAbortAgentMessageMutationName(agentName);
|
|
162
|
-
assertValidMutationName(abortAgentMessageMutationName);
|
|
163
|
-
result.mutations[abortAgentMessageMutationName] = {
|
|
164
|
-
description: `Abort a message for the ${agentName} agent`,
|
|
165
|
-
shape: abortAgentMessageResponse.shapeName,
|
|
166
|
-
resolver: {
|
|
167
|
-
name: 'ai:abortAgentMessage',
|
|
168
|
-
agentName
|
|
169
|
-
},
|
|
170
|
-
args: {
|
|
171
|
-
...getAgentMessageArgs.schema
|
|
172
|
-
}
|
|
173
|
-
};
|
|
174
|
-
const createAgentSessionMutationName = getCreateAgentSessionMutationName(agentName);
|
|
175
|
-
assertValidMutationName(createAgentSessionMutationName);
|
|
176
|
-
result.mutations[createAgentSessionMutationName] = {
|
|
177
|
-
description: `Create a session for the ${agentName} agent`,
|
|
178
|
-
shape: agentSessionShapeName,
|
|
179
|
-
resolver: {
|
|
180
|
-
name: 'ai:createAgentSession',
|
|
181
|
-
agentName
|
|
182
|
-
}
|
|
183
|
-
};
|
|
184
|
-
const inspectAgentQueryName = getInspectAgentQueryName(agentName);
|
|
185
|
-
assertValidQueryName(inspectAgentQueryName);
|
|
186
|
-
result.queries[inspectAgentQueryName] = {
|
|
187
|
-
description: `Inspect the ${agentName} agent`,
|
|
188
|
-
args: inspectAgentArgs.schema,
|
|
189
|
-
shape: inspectAgentResponseShapeName,
|
|
190
|
-
resolver: {
|
|
191
|
-
name: 'ai:inspectAgent',
|
|
192
|
-
agentName
|
|
193
|
-
}
|
|
194
|
-
};
|
|
195
|
-
result.mutations[getSendAgentFeedbackMutationName(agentName)] ||= {
|
|
196
|
-
description: `Send feedback for the ${agentName} agent`,
|
|
197
|
-
args: sendAgentFeedbackArgs.shapeName,
|
|
198
|
-
shape: 'boolean',
|
|
199
|
-
resolver: {
|
|
200
|
-
name: 'ai:sendAgentFeedback',
|
|
201
|
-
agentName
|
|
202
|
-
}
|
|
203
|
-
};
|
|
204
|
-
// This mutation can vary depending on the inputs defined, everything else is stable for the whole agent (for now)
|
|
205
|
-
for (const inputConfig of agent.api.inputs) {
|
|
206
|
-
if (inputConfig.type === 'mutation') {
|
|
207
|
-
const inputName = inputConfig.name;
|
|
208
|
-
const sendAgentMessageMutationName = getSendAgentMessageMutationName(inputName);
|
|
209
|
-
assertValidMutationName(sendAgentMessageMutationName);
|
|
210
|
-
result.mutations[sendAgentMessageMutationName] = {
|
|
211
|
-
description: agent.description,
|
|
212
|
-
args: {
|
|
213
|
-
type: 'object',
|
|
214
|
-
extends: [
|
|
215
|
-
{
|
|
216
|
-
...sendAgentMessageArgs.shapeSchema,
|
|
217
|
-
required: agent.protection?.enabled
|
|
218
|
-
? [...sendAgentMessageArgs.shapeSchema.required, 'token']
|
|
219
|
-
: sendAgentMessageArgs.shapeSchema.required
|
|
220
|
-
},
|
|
221
|
-
{
|
|
222
|
-
'@ref': inputConfig.args
|
|
223
|
-
}
|
|
224
|
-
]
|
|
225
|
-
},
|
|
226
|
-
shape: sendAgentMessageResponseShapeName,
|
|
227
|
-
resolver: {
|
|
228
|
-
name: 'ai:sendAgentMessage',
|
|
229
|
-
agentName,
|
|
230
|
-
inputName
|
|
231
|
-
}
|
|
232
|
-
};
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
return result;
|
|
237
|
-
}
|
|
238
|
-
export function isValidAgentMutation(projectSchema, name) {
|
|
239
|
-
for (const agent of Object.values(getAgentMap(projectSchema) ?? {})) {
|
|
240
|
-
for (const input of agent.api.inputs) {
|
|
241
|
-
if (input.type === 'mutation' && input.name === name) {
|
|
242
|
-
return true;
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
return false;
|
|
247
|
-
}
|
|
248
|
-
export function addAiQueries(projectSchema) {
|
|
249
|
-
const agents = getAgentMap(projectSchema);
|
|
250
|
-
if (!agents) {
|
|
251
|
-
return projectSchema;
|
|
252
|
-
}
|
|
253
|
-
const aiFeatures = getAgentFeatures(agents);
|
|
254
|
-
return {
|
|
255
|
-
...projectSchema,
|
|
256
|
-
queries: {
|
|
257
|
-
...projectSchema.queries,
|
|
258
|
-
...aiFeatures.queries
|
|
259
|
-
},
|
|
260
|
-
mutations: {
|
|
261
|
-
...projectSchema.mutations,
|
|
262
|
-
...aiFeatures.mutations
|
|
263
|
-
},
|
|
264
|
-
shapes: {
|
|
265
|
-
...projectSchema.shapes,
|
|
266
|
-
...aiFeatures.shapes
|
|
267
|
-
}
|
|
268
|
-
};
|
|
269
|
-
}
|
|
270
|
-
/**
|
|
271
|
-
* Where guards live in the schema.
|
|
272
|
-
*/
|
|
273
|
-
export const GUARDS_SCHEMA_PATH = ['guards'];
|
|
274
|
-
export const AGENTS_SCHEMA_PATH = ['agents'];
|
|
275
|
-
/**
|
|
276
|
-
* Check if a guard is enabled.
|
|
277
|
-
*/
|
|
278
|
-
export const isGuardEnabled = (guard) => {
|
|
279
|
-
return Boolean(guard && guard.enabled !== false);
|
|
280
|
-
};
|
|
281
|
-
export function getGuardMap(schema) {
|
|
282
|
-
return schema.guards;
|
|
283
|
-
}
|
|
284
|
-
export function getGuards(schema) {
|
|
285
|
-
const guards = getGuardMap(schema);
|
|
286
|
-
return guards ? Object.entries(guards).map(([id, guard]) => ({ id, ...guard })) : [];
|
|
287
|
-
}
|
|
288
|
-
export function setGuardMap(schema, guards) {
|
|
289
|
-
return set(GUARDS_SCHEMA_PATH, guards, schema);
|
|
290
|
-
}
|
|
291
|
-
export function setGuard(schema, id, guard) {
|
|
292
|
-
return set([...GUARDS_SCHEMA_PATH, id], guard, schema);
|
|
293
|
-
}
|
|
294
|
-
/**
|
|
295
|
-
* Get a guard configuration from the project schema.
|
|
296
|
-
*/
|
|
297
|
-
export function getGuardConfig(schema, guardId) {
|
|
298
|
-
return get(schema, [...GUARDS_SCHEMA_PATH, guardId]);
|
|
299
|
-
}
|
|
300
|
-
/**
|
|
301
|
-
* Get a guard configuration from the project schema, but only if it is enabled.
|
|
302
|
-
*/
|
|
303
|
-
export function getEnabledGuardConfig(schema, guardId) {
|
|
304
|
-
const config = getGuardConfig(schema, guardId);
|
|
305
|
-
if (config && isGuardEnabled(config)) {
|
|
306
|
-
return config;
|
|
307
|
-
}
|
|
308
|
-
}
|
|
309
|
-
export function getAgentMap(projectSchema) {
|
|
310
|
-
return projectSchema.agents;
|
|
311
|
-
}
|
|
312
|
-
export function getAgents(projectSchema) {
|
|
313
|
-
const agentMap = getAgentMap(projectSchema);
|
|
314
|
-
return agentMap && Object.entries(agentMap).map(([name, agent]) => ({ name, ...agent }));
|
|
315
|
-
}
|
|
316
|
-
export function setAgentMap(projectSchema, agents) {
|
|
317
|
-
return set(AGENTS_SCHEMA_PATH, agents, projectSchema);
|
|
318
|
-
}
|
|
319
|
-
export function setAgent(projectSchema, name, agent) {
|
|
320
|
-
return set([...AGENTS_SCHEMA_PATH, name], agent, projectSchema);
|
|
321
|
-
}
|
|
322
|
-
export function getAgent(projectSchema, name) {
|
|
323
|
-
return getAgentMap(projectSchema)?.[name];
|
|
324
|
-
}
|
|
325
|
-
export function ensureAgent(projectSchema, name) {
|
|
326
|
-
const agent = getAgent(projectSchema, name);
|
|
327
|
-
if (!agent) {
|
|
328
|
-
throw new Error(`Agent "${name}" not found`);
|
|
329
|
-
}
|
|
330
|
-
return agent;
|
|
331
|
-
}
|
|
332
|
-
export function isAgentQuery(query, agentName) {
|
|
333
|
-
const resolver = query.resolver;
|
|
334
|
-
if ('agentName' in resolver) {
|
|
335
|
-
return resolver.agentName === agentName;
|
|
336
|
-
}
|
|
337
|
-
return false;
|
|
338
|
-
}
|
package/dist/api-version.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type SemVer from 'semver/classes/semver.js';
|
|
2
|
-
export type VersionCompareFn = (apiVersion: string | SemVer, featureVersion: string | SemVer) => boolean;
|
|
3
|
-
export declare const createVersionPredicate: (featureVersion: string | SemVer, comparison: VersionCompareFn) => ((apiVersion: string | SemVer) => boolean);
|
|
4
|
-
export declare const workflowsEnabled: (apiVersion: string | SemVer) => boolean;
|
|
5
|
-
export declare const whereClauseEnabled: (apiVersion: string | SemVer) => boolean;
|
package/dist/api-version.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import coerce from 'semver/functions/coerce.js';
|
|
2
|
-
import gte from 'semver/functions/gte.js';
|
|
3
|
-
export const createVersionPredicate = (featureVersion, comparison) => {
|
|
4
|
-
const coercedFeatureVersion = coerce(featureVersion);
|
|
5
|
-
if (!coercedFeatureVersion) {
|
|
6
|
-
throw new Error(`Could not create predicate version "${featureVersion}" is not valid`);
|
|
7
|
-
}
|
|
8
|
-
return (apiVersion) => {
|
|
9
|
-
const coercedApiVersion = coerce(apiVersion);
|
|
10
|
-
if (!coercedApiVersion) {
|
|
11
|
-
throw new Error(`Version "${apiVersion}" is not valid and could not be coerced`);
|
|
12
|
-
}
|
|
13
|
-
return comparison(coercedApiVersion, coercedFeatureVersion);
|
|
14
|
-
};
|
|
15
|
-
};
|
|
16
|
-
export const workflowsEnabled = createVersionPredicate('2.0.0', gte);
|
|
17
|
-
export const whereClauseEnabled = createVersionPredicate('2.0.0', gte);
|
package/dist/auth-schemas.d.ts
DELETED
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file was automatically generated by json-schema-to-typescript.
|
|
3
|
-
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
|
|
4
|
-
* and run json-schema-to-typescript to regenerate this file.
|
|
5
|
-
*/
|
|
6
|
-
/**
|
|
7
|
-
* A role import document is an array of role
|
|
8
|
-
*
|
|
9
|
-
* This interface was referenced by `AuthSchemas`'s JSON-Schema
|
|
10
|
-
* via the `definition` "RoleImport".
|
|
11
|
-
*/
|
|
12
|
-
export type RoleImport = RoleInput[];
|
|
13
|
-
export interface AuthSchemas {
|
|
14
|
-
[k: string]: any;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* This interface was referenced by `AuthSchemas`'s JSON-Schema
|
|
18
|
-
* via the `definition` "Condition".
|
|
19
|
-
*/
|
|
20
|
-
export interface Condition {
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* This interface was referenced by `AuthSchemas`'s JSON-Schema
|
|
24
|
-
* via the `definition` "Statement".
|
|
25
|
-
*/
|
|
26
|
-
export interface Statement {
|
|
27
|
-
Effect?: 'Allow' | 'Deny';
|
|
28
|
-
Sid?: string;
|
|
29
|
-
Action?: string[];
|
|
30
|
-
NotAction?: string[];
|
|
31
|
-
Resource?: string[];
|
|
32
|
-
NotResource?: string[];
|
|
33
|
-
Principal?: {
|
|
34
|
-
AWS?: string[];
|
|
35
|
-
Service?: string[];
|
|
36
|
-
};
|
|
37
|
-
Condition?: Condition;
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* This interface was referenced by `AuthSchemas`'s JSON-Schema
|
|
41
|
-
* via the `definition` "AccessPolicyDocument".
|
|
42
|
-
*/
|
|
43
|
-
export interface AccessPolicyDocument {
|
|
44
|
-
Version: string;
|
|
45
|
-
Statement: Statement[];
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* This interface was referenced by `AuthSchemas`'s JSON-Schema
|
|
49
|
-
* via the `definition` "ApiKey".
|
|
50
|
-
*/
|
|
51
|
-
export interface ApiKey {
|
|
52
|
-
projectId: string;
|
|
53
|
-
name: string;
|
|
54
|
-
role?: string;
|
|
55
|
-
permissions?: AccessPolicyDocument;
|
|
56
|
-
lastUsed?: string;
|
|
57
|
-
apiKey?: string;
|
|
58
|
-
id: string;
|
|
59
|
-
delinquent?: boolean;
|
|
60
|
-
apiRateLimit?: number;
|
|
61
|
-
deactivated?: number;
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* This interface was referenced by `AuthSchemas`'s JSON-Schema
|
|
65
|
-
* via the `definition` "UserPermission".
|
|
66
|
-
*/
|
|
67
|
-
export interface UserPermission {
|
|
68
|
-
projectId: string;
|
|
69
|
-
userId: string;
|
|
70
|
-
role: string;
|
|
71
|
-
permissions?: AccessPolicyDocument;
|
|
72
|
-
created?: number;
|
|
73
|
-
updated?: number;
|
|
74
|
-
deactivated?: number;
|
|
75
|
-
delinquent?: boolean;
|
|
76
|
-
}
|
|
77
|
-
/**
|
|
78
|
-
* This interface was referenced by `AuthSchemas`'s JSON-Schema
|
|
79
|
-
* via the `definition` "Role".
|
|
80
|
-
*/
|
|
81
|
-
export interface Role {
|
|
82
|
-
projectId: string;
|
|
83
|
-
name: string;
|
|
84
|
-
conditions?: Condition;
|
|
85
|
-
permissions: AccessPolicyDocument;
|
|
86
|
-
builtIn?: boolean;
|
|
87
|
-
created?: number;
|
|
88
|
-
updated?: number;
|
|
89
|
-
}
|
|
90
|
-
/**
|
|
91
|
-
* Input type for role creation and updates.
|
|
92
|
-
*
|
|
93
|
-
* This interface was referenced by `AuthSchemas`'s JSON-Schema
|
|
94
|
-
* via the `definition` "RoleInput".
|
|
95
|
-
*/
|
|
96
|
-
export interface RoleInput {
|
|
97
|
-
projectId?: string;
|
|
98
|
-
name: string;
|
|
99
|
-
conditions?: Condition;
|
|
100
|
-
permissions: AccessPolicyDocument;
|
|
101
|
-
builtIn?: boolean;
|
|
102
|
-
created?: number;
|
|
103
|
-
updated?: number;
|
|
104
|
-
}
|
|
105
|
-
/**
|
|
106
|
-
* This interface was referenced by `AuthSchemas`'s JSON-Schema
|
|
107
|
-
* via the `definition` "User".
|
|
108
|
-
*/
|
|
109
|
-
export interface User {
|
|
110
|
-
id: string;
|
|
111
|
-
email: string;
|
|
112
|
-
fullName: string;
|
|
113
|
-
created: number;
|
|
114
|
-
updated: number;
|
|
115
|
-
requiresEmailValidation?: boolean;
|
|
116
|
-
emailValidationToken?: string;
|
|
117
|
-
inviteCode?: string;
|
|
118
|
-
firstTime: boolean;
|
|
119
|
-
avatarPath?: string;
|
|
120
|
-
intercomHash?: string;
|
|
121
|
-
googleUserId?: string;
|
|
122
|
-
comcastId?: string;
|
|
123
|
-
token?: string;
|
|
124
|
-
policies?: AccessPolicyDocument[];
|
|
125
|
-
preferences?: {
|
|
126
|
-
[k: string]: any;
|
|
127
|
-
};
|
|
128
|
-
}
|
package/dist/auth-schemas.js
DELETED
package/dist/auth-utils.d.ts
DELETED
package/dist/auth-utils.js
DELETED
package/dist/builtin-schema.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { Entitlements } from '@takeshape/util';
|
|
2
|
-
import type { FormMap, ShapeJSON, ShapeMap } from './project-schema/index.ts';
|
|
3
|
-
import type { Content } from './types/index.ts';
|
|
4
|
-
export type SchemaDefaultsOptions = {
|
|
5
|
-
entitlements: Pick<Entitlements, 'staticSites'>;
|
|
6
|
-
};
|
|
7
|
-
export declare function isAsset(content: Content): boolean;
|
|
8
|
-
export declare function getAssetS3Path(content: Content): string | undefined;
|
|
9
|
-
export declare function setAssetS3Path(content: Content, path: string): void;
|
|
10
|
-
export declare const jsonShape: ShapeJSON;
|
|
11
|
-
export declare function getBuiltInShapes(options: SchemaDefaultsOptions): ShapeMap;
|
|
12
|
-
export declare function getBuiltInForms(options: SchemaDefaultsOptions): FormMap;
|
|
13
|
-
export declare const allBuiltInShapes: {
|
|
14
|
-
[x: string]: ShapeJSON;
|
|
15
|
-
};
|
|
16
|
-
export declare const allBuiltInForms: {
|
|
17
|
-
[x: string]: import("./project-schema/latest.ts").FormsConfig;
|
|
18
|
-
};
|