@mastra/connect 0.7.0-alpha.1 → 1.0.0-alpha.4

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 (83) hide show
  1. package/README.md +47 -42
  2. package/dist/channels.d.ts +40 -22
  3. package/dist/channels.d.ts.map +1 -1
  4. package/dist/client.d.ts +21 -0
  5. package/dist/client.d.ts.map +1 -1
  6. package/dist/errors.d.ts +23 -0
  7. package/dist/errors.d.ts.map +1 -1
  8. package/dist/index.cjs +821 -465
  9. package/dist/index.cjs.map +1 -1
  10. package/dist/index.d.ts +4 -10
  11. package/dist/index.d.ts.map +1 -1
  12. package/dist/index.js +822 -458
  13. package/dist/index.js.map +1 -1
  14. package/dist/instrumentation.d.ts +48 -0
  15. package/dist/instrumentation.d.ts.map +1 -0
  16. package/dist/multi-connection.d.ts +1 -1
  17. package/dist/multi-connection.d.ts.map +1 -1
  18. package/dist/providers/channels.d.ts +5 -1
  19. package/dist/providers/channels.d.ts.map +1 -1
  20. package/dist/providers/clerk/tools/create-organization-domain.d.ts +9 -9
  21. package/dist/providers/clerk/tools/create-organization-domain.d.ts.map +1 -1
  22. package/dist/providers/clerk/tools/create-organization-invitation.d.ts +3 -3
  23. package/dist/providers/clerk/tools/create-user.d.ts.map +1 -1
  24. package/dist/providers/clerk/tools/delete-email-address.d.ts.map +1 -1
  25. package/dist/providers/clerk/tools/delete-organization-domain.d.ts.map +1 -1
  26. package/dist/providers/clerk/tools/delete-organization-membership.d.ts.map +1 -1
  27. package/dist/providers/clerk/tools/delete-organization-role.d.ts.map +1 -1
  28. package/dist/providers/clerk/tools/delete-phone-number.d.ts.map +1 -1
  29. package/dist/providers/clerk/tools/get-email-address.d.ts.map +1 -1
  30. package/dist/providers/clerk/tools/get-organization-invitation.d.ts +3 -3
  31. package/dist/providers/clerk/tools/get-organization-role.d.ts.map +1 -1
  32. package/dist/providers/clerk/tools/get-phone-number.d.ts.map +1 -1
  33. package/dist/providers/clerk/tools/get-session.d.ts +3 -3
  34. package/dist/providers/clerk/tools/get-session.d.ts.map +1 -1
  35. package/dist/providers/clerk/tools/list-organization-domains.d.ts +9 -9
  36. package/dist/providers/clerk/tools/list-organization-domains.d.ts.map +1 -1
  37. package/dist/providers/clerk/tools/list-organization-invitations.d.ts +3 -3
  38. package/dist/providers/clerk/tools/list-organization-invitations.d.ts.map +1 -1
  39. package/dist/providers/clerk/tools/list-organization-memberships.d.ts.map +1 -1
  40. package/dist/providers/clerk/tools/list-organization-roles.d.ts.map +1 -1
  41. package/dist/providers/clerk/tools/list-organizations.d.ts.map +1 -1
  42. package/dist/providers/clerk/tools/list-sessions.d.ts +3 -5
  43. package/dist/providers/clerk/tools/list-sessions.d.ts.map +1 -1
  44. package/dist/providers/clerk/tools/list-users.d.ts +12 -0
  45. package/dist/providers/clerk/tools/list-users.d.ts.map +1 -1
  46. package/dist/providers/clerk/tools/revoke-organization-invitation.d.ts +3 -3
  47. package/dist/providers/clerk/tools/revoke-session.d.ts +3 -3
  48. package/dist/providers/clerk/tools/revoke-session.d.ts.map +1 -1
  49. package/dist/providers/clerk/tools/update-organization-domain.d.ts +9 -9
  50. package/dist/providers/clerk/tools/update-organization-domain.d.ts.map +1 -1
  51. package/dist/providers/clerk/tools/update-organization-role.d.ts.map +1 -1
  52. package/dist/providers/clerk/tools/update-organization.d.ts +2 -0
  53. package/dist/providers/clerk/tools/update-organization.d.ts.map +1 -1
  54. package/dist/providers/clerk/tools/update-user.d.ts +10 -10
  55. package/dist/providers/clerk/tools/verify-organization-domain.d.ts +12 -7
  56. package/dist/providers/clerk/tools/verify-organization-domain.d.ts.map +1 -1
  57. package/dist/providers/discord/tools/list-channels.d.ts +2 -2
  58. package/dist/providers/discord/tools/list-channels.d.ts.map +1 -1
  59. package/dist/providers/jira/tools/get-create-issue-metadata.d.ts +42 -0
  60. package/dist/providers/jira/tools/get-create-issue-metadata.d.ts.map +1 -1
  61. package/dist/providers/jira/tools/list-issue-types.d.ts +6 -2
  62. package/dist/providers/jira/tools/list-issue-types.d.ts.map +1 -1
  63. package/dist/providers/resend/tools/cancel-email.d.ts +2 -2
  64. package/dist/providers/resend/tools/get-email.d.ts +2 -2
  65. package/dist/providers/resend/tools/get-received-email.d.ts +2 -2
  66. package/dist/providers/resend/tools/get-template.d.ts +2 -2
  67. package/dist/providers/resend/tools/list-emails.d.ts +2 -2
  68. package/dist/providers/resend/tools/list-received-emails.d.ts +2 -2
  69. package/dist/providers/resend/tools/update-contact-topics.d.ts.map +1 -1
  70. package/dist/registry.d.ts +1 -8
  71. package/dist/registry.d.ts.map +1 -1
  72. package/dist/resolution.d.ts +3 -11
  73. package/dist/resolution.d.ts.map +1 -1
  74. package/dist/runtime/platform-proxy.d.ts.map +1 -1
  75. package/dist/tools.d.ts +94 -33
  76. package/dist/tools.d.ts.map +1 -1
  77. package/dist/toolset.d.ts +39 -13
  78. package/dist/toolset.d.ts.map +1 -1
  79. package/package.json +12 -8
  80. package/dist/connect.d.ts +0 -22
  81. package/dist/connect.d.ts.map +0 -1
  82. package/dist/environment.d.ts +0 -48
  83. package/dist/environment.d.ts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,oBAAoB,EAA8D,MAAM,aAAa,CAAC;AAcpH,UAAU,2BAA2B;IACnC,wGAAwG;IACxG,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC5B,mEAAmE;IACnE,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;;;GAKG;AACH,MAAM,MAAM,uBAAuB,GAAG,2BAA2B,GAC/D,CACI;IACE,2FAA2F;IAC3F,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,aAAa,CAAC,EAAE,KAAK,CAAC;CACvB,GACD;IACE,UAAU,CAAC,EAAE,KAAK,CAAC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E,EAAE,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC,CAAC,CAAC;AAE/G;;;;;;GAMG;AACH,MAAM,WAAW,aAAa;IAC5B,CAAC,GAAG,CAAC,EAAE,oBAAoB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAC3D,sGAAsG;IACtG,OAAO,IAAI,OAAO,CAAC,mBAAmB,CAAC,CAAC;IACxC,mFAAmF;IACnF,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5B;;;;;;;OAOG;IACH,IAAI,CAAC,KAAK,EAAE,cAAc,GAAG,aAAa,CAAC;CAC5C;AAYD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,KAAK,CAAC,OAAO,GAAE,YAAiB,GAAG,aAAa,CA4J/D"}
package/dist/toolset.d.ts CHANGED
@@ -3,9 +3,9 @@ import type { z } from 'zod';
3
3
  import type { ConnectClientOptions, ProxyRequestOptions } from './client.js';
4
4
  interface ProviderToolsOptionsBase {
5
5
  /**
6
- * Connection to use. `connect()` always supplies one (resolving the
7
- * registration's env var itself); direct `create<Provider>Tools` callers
8
- * must pass it or tool calls fail with `missing_connection_id`.
6
+ * Connection to use. `tools()` always supplies one; direct
7
+ * `create<Provider>Tools` callers must pass it or tool calls fail with
8
+ * `missing_connection_id`.
9
9
  */
10
10
  connectionId?: string;
11
11
  client?: ConnectClientOptions;
@@ -17,15 +17,23 @@ interface ProviderToolsOptionsBase {
17
17
  * callers still get a clear error instead of silent surprising behavior.
18
18
  */
19
19
  export type ProviderToolsOptions = ProviderToolsOptionsBase & ({
20
- /** Restrict the returned toolset to these tool keys. Unknown names throw immediately. */
20
+ /**
21
+ * Restrict the returned toolset to these tool keys. Entries containing
22
+ * `*` are globs (e.g. `'linear_get_*'`). Unknown names and globs that
23
+ * match nothing throw immediately.
24
+ */
21
25
  allowTools?: string[];
22
26
  disallowTools?: never;
23
27
  } | {
24
28
  allowTools?: never;
25
- /** Remove these tool keys from the returned toolset. Unknown names throw immediately. */
29
+ /**
30
+ * Remove these tool keys from the returned toolset. Entries containing
31
+ * `*` are globs (e.g. `'linear_delete_*'`). Unknown names and globs
32
+ * that match nothing throw immediately.
33
+ */
26
34
  disallowTools?: string[];
27
35
  });
28
- /** Resolves a connection id lazily at execute time: option → env var → typed error naming the env var. */
36
+ /** Resolves a connection id lazily at execute time: explicit option first, then a legacy env fallback. */
29
37
  export declare function resolveConnectionId(envVar: string, connectionId?: string): string;
30
38
  export interface ProxyToolConfig<TIn, TOut> {
31
39
  id: string;
@@ -48,16 +56,34 @@ export interface ProxyToolContext {
48
56
  */
49
57
  export declare function defineProxyTool<TIn, TOut>(context: ProxyToolContext, config: ProxyToolConfig<TIn, TOut>): import("@mastra/core/tools").Tool<TIn, TOut, unknown, unknown, import("@mastra/core/tools").ToolExecutionContext<unknown, unknown, unknown>, string, unknown>;
50
58
  /**
51
- * Filters a toolset by tool key. Throws at build time on unknown names so
52
- * typos in access-limiting config surface immediately.
59
+ * Returns a predicate testing tool keys against filter `entries`, where an
60
+ * entry containing `*` is a glob and anything else matches literally. Used
61
+ * where keys are only known later (MCP approval predicates); list-shaped
62
+ * call sites expand eagerly with {@link expandToolPatterns} instead.
63
+ */
64
+ export declare function compileToolMatcher(entries: string[]): (toolKey: string) => boolean;
65
+ /**
66
+ * Expands `*` glob entries against the known tool keys, preserving order and
67
+ * de-duplicating. Literal entries pass through untouched (callers validate
68
+ * those against their own key sets). A glob that matches nothing throws:
69
+ * like an unknown literal name, a dead pattern in access-limiting config is
70
+ * a typo that must surface instead of silently filtering nothing.
71
+ */
72
+ export declare function expandToolPatterns(entries: string[], knownKeys: string[], label: string): string[];
73
+ /**
74
+ * Filters a toolset by tool key. Entries containing `*` are globs expanded
75
+ * against the toolset's keys. Throws at build time on unknown names and on
76
+ * globs that match nothing, so typos in access-limiting config surface
77
+ * immediately.
53
78
  */
54
- export declare function applyAllowTools<T extends ToolsInput>(tools: T, allowTools?: string[]): ToolsInput;
79
+ export declare function applyAllowTools<T extends ToolsInput>(tools: T, allowToolsInput?: string[]): ToolsInput;
55
80
  /**
56
- * Removes tool keys from a toolset. Throws at build time on unknown names so
57
- * typos in access-limiting config surface immediately instead of silently
58
- * removing nothing.
81
+ * Removes tool keys from a toolset. Entries containing `*` are globs
82
+ * expanded against the toolset's keys. Throws at build time on unknown names
83
+ * and on globs that match nothing, so typos in access-limiting config
84
+ * surface immediately instead of silently removing nothing.
59
85
  */
60
- export declare function applyDisallowTools<T extends ToolsInput>(tools: T, disallowTools?: string[]): ToolsInput;
86
+ export declare function applyDisallowTools<T extends ToolsInput>(tools: T, disallowToolsInput?: string[]): ToolsInput;
61
87
  /**
62
88
  * Applies whichever of `allowTools` or `disallowTools` was configured on a
63
89
  * provider. Rejects at build time when both are set so a caller who bypasses
@@ -1 +1 @@
1
- {"version":3,"file":"toolset.d.ts","sourceRoot":"","sources":["../src/toolset.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAE7B,OAAO,KAAK,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAI7E,UAAU,wBAAwB;IAChC;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,oBAAoB,CAAC;CAC/B;AAED;;;;;GAKG;AACH,MAAM,MAAM,oBAAoB,GAAG,wBAAwB,GACzD,CACI;IACE,yFAAyF;IACzF,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,aAAa,CAAC,EAAE,KAAK,CAAC;CACvB,GACD;IACE,UAAU,CAAC,EAAE,KAAK,CAAC;IACnB,yFAAyF;IACzF,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;CAC1B,CACJ,CAAC;AAEJ,0GAA0G;AAC1G,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,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,wBAAgB,eAAe,CAAC,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,EAAE,eAAe,CAAC,GAAG,EAAE,IAAI,CAAC,iKAavG;AAcD;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAQlF;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAuBlG;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,CAAC,SAAS,UAAU,EAAE,KAAK,EAAE,CAAC,EAAE,eAAe,CAAC,EAAE,MAAM,EAAE,GAAG,UAAU,CAatG;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,SAAS,UAAU,EAAE,KAAK,EAAE,CAAC,EAAE,kBAAkB,CAAC,EAAE,MAAM,EAAE,GAAG,UAAU,CAe5G;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,CAAC,SAAS,UAAU,EAClD,KAAK,EAAE,CAAC,EACR,MAAM,EAAE;IAAE,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IAAC,aAAa,CAAC,EAAE,MAAM,EAAE,CAAA;CAAE,GAC1D,UAAU,CAYZ"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/connect",
3
- "version": "0.7.0-alpha.1",
3
+ "version": "1.0.0-alpha.4",
4
4
  "description": "Use Mastra platform integration connections as agent toolsets",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -44,10 +44,11 @@
44
44
  "node": ">=22.13.0"
45
45
  },
46
46
  "peerDependencies": {
47
- "@mastra/core": ">=1.72.0-0 <2.0.0-0",
47
+ "@mastra/core": ">=1.75.0-0 <2.0.0-0",
48
48
  "zod": ">=3.0.0 || >=4.0.0"
49
49
  },
50
50
  "devDependencies": {
51
+ "hono": "^4.13.7",
51
52
  "prettier": "3.9.5",
52
53
  "ts-morph": "^27.0.2",
53
54
  "tsdown": "0.22.9",
@@ -55,15 +56,16 @@
55
56
  "typescript": "^7.0.2",
56
57
  "vitest": "4.1.11",
57
58
  "zod": "^4.6.4",
58
- "@internal/lint": "0.0.140",
59
59
  "@internal/types-builder": "0.0.115",
60
- "@mastra/core": "1.75.0-alpha.2"
60
+ "@mastra/core": "1.75.0-alpha.8",
61
+ "@internal/lint": "0.0.140"
61
62
  },
62
63
  "dependencies": {
63
- "@mastra/mcp": "^2.2.0-alpha.0",
64
- "@mastra/telegram": "^0.2.1",
65
- "@mastra/slack": "^1.7.1",
66
- "@mastra/discord": "^1.2.1"
64
+ "@mastra/discord": "^1.3.0-alpha.1",
65
+ "@mastra/slack": "^1.7.2-alpha.1",
66
+ "@mastra/teams": "^0.1.1-alpha.0",
67
+ "@mastra/telegram": "^0.2.2-alpha.1",
68
+ "@mastra/mcp": "^2.2.0-alpha.2"
67
69
  },
68
70
  "scripts": {
69
71
  "add-provider": "tsx scripts/add-provider.ts",
@@ -74,6 +76,8 @@
74
76
  "lint:fix": "oxlint --fix . && eslint --fix .",
75
77
  "list-providers": "tsx scripts/list-providers.ts",
76
78
  "remove-provider": "tsx scripts/remove-provider.ts",
79
+ "smoke-test": "tsx scripts/smoke-test/index.ts",
80
+ "smoke-test:channels": "tsx scripts/smoke-test/channels/index.ts",
77
81
  "sync-templates": "tsx scripts/sync-templates.ts",
78
82
  "test": "vitest run && tsc --noEmit"
79
83
  }
package/dist/connect.d.ts DELETED
@@ -1,22 +0,0 @@
1
- import type { ToolsIntegrationOptions, ToolsOptions, ToolsResolver } from './tools.js';
2
- /**
3
- * @deprecated Renamed to {@link ToolsIntegrationOptions}.
4
- */
5
- export type ConnectIntegrationOptions = ToolsIntegrationOptions;
6
- /**
7
- * @deprecated Renamed to {@link ToolsOptions}.
8
- */
9
- export type ConnectOptions = ToolsOptions;
10
- /**
11
- * @deprecated Renamed to {@link ToolsResolver}.
12
- */
13
- export type ConnectTools = ToolsResolver;
14
- /**
15
- * @deprecated Renamed to {@link tools}.
16
- *
17
- * `connect(options)` is a drop-in alias for `tools(options)`. Prefer `tools`
18
- * from `@mastra/connect` in new code; this export will be removed in the next
19
- * minor version.
20
- */
21
- export declare function connect(options?: ConnectOptions): ConnectTools;
22
- //# sourceMappingURL=connect.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"connect.d.ts","sourceRoot":"","sources":["../src/connect.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,uBAAuB,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEvF;;GAEG;AACH,MAAM,MAAM,yBAAyB,GAAG,uBAAuB,CAAC;AAEhE;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,YAAY,CAAC;AAE1C;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,aAAa,CAAC;AAEzC;;;;;;GAMG;AACH,wBAAgB,OAAO,CAAC,OAAO,GAAE,cAAmB,GAAG,YAAY,CAElE"}
@@ -1,48 +0,0 @@
1
- import type { SandboxStartHook } from '@mastra/core/workspace';
2
- import type { ConnectClientOptions } from './client.js';
3
- export interface EnvironmentIntegrationOptions {
4
- /** Pin a specific connection id (bypasses env-var fallback and single-active-connection resolution). */
5
- connectionId?: string;
6
- /** Exclude this provider entirely, even if a connection exists. */
7
- disabled?: boolean;
8
- }
9
- export interface EnvironmentOptions {
10
- /** Platform project whose connections to discover. Falls back to MASTRA_PROJECT_ID. */
11
- projectId?: string;
12
- /** Optional per-provider overrides keyed by integrationId. */
13
- integrations?: Record<string, EnvironmentIntegrationOptions>;
14
- client?: ConnectClientOptions;
15
- }
16
- /**
17
- * Sandbox credentials materialized from the project's Platform connections.
18
- * Pass `env` into the sandbox's environment and `onStart` as (or inside) its
19
- * start hook so CLI tooling in the sandbox is authenticated out of the box.
20
- */
21
- export interface ConnectEnvironment {
22
- /** Environment variables to inject into the sandbox (e.g. GH_TOKEN). Never log these. */
23
- env: Record<string, string | undefined>;
24
- /** Runs provider setup inside the sandbox (e.g. git credential wiring). Safe no-op when nothing to do. */
25
- onStart: SandboxStartHook;
26
- }
27
- /**
28
- * Resolves the project's Platform connections into sandbox credentials:
29
- * environment variables plus a start hook that finishes in-sandbox setup.
30
- * Currently GitHub-aware (`GH_TOKEN`/`GITHUB_TOKEN` + git credential helper);
31
- * more providers plug in over time.
32
- *
33
- * Connection resolution matches `connect()`: a per-integration `connectionId`
34
- * or the provider's `MASTRA_*_CONNECTION_ID` env var wins, else a single
35
- * active connection; ambiguity, needs_reauth, and credential-fetch failures
36
- * warn and skip that provider. Configuration errors (missing project id,
37
- * malformed integration id) throw here so they surface at startup.
38
- *
39
- * The returned `env` is a snapshot: call `environment()` again for a fresh
40
- * token when starting new sandboxes.
41
- *
42
- * @example
43
- * const { env, onStart } = await environment({ projectId });
44
- * const sandbox = new E2BSandbox({ env, onStart });
45
- * // in the sandbox: `gh pr list`, `git clone https://github.com/org/repo` just work
46
- */
47
- export declare function environment(options?: EnvironmentOptions): Promise<ConnectEnvironment>;
48
- //# sourceMappingURL=environment.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"environment.d.ts","sourceRoot":"","sources":["../src/environment.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE/D,OAAO,KAAK,EAAE,oBAAoB,EAAwB,MAAM,aAAa,CAAC;AAK9E,MAAM,WAAW,6BAA6B;IAC5C,wGAAwG;IACxG,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,mEAAmE;IACnE,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,kBAAkB;IACjC,uFAAuF;IACvF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,8DAA8D;IAC9D,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,6BAA6B,CAAC,CAAC;IAC7D,MAAM,CAAC,EAAE,oBAAoB,CAAC;CAC/B;AAED;;;;GAIG;AACH,MAAM,WAAW,kBAAkB;IACjC,yFAAyF;IACzF,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;IACxC,0GAA0G;IAC1G,OAAO,EAAE,gBAAgB,CAAC;CAC3B;AAuDD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAsB,WAAW,CAAC,OAAO,GAAE,kBAAuB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAuD/F"}