skedyul 0.3.14 → 0.3.16

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/dist/.build-stamp CHANGED
@@ -1 +1 @@
1
- 1771711388656
1
+ 1771814239439
@@ -220,9 +220,9 @@ async function validateCommand(args) {
220
220
  console.log('');
221
221
  }
222
222
  if (provision?.models && provision.models.length > 0) {
223
- console.log('Models:');
223
+ console.log('Models (INTERNAL):');
224
224
  for (const model of provision.models) {
225
- console.log(` ${model.handle}: ${model.name} (${model.scope})`);
225
+ console.log(` ${model.handle}: ${model.name}`);
226
226
  }
227
227
  console.log('');
228
228
  }
@@ -1,3 +1,4 @@
1
+ import type { ModelDefinition, RelationshipDefinition } from '../../config/types';
1
2
  export interface SkedyulAppConfig {
2
3
  name: string;
3
4
  handle: string;
@@ -22,6 +23,10 @@ export interface InstallEnvField {
22
23
  }
23
24
  export interface InstallConfigData {
24
25
  env?: Record<string, InstallEnvField>;
26
+ /** SHARED model definitions (mapped to user's existing data during installation) */
27
+ models?: ModelDefinition[];
28
+ /** Relationship definitions between SHARED models */
29
+ relationships?: RelationshipDefinition[];
25
30
  }
26
31
  export declare function loadInstallConfig(projectDir?: string, debug?: boolean): Promise<InstallConfigData | null>;
27
32
  /**
@@ -245,6 +245,8 @@ async function loadInstallConfig(projectDir, debug = false) {
245
245
  /**
246
246
  * Parse install config from TypeScript source when dynamic import fails.
247
247
  * This is a fallback that extracts env vars using regex.
248
+ * Note: This fallback only parses env vars, not models. For full model support,
249
+ * the compiled dist file should be used.
248
250
  */
249
251
  function parseInstallConfigFromSource(content) {
250
252
  try {
@@ -252,6 +254,12 @@ function parseInstallConfigFromSource(content) {
252
254
  // Match env block: env: { ... } - need to handle nested braces
253
255
  const envStartMatch = content.match(/\benv\s*:\s*\{/);
254
256
  if (!envStartMatch || envStartMatch.index === undefined) {
257
+ // No env block found - check if there's a models block
258
+ const hasModels = content.match(/\bmodels\s*:\s*\[/);
259
+ if (hasModels) {
260
+ // Return empty config to indicate file exists but needs proper loading
261
+ return { env: {} };
262
+ }
255
263
  return null;
256
264
  }
257
265
  // Find the matching closing brace
@@ -307,9 +315,6 @@ function parseInstallConfigFromSource(content) {
307
315
  field.description = descMatch[1];
308
316
  envVars[varName] = field;
309
317
  }
310
- if (Object.keys(envVars).length === 0) {
311
- return null;
312
- }
313
318
  return { env: envVars };
314
319
  }
315
320
  catch {
@@ -2,19 +2,23 @@ import type { ToolRegistry, WebhookRegistry, ToolMetadata, WebhookMetadata } fro
2
2
  import type { EnvSchema, ComputeLayerType, ModelDefinition, RelationshipDefinition, ChannelDefinition, WorkflowDefinition, PageDefinition, NavigationConfig, AgentDefinition } from './types';
3
3
  export type { InstallHandlerContext, InstallHandlerResult, InstallHandler, InstallHandlerResponseOAuth, InstallHandlerResponseStandard, HasOAuthCallback, ServerHooksWithOAuth, ServerHooksWithoutOAuth, ProvisionHandlerContext, ProvisionHandlerResult, ProvisionHandler, ServerHooks, } from '../types';
4
4
  /**
5
- * Install configuration - defines per-install env vars.
5
+ * Install configuration - defines per-install env vars and SHARED models.
6
6
  */
7
7
  export interface InstallConfig {
8
8
  /** Per-install environment variables (collected from user during install, passed at runtime) */
9
9
  env?: EnvSchema;
10
+ /** SHARED model definitions (mapped to user's existing data during installation) */
11
+ models?: ModelDefinition[];
12
+ /** Relationship definitions between SHARED models */
13
+ relationships?: RelationshipDefinition[];
10
14
  }
11
15
  /** Provision-level configuration - auto-synced when app version is deployed */
12
16
  export interface ProvisionConfig {
13
17
  /** Global environment variables (developer-level, shared across all installs) */
14
18
  env?: EnvSchema;
15
- /** Model definitions (INTERNAL + SHARED) */
19
+ /** INTERNAL model definitions (app-owned, not visible to users) */
16
20
  models?: ModelDefinition[];
17
- /** Relationship definitions between models */
21
+ /** Relationship definitions between INTERNAL models */
18
22
  relationships?: RelationshipDefinition[];
19
23
  /** Communication channel definitions */
20
24
  channels?: ChannelDefinition[];
@@ -1,4 +1,4 @@
1
- import type { ResourceScope, FieldOwner, ResourceDependency } from './resource';
1
+ import type { FieldOwner, ResourceDependency } from './resource';
2
2
  export type InternalFieldDataType = 'LONG_STRING' | 'STRING' | 'NUMBER' | 'BOOLEAN' | 'DATE' | 'DATE_TIME' | 'TIME' | 'FILE' | 'IMAGE' | 'RELATION' | 'OBJECT';
3
3
  export interface FieldOption {
4
4
  label: string;
@@ -41,7 +41,6 @@ export interface ModelDefinition {
41
41
  handle: string;
42
42
  name: string;
43
43
  namePlural?: string;
44
- scope: ResourceScope;
45
44
  labelTemplate?: string;
46
45
  description?: string;
47
46
  fields: ModelFieldDefinition[];
@@ -1,5 +1,3 @@
1
- /** Scope of a model: INTERNAL (app-owned) or SHARED (user-mapped) */
2
- export type ResourceScope = 'INTERNAL' | 'SHARED';
3
1
  /**
4
2
  * Field-level data ownership.
5
3
  * APP: App exclusively controls this data (e.g., status field set by webhook)
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  // ─────────────────────────────────────────────────────────────────────────────
3
- // Resource Scope and Dependencies
3
+ // Resource Dependencies
4
4
  // ─────────────────────────────────────────────────────────────────────────────
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,3 +1,4 @@
1
+ import { z } from 'zod/v4';
1
2
  import type { CommunicationChannel, Workplace } from './types';
2
3
  /**
3
4
  * Error object in normalized API responses.
@@ -679,4 +680,143 @@ export declare const contactAssociationLink: {
679
680
  success: boolean;
680
681
  }>;
681
682
  };
683
+ /**
684
+ * Text content part for multimodal messages.
685
+ */
686
+ export interface AITextContent {
687
+ type: 'text';
688
+ text: string;
689
+ }
690
+ /**
691
+ * File content part for multimodal messages.
692
+ * References a file uploaded via file.upload().
693
+ */
694
+ export interface AIFileContent {
695
+ type: 'file';
696
+ fileId: string;
697
+ }
698
+ /**
699
+ * Image content part for multimodal messages.
700
+ * Accepts base64 data URI (e.g., "data:image/png;base64,...").
701
+ */
702
+ export interface AIImageContent {
703
+ type: 'image';
704
+ image: string;
705
+ }
706
+ /**
707
+ * Content types for multimodal AI messages.
708
+ */
709
+ export type AIMessageContent = AITextContent | AIFileContent | AIImageContent;
710
+ /**
711
+ * Message in a multi-turn AI conversation.
712
+ */
713
+ export interface AIMessage {
714
+ role: 'user' | 'assistant';
715
+ content: string | AIMessageContent[];
716
+ }
717
+ /**
718
+ * Options for ai.generateObject().
719
+ */
720
+ export interface GenerateObjectOptions<S extends z.ZodTypeAny> {
721
+ /**
722
+ * Model ID in gateway format (e.g., "openai/gpt-4o-mini").
723
+ * Defaults to system default model if not specified.
724
+ */
725
+ model?: string;
726
+ /**
727
+ * System prompt that sets the context for the AI.
728
+ */
729
+ system: string;
730
+ /**
731
+ * User prompt for simple text mode.
732
+ * Use this for single-turn requests without files.
733
+ */
734
+ prompt?: string;
735
+ /**
736
+ * Zod schema defining the expected output structure.
737
+ * The AI will generate an object conforming to this schema.
738
+ */
739
+ schema: S;
740
+ /**
741
+ * File IDs to include with the prompt.
742
+ * A simpler alternative to using `messages` when you just need to attach files.
743
+ * Files are resolved and sent as multimodal content alongside the prompt.
744
+ */
745
+ files?: string[];
746
+ /**
747
+ * Messages for multi-turn or multimodal conversations.
748
+ * Use this instead of `prompt` when you need more control over the conversation.
749
+ */
750
+ messages?: AIMessage[];
751
+ /**
752
+ * Maximum number of tokens to generate.
753
+ */
754
+ maxTokens?: number;
755
+ /**
756
+ * Temperature for response randomness (0-1).
757
+ * Lower values are more deterministic.
758
+ */
759
+ temperature?: number;
760
+ }
761
+ /**
762
+ * Result from ai.generateObject().
763
+ */
764
+ export interface GenerateObjectResult<T> {
765
+ /** The generated object conforming to the schema */
766
+ object: T;
767
+ /** Token usage information */
768
+ usage?: {
769
+ promptTokens: number;
770
+ completionTokens: number;
771
+ totalTokens: number;
772
+ };
773
+ }
774
+ export declare const ai: {
775
+ /**
776
+ * Generate a structured object using AI.
777
+ *
778
+ * The AI will generate an object that conforms to the provided Zod schema.
779
+ * Supports both simple text prompts and multimodal messages with files/images.
780
+ *
781
+ * @example
782
+ * ```ts
783
+ * // Simple text prompt
784
+ * const result = await ai.generateObject({
785
+ * system: 'Extract patient information from the text.',
786
+ * prompt: 'Patient: Max, Species: Canine, DOB: 2020-01-15',
787
+ * schema: z.object({
788
+ * patientName: z.string(),
789
+ * species: z.string(),
790
+ * dateOfBirth: z.string().nullable(),
791
+ * }),
792
+ * })
793
+ *
794
+ * // With files array (simple multimodal)
795
+ * const result = await ai.generateObject({
796
+ * model: 'openai/gpt-4o',
797
+ * system: 'Parse the lab report and extract test results.',
798
+ * prompt: 'Extract all test results from this report.',
799
+ * files: ['fl_abc123'],
800
+ * schema: TestResultsSchema,
801
+ * })
802
+ *
803
+ * // With messages (advanced multimodal)
804
+ * const result = await ai.generateObject({
805
+ * model: 'openai/gpt-4o',
806
+ * system: 'Parse the lab report and extract test results.',
807
+ * schema: TestResultsSchema,
808
+ * messages: [
809
+ * {
810
+ * role: 'user',
811
+ * content: [
812
+ * { type: 'text', text: 'Extract all test results from this report.' },
813
+ * { type: 'file', fileId: 'fl_abc123' },
814
+ * ],
815
+ * },
816
+ * ],
817
+ * })
818
+ * ```
819
+ */
820
+ generateObject<S extends z.ZodTypeAny>(options: GenerateObjectOptions<S>): Promise<z.infer<S>>;
821
+ };
682
822
  export {};
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.contactAssociationLink = exports.resource = exports.webhook = exports.file = exports.token = exports.instance = exports.communicationChannel = exports.workplace = void 0;
3
+ exports.ai = exports.contactAssociationLink = exports.resource = exports.webhook = exports.file = exports.token = exports.instance = exports.communicationChannel = exports.workplace = void 0;
4
4
  exports.runWithConfig = runWithConfig;
5
5
  exports.configure = configure;
6
6
  exports.getConfig = getConfig;
@@ -641,3 +641,125 @@ exports.contactAssociationLink = {
641
641
  return data;
642
642
  },
643
643
  };
644
+ /**
645
+ * Convert a Zod schema to JSON Schema format for transport.
646
+ * This is a simplified conversion that handles common Zod types.
647
+ */
648
+ function zodSchemaToJsonSchema(schema) {
649
+ // Use Zod's built-in JSON Schema conversion if available
650
+ // For now, we'll pass the schema description and let the server handle it
651
+ const jsonSchema = schema._def;
652
+ // Basic type mapping
653
+ if (jsonSchema?.typeName === 'ZodString') {
654
+ return { type: 'string' };
655
+ }
656
+ if (jsonSchema?.typeName === 'ZodNumber') {
657
+ return { type: 'number' };
658
+ }
659
+ if (jsonSchema?.typeName === 'ZodBoolean') {
660
+ return { type: 'boolean' };
661
+ }
662
+ if (jsonSchema?.typeName === 'ZodArray') {
663
+ const arrayDef = jsonSchema;
664
+ return {
665
+ type: 'array',
666
+ items: arrayDef.type ? zodSchemaToJsonSchema(arrayDef.type) : {},
667
+ };
668
+ }
669
+ if (jsonSchema?.typeName === 'ZodObject') {
670
+ const objectDef = jsonSchema;
671
+ const shape = objectDef.shape?.() ?? {};
672
+ const properties = {};
673
+ const required = [];
674
+ for (const [key, value] of Object.entries(shape)) {
675
+ properties[key] = zodSchemaToJsonSchema(value);
676
+ // Check if field is required (not optional/nullable)
677
+ const valueDef = value._def;
678
+ if (valueDef?.typeName !== 'ZodOptional' && valueDef?.typeName !== 'ZodNullable') {
679
+ required.push(key);
680
+ }
681
+ }
682
+ return {
683
+ type: 'object',
684
+ properties,
685
+ required: required.length > 0 ? required : undefined,
686
+ };
687
+ }
688
+ if (jsonSchema?.typeName === 'ZodNullable' || jsonSchema?.typeName === 'ZodOptional') {
689
+ const innerDef = jsonSchema;
690
+ const inner = innerDef.innerType ? zodSchemaToJsonSchema(innerDef.innerType) : {};
691
+ return { ...inner, nullable: true };
692
+ }
693
+ if (jsonSchema?.typeName === 'ZodEnum') {
694
+ const enumDef = jsonSchema;
695
+ return { type: 'string', enum: enumDef.values };
696
+ }
697
+ // Fallback: return empty object schema
698
+ return { type: 'object' };
699
+ }
700
+ exports.ai = {
701
+ /**
702
+ * Generate a structured object using AI.
703
+ *
704
+ * The AI will generate an object that conforms to the provided Zod schema.
705
+ * Supports both simple text prompts and multimodal messages with files/images.
706
+ *
707
+ * @example
708
+ * ```ts
709
+ * // Simple text prompt
710
+ * const result = await ai.generateObject({
711
+ * system: 'Extract patient information from the text.',
712
+ * prompt: 'Patient: Max, Species: Canine, DOB: 2020-01-15',
713
+ * schema: z.object({
714
+ * patientName: z.string(),
715
+ * species: z.string(),
716
+ * dateOfBirth: z.string().nullable(),
717
+ * }),
718
+ * })
719
+ *
720
+ * // With files array (simple multimodal)
721
+ * const result = await ai.generateObject({
722
+ * model: 'openai/gpt-4o',
723
+ * system: 'Parse the lab report and extract test results.',
724
+ * prompt: 'Extract all test results from this report.',
725
+ * files: ['fl_abc123'],
726
+ * schema: TestResultsSchema,
727
+ * })
728
+ *
729
+ * // With messages (advanced multimodal)
730
+ * const result = await ai.generateObject({
731
+ * model: 'openai/gpt-4o',
732
+ * system: 'Parse the lab report and extract test results.',
733
+ * schema: TestResultsSchema,
734
+ * messages: [
735
+ * {
736
+ * role: 'user',
737
+ * content: [
738
+ * { type: 'text', text: 'Extract all test results from this report.' },
739
+ * { type: 'file', fileId: 'fl_abc123' },
740
+ * ],
741
+ * },
742
+ * ],
743
+ * })
744
+ * ```
745
+ */
746
+ async generateObject(options) {
747
+ // Validate that either prompt or messages is provided
748
+ if (!options.prompt && !options.messages) {
749
+ throw new Error('Either prompt or messages must be provided');
750
+ }
751
+ // Convert Zod schema to JSON Schema for transport
752
+ const jsonSchema = zodSchemaToJsonSchema(options.schema);
753
+ const { data } = await callCore('ai.generateObject', {
754
+ ...(options.model ? { model: options.model } : {}),
755
+ system: options.system,
756
+ ...(options.prompt ? { prompt: options.prompt } : {}),
757
+ schema: jsonSchema,
758
+ ...(options.files && options.files.length > 0 ? { files: options.files } : {}),
759
+ ...(options.messages ? { messages: options.messages } : {}),
760
+ ...(options.maxTokens !== undefined ? { maxTokens: options.maxTokens } : {}),
761
+ ...(options.temperature !== undefined ? { temperature: options.temperature } : {}),
762
+ });
763
+ return data;
764
+ },
765
+ };
package/dist/index.d.ts CHANGED
@@ -7,8 +7,8 @@ export { DEFAULT_DOCKERFILE } from './dockerfile';
7
7
  export { InstallError, MissingRequiredFieldError, AuthenticationError, InvalidConfigurationError, ConnectionError, AppAuthInvalidError, } from './errors';
8
8
  export type { InstallErrorCode } from './errors';
9
9
  export { z };
10
- export { workplace, communicationChannel, instance, token, file, webhook, resource, contactAssociationLink, configure, getConfig, runWithConfig, } from './core/client';
11
- export type { InstanceContext, InstanceData, InstanceMeta, InstancePagination, InstanceListResult, InstanceListArgs, FileUrlResponse, FileUploadParams, FileUploadResult, WebhookCreateResult, WebhookListItem, WebhookDeleteByNameOptions, WebhookListOptions, ResourceLinkParams, ResourceLinkResult, ContactAssociationLinkCreateParams, ContactAssociationLinkCreateResult, } from './core/client';
10
+ export { workplace, communicationChannel, instance, token, file, webhook, resource, contactAssociationLink, ai, configure, getConfig, runWithConfig, } from './core/client';
11
+ export type { InstanceContext, InstanceData, InstanceMeta, InstancePagination, InstanceListResult, InstanceListArgs, FileUrlResponse, FileUploadParams, FileUploadResult, WebhookCreateResult, WebhookListItem, WebhookDeleteByNameOptions, WebhookListOptions, ResourceLinkParams, ResourceLinkResult, ContactAssociationLinkCreateParams, ContactAssociationLinkCreateResult, AITextContent, AIFileContent, AIImageContent, AIMessageContent, AIMessage, GenerateObjectOptions, GenerateObjectResult, } from './core/client';
12
12
  export { createContextLogger } from './server/logger';
13
13
  export type { ContextLogger } from './server/logger';
14
14
  declare const _default: {
@@ -16,4 +16,4 @@ declare const _default: {
16
16
  };
17
17
  export default _default;
18
18
  export { defineConfig, loadConfig, validateConfig, CONFIG_FILE_NAMES, getAllEnvKeys, getRequiredInstallEnvKeys, } from './config';
19
- export type { SkedyulConfig, SerializableSkedyulConfig, EnvVariableDefinition, EnvSchema, EnvVisibility, ComputeLayerType, InstallHandlerContext, InstallHandlerResult, InstallHandler, InstallHandlerResponseOAuth, InstallHandlerResponseStandard, HasOAuthCallback, ServerHooksWithOAuth, ServerHooksWithoutOAuth, ProvisionHandlerContext, ProvisionHandlerResult, ProvisionHandler, ServerHooks, InstallConfig, ModelDefinition, ModelFieldDefinition, ResourceScope, FieldOwner, InternalFieldDataType, FieldOption, InlineFieldDefinition, AppFieldVisibility, RelationshipDefinition, RelationshipLink, RelationshipCardinality, OnDeleteBehavior, ChannelDefinition, ChannelCapability, ChannelCapabilityType, ChannelFieldDefinition, WorkflowDefinition, WorkflowAction, WorkflowActionInput, PageDefinition, PageBlockDefinition, PageFieldDefinition, PageActionDefinition, PageType, PageBlockType, PageFieldType, PageFieldSource, PageFormHeader, PageContextMode, PageContextItemDefinition, PageContextDefinition, PageInstanceFilter, NavigationItem, NavigationSection, NavigationSidebar, BreadcrumbItem, NavigationBreadcrumb, NavigationConfig, WebhookHttpMethod, WebhookRequest, WebhookHandlerContext, WebhookHandlerResponse, WebhookHandlerFn, WebhookHandlerDefinition, Webhooks, WebhookHandlerMetadata, ProvisionConfig, ModelDependency, ChannelDependency, WorkflowDependency, ResourceDependency, StructuredFilter, } from './config';
19
+ export type { SkedyulConfig, SerializableSkedyulConfig, EnvVariableDefinition, EnvSchema, EnvVisibility, ComputeLayerType, InstallHandlerContext, InstallHandlerResult, InstallHandler, InstallHandlerResponseOAuth, InstallHandlerResponseStandard, HasOAuthCallback, ServerHooksWithOAuth, ServerHooksWithoutOAuth, ProvisionHandlerContext, ProvisionHandlerResult, ProvisionHandler, ServerHooks, InstallConfig, ModelDefinition, ModelFieldDefinition, FieldOwner, InternalFieldDataType, FieldOption, InlineFieldDefinition, AppFieldVisibility, RelationshipDefinition, RelationshipLink, RelationshipCardinality, OnDeleteBehavior, ChannelDefinition, ChannelCapability, ChannelCapabilityType, ChannelFieldDefinition, WorkflowDefinition, WorkflowAction, WorkflowActionInput, PageDefinition, PageBlockDefinition, PageFieldDefinition, PageActionDefinition, PageType, PageBlockType, PageFieldType, PageFieldSource, PageFormHeader, PageContextMode, PageContextItemDefinition, PageContextDefinition, PageInstanceFilter, NavigationItem, NavigationSection, NavigationSidebar, BreadcrumbItem, NavigationBreadcrumb, NavigationConfig, WebhookHttpMethod, WebhookRequest, WebhookHandlerContext, WebhookHandlerResponse, WebhookHandlerFn, WebhookHandlerDefinition, Webhooks, WebhookHandlerMetadata, ProvisionConfig, ModelDependency, ChannelDependency, WorkflowDependency, ResourceDependency, StructuredFilter, } from './config';
package/dist/index.js CHANGED
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.getRequiredInstallEnvKeys = exports.getAllEnvKeys = exports.CONFIG_FILE_NAMES = exports.validateConfig = exports.loadConfig = exports.defineConfig = exports.createContextLogger = exports.runWithConfig = exports.getConfig = exports.configure = exports.contactAssociationLink = exports.resource = exports.webhook = exports.file = exports.token = exports.instance = exports.communicationChannel = exports.workplace = exports.z = exports.AppAuthInvalidError = exports.ConnectionError = exports.InvalidConfigurationError = exports.AuthenticationError = exports.MissingRequiredFieldError = exports.InstallError = exports.DEFAULT_DOCKERFILE = exports.server = exports.ToolResponseMetaSchema = void 0;
17
+ exports.getRequiredInstallEnvKeys = exports.getAllEnvKeys = exports.CONFIG_FILE_NAMES = exports.validateConfig = exports.loadConfig = exports.defineConfig = exports.createContextLogger = exports.runWithConfig = exports.getConfig = exports.configure = exports.ai = exports.contactAssociationLink = exports.resource = exports.webhook = exports.file = exports.token = exports.instance = exports.communicationChannel = exports.workplace = exports.z = exports.AppAuthInvalidError = exports.ConnectionError = exports.InvalidConfigurationError = exports.AuthenticationError = exports.MissingRequiredFieldError = exports.InstallError = exports.DEFAULT_DOCKERFILE = exports.server = exports.ToolResponseMetaSchema = void 0;
18
18
  const v4_1 = require("zod/v4");
19
19
  Object.defineProperty(exports, "z", { enumerable: true, get: function () { return v4_1.z; } });
20
20
  __exportStar(require("./types"), exports);
@@ -42,6 +42,7 @@ Object.defineProperty(exports, "file", { enumerable: true, get: function () { re
42
42
  Object.defineProperty(exports, "webhook", { enumerable: true, get: function () { return client_1.webhook; } });
43
43
  Object.defineProperty(exports, "resource", { enumerable: true, get: function () { return client_1.resource; } });
44
44
  Object.defineProperty(exports, "contactAssociationLink", { enumerable: true, get: function () { return client_1.contactAssociationLink; } });
45
+ Object.defineProperty(exports, "ai", { enumerable: true, get: function () { return client_1.ai; } });
45
46
  Object.defineProperty(exports, "configure", { enumerable: true, get: function () { return client_1.configure; } });
46
47
  Object.defineProperty(exports, "getConfig", { enumerable: true, get: function () { return client_1.getConfig; } });
47
48
  Object.defineProperty(exports, "runWithConfig", { enumerable: true, get: function () { return client_1.runWithConfig; } });
package/dist/schemas.d.ts CHANGED
@@ -29,10 +29,6 @@ export declare const ComputeLayerTypeSchema: z.ZodEnum<{
29
29
  serverless: "serverless";
30
30
  dedicated: "dedicated";
31
31
  }>;
32
- export declare const ResourceScopeSchema: z.ZodEnum<{
33
- INTERNAL: "INTERNAL";
34
- SHARED: "SHARED";
35
- }>;
36
32
  export declare const FieldOwnerSchema: z.ZodEnum<{
37
33
  APP: "APP";
38
34
  WORKPLACE: "WORKPLACE";
@@ -150,10 +146,6 @@ export declare const ModelDefinitionSchema: z.ZodObject<{
150
146
  handle: z.ZodString;
151
147
  name: z.ZodString;
152
148
  namePlural: z.ZodOptional<z.ZodString>;
153
- scope: z.ZodEnum<{
154
- INTERNAL: "INTERNAL";
155
- SHARED: "SHARED";
156
- }>;
157
149
  labelTemplate: z.ZodOptional<z.ZodString>;
158
150
  description: z.ZodOptional<z.ZodString>;
159
151
  fields: z.ZodArray<z.ZodObject<{
@@ -410,12 +402,12 @@ export declare const PageTypeSchema: z.ZodEnum<{
410
402
  LIST: "LIST";
411
403
  }>;
412
404
  export declare const PageBlockTypeSchema: z.ZodEnum<{
405
+ list: "list";
413
406
  form: "form";
414
407
  spreadsheet: "spreadsheet";
415
408
  kanban: "kanban";
416
409
  calendar: "calendar";
417
410
  link: "link";
418
- list: "list";
419
411
  card: "card";
420
412
  }>;
421
413
  export declare const PageFieldTypeSchema: z.ZodEnum<{
@@ -461,18 +453,18 @@ export declare const FormV2StylePropsSchema: z.ZodObject<{
461
453
  export declare const FieldSettingButtonPropsSchema: z.ZodObject<{
462
454
  label: z.ZodString;
463
455
  variant: z.ZodOptional<z.ZodEnum<{
456
+ default: "default";
464
457
  link: "link";
465
458
  secondary: "secondary";
466
459
  destructive: "destructive";
467
- default: "default";
468
460
  outline: "outline";
469
461
  ghost: "ghost";
470
462
  }>>;
471
463
  size: z.ZodOptional<z.ZodEnum<{
472
464
  default: "default";
465
+ icon: "icon";
473
466
  sm: "sm";
474
467
  lg: "lg";
475
- icon: "icon";
476
468
  }>>;
477
469
  isLoading: z.ZodOptional<z.ZodBoolean>;
478
470
  isDisabled: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodString]>>;
@@ -524,12 +516,12 @@ export declare const InputComponentDefinitionSchema: z.ZodObject<{
524
516
  helpText: z.ZodOptional<z.ZodString>;
525
517
  type: z.ZodOptional<z.ZodEnum<{
526
518
  number: "number";
519
+ hidden: "hidden";
527
520
  text: "text";
528
521
  email: "email";
529
522
  password: "password";
530
523
  tel: "tel";
531
524
  url: "url";
532
- hidden: "hidden";
533
525
  }>>;
534
526
  required: z.ZodOptional<z.ZodBoolean>;
535
527
  disabled: z.ZodOptional<z.ZodBoolean>;
@@ -681,8 +673,8 @@ export declare const FileSettingComponentDefinitionSchema: z.ZodObject<{
681
673
  button: z.ZodOptional<z.ZodObject<{
682
674
  label: z.ZodOptional<z.ZodString>;
683
675
  variant: z.ZodOptional<z.ZodEnum<{
684
- link: "link";
685
676
  default: "default";
677
+ link: "link";
686
678
  outline: "outline";
687
679
  ghost: "ghost";
688
680
  }>>;
@@ -759,8 +751,8 @@ export declare const AlertComponentDefinitionSchema: z.ZodObject<{
759
751
  description: z.ZodString;
760
752
  icon: z.ZodOptional<z.ZodString>;
761
753
  variant: z.ZodOptional<z.ZodEnum<{
762
- destructive: "destructive";
763
754
  default: "default";
755
+ destructive: "destructive";
764
756
  }>>;
765
757
  }, z.core.$strip>;
766
758
  }, z.core.$strip>;
@@ -797,18 +789,18 @@ export declare const FieldSettingComponentDefinitionSchema: z.ZodObject<{
797
789
  button: z.ZodObject<{
798
790
  label: z.ZodString;
799
791
  variant: z.ZodOptional<z.ZodEnum<{
792
+ default: "default";
800
793
  link: "link";
801
794
  secondary: "secondary";
802
795
  destructive: "destructive";
803
- default: "default";
804
796
  outline: "outline";
805
797
  ghost: "ghost";
806
798
  }>>;
807
799
  size: z.ZodOptional<z.ZodEnum<{
808
800
  default: "default";
801
+ icon: "icon";
809
802
  sm: "sm";
810
803
  lg: "lg";
811
- icon: "icon";
812
804
  }>>;
813
805
  isLoading: z.ZodOptional<z.ZodBoolean>;
814
806
  isDisabled: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodString]>>;
@@ -847,12 +839,12 @@ export declare const FormV2ComponentDefinitionSchema: z.ZodDiscriminatedUnion<[z
847
839
  helpText: z.ZodOptional<z.ZodString>;
848
840
  type: z.ZodOptional<z.ZodEnum<{
849
841
  number: "number";
842
+ hidden: "hidden";
850
843
  text: "text";
851
844
  email: "email";
852
845
  password: "password";
853
846
  tel: "tel";
854
847
  url: "url";
855
- hidden: "hidden";
856
848
  }>>;
857
849
  required: z.ZodOptional<z.ZodBoolean>;
858
850
  disabled: z.ZodOptional<z.ZodBoolean>;
@@ -979,18 +971,18 @@ export declare const FormV2ComponentDefinitionSchema: z.ZodDiscriminatedUnion<[z
979
971
  button: z.ZodObject<{
980
972
  label: z.ZodString;
981
973
  variant: z.ZodOptional<z.ZodEnum<{
974
+ default: "default";
982
975
  link: "link";
983
976
  secondary: "secondary";
984
977
  destructive: "destructive";
985
- default: "default";
986
978
  outline: "outline";
987
979
  ghost: "ghost";
988
980
  }>>;
989
981
  size: z.ZodOptional<z.ZodEnum<{
990
982
  default: "default";
983
+ icon: "icon";
991
984
  sm: "sm";
992
985
  lg: "lg";
993
- icon: "icon";
994
986
  }>>;
995
987
  isLoading: z.ZodOptional<z.ZodBoolean>;
996
988
  isDisabled: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodString]>>;
@@ -1043,8 +1035,8 @@ export declare const FormV2ComponentDefinitionSchema: z.ZodDiscriminatedUnion<[z
1043
1035
  button: z.ZodOptional<z.ZodObject<{
1044
1036
  label: z.ZodOptional<z.ZodString>;
1045
1037
  variant: z.ZodOptional<z.ZodEnum<{
1046
- link: "link";
1047
1038
  default: "default";
1039
+ link: "link";
1048
1040
  outline: "outline";
1049
1041
  ghost: "ghost";
1050
1042
  }>>;
@@ -1107,8 +1099,8 @@ export declare const FormV2ComponentDefinitionSchema: z.ZodDiscriminatedUnion<[z
1107
1099
  description: z.ZodString;
1108
1100
  icon: z.ZodOptional<z.ZodString>;
1109
1101
  variant: z.ZodOptional<z.ZodEnum<{
1110
- destructive: "destructive";
1111
1102
  default: "default";
1103
+ destructive: "destructive";
1112
1104
  }>>;
1113
1105
  }, z.core.$strip>;
1114
1106
  }, z.core.$strip>], "component">;
@@ -1129,12 +1121,12 @@ export declare const FormV2PropsDefinitionSchema: z.ZodObject<{
1129
1121
  helpText: z.ZodOptional<z.ZodString>;
1130
1122
  type: z.ZodOptional<z.ZodEnum<{
1131
1123
  number: "number";
1124
+ hidden: "hidden";
1132
1125
  text: "text";
1133
1126
  email: "email";
1134
1127
  password: "password";
1135
1128
  tel: "tel";
1136
1129
  url: "url";
1137
- hidden: "hidden";
1138
1130
  }>>;
1139
1131
  required: z.ZodOptional<z.ZodBoolean>;
1140
1132
  disabled: z.ZodOptional<z.ZodBoolean>;
@@ -1261,18 +1253,18 @@ export declare const FormV2PropsDefinitionSchema: z.ZodObject<{
1261
1253
  button: z.ZodObject<{
1262
1254
  label: z.ZodString;
1263
1255
  variant: z.ZodOptional<z.ZodEnum<{
1256
+ default: "default";
1264
1257
  link: "link";
1265
1258
  secondary: "secondary";
1266
1259
  destructive: "destructive";
1267
- default: "default";
1268
1260
  outline: "outline";
1269
1261
  ghost: "ghost";
1270
1262
  }>>;
1271
1263
  size: z.ZodOptional<z.ZodEnum<{
1272
1264
  default: "default";
1265
+ icon: "icon";
1273
1266
  sm: "sm";
1274
1267
  lg: "lg";
1275
- icon: "icon";
1276
1268
  }>>;
1277
1269
  isLoading: z.ZodOptional<z.ZodBoolean>;
1278
1270
  isDisabled: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodString]>>;
@@ -1325,8 +1317,8 @@ export declare const FormV2PropsDefinitionSchema: z.ZodObject<{
1325
1317
  button: z.ZodOptional<z.ZodObject<{
1326
1318
  label: z.ZodOptional<z.ZodString>;
1327
1319
  variant: z.ZodOptional<z.ZodEnum<{
1328
- link: "link";
1329
1320
  default: "default";
1321
+ link: "link";
1330
1322
  outline: "outline";
1331
1323
  ghost: "ghost";
1332
1324
  }>>;
@@ -1389,8 +1381,8 @@ export declare const FormV2PropsDefinitionSchema: z.ZodObject<{
1389
1381
  description: z.ZodString;
1390
1382
  icon: z.ZodOptional<z.ZodString>;
1391
1383
  variant: z.ZodOptional<z.ZodEnum<{
1392
- destructive: "destructive";
1393
1384
  default: "default";
1385
+ destructive: "destructive";
1394
1386
  }>>;
1395
1387
  }, z.core.$strip>;
1396
1388
  }, z.core.$strip>], "component">>;
@@ -1450,12 +1442,12 @@ export declare const CardBlockDefinitionSchema: z.ZodObject<{
1450
1442
  helpText: z.ZodOptional<z.ZodString>;
1451
1443
  type: z.ZodOptional<z.ZodEnum<{
1452
1444
  number: "number";
1445
+ hidden: "hidden";
1453
1446
  text: "text";
1454
1447
  email: "email";
1455
1448
  password: "password";
1456
1449
  tel: "tel";
1457
1450
  url: "url";
1458
- hidden: "hidden";
1459
1451
  }>>;
1460
1452
  required: z.ZodOptional<z.ZodBoolean>;
1461
1453
  disabled: z.ZodOptional<z.ZodBoolean>;
@@ -1582,18 +1574,18 @@ export declare const CardBlockDefinitionSchema: z.ZodObject<{
1582
1574
  button: z.ZodObject<{
1583
1575
  label: z.ZodString;
1584
1576
  variant: z.ZodOptional<z.ZodEnum<{
1577
+ default: "default";
1585
1578
  link: "link";
1586
1579
  secondary: "secondary";
1587
1580
  destructive: "destructive";
1588
- default: "default";
1589
1581
  outline: "outline";
1590
1582
  ghost: "ghost";
1591
1583
  }>>;
1592
1584
  size: z.ZodOptional<z.ZodEnum<{
1593
1585
  default: "default";
1586
+ icon: "icon";
1594
1587
  sm: "sm";
1595
1588
  lg: "lg";
1596
- icon: "icon";
1597
1589
  }>>;
1598
1590
  isLoading: z.ZodOptional<z.ZodBoolean>;
1599
1591
  isDisabled: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodString]>>;
@@ -1646,8 +1638,8 @@ export declare const CardBlockDefinitionSchema: z.ZodObject<{
1646
1638
  button: z.ZodOptional<z.ZodObject<{
1647
1639
  label: z.ZodOptional<z.ZodString>;
1648
1640
  variant: z.ZodOptional<z.ZodEnum<{
1649
- link: "link";
1650
1641
  default: "default";
1642
+ link: "link";
1651
1643
  outline: "outline";
1652
1644
  ghost: "ghost";
1653
1645
  }>>;
@@ -1710,8 +1702,8 @@ export declare const CardBlockDefinitionSchema: z.ZodObject<{
1710
1702
  description: z.ZodString;
1711
1703
  icon: z.ZodOptional<z.ZodString>;
1712
1704
  variant: z.ZodOptional<z.ZodEnum<{
1713
- destructive: "destructive";
1714
1705
  default: "default";
1706
+ destructive: "destructive";
1715
1707
  }>>;
1716
1708
  }, z.core.$strip>;
1717
1709
  }, z.core.$strip>], "component">>;
@@ -1869,12 +1861,12 @@ export declare const PageBlockDefinitionSchema: z.ZodUnion<readonly [z.ZodObject
1869
1861
  helpText: z.ZodOptional<z.ZodString>;
1870
1862
  type: z.ZodOptional<z.ZodEnum<{
1871
1863
  number: "number";
1864
+ hidden: "hidden";
1872
1865
  text: "text";
1873
1866
  email: "email";
1874
1867
  password: "password";
1875
1868
  tel: "tel";
1876
1869
  url: "url";
1877
- hidden: "hidden";
1878
1870
  }>>;
1879
1871
  required: z.ZodOptional<z.ZodBoolean>;
1880
1872
  disabled: z.ZodOptional<z.ZodBoolean>;
@@ -2001,18 +1993,18 @@ export declare const PageBlockDefinitionSchema: z.ZodUnion<readonly [z.ZodObject
2001
1993
  button: z.ZodObject<{
2002
1994
  label: z.ZodString;
2003
1995
  variant: z.ZodOptional<z.ZodEnum<{
1996
+ default: "default";
2004
1997
  link: "link";
2005
1998
  secondary: "secondary";
2006
1999
  destructive: "destructive";
2007
- default: "default";
2008
2000
  outline: "outline";
2009
2001
  ghost: "ghost";
2010
2002
  }>>;
2011
2003
  size: z.ZodOptional<z.ZodEnum<{
2012
2004
  default: "default";
2005
+ icon: "icon";
2013
2006
  sm: "sm";
2014
2007
  lg: "lg";
2015
- icon: "icon";
2016
2008
  }>>;
2017
2009
  isLoading: z.ZodOptional<z.ZodBoolean>;
2018
2010
  isDisabled: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodString]>>;
@@ -2065,8 +2057,8 @@ export declare const PageBlockDefinitionSchema: z.ZodUnion<readonly [z.ZodObject
2065
2057
  button: z.ZodOptional<z.ZodObject<{
2066
2058
  label: z.ZodOptional<z.ZodString>;
2067
2059
  variant: z.ZodOptional<z.ZodEnum<{
2068
- link: "link";
2069
2060
  default: "default";
2061
+ link: "link";
2070
2062
  outline: "outline";
2071
2063
  ghost: "ghost";
2072
2064
  }>>;
@@ -2129,8 +2121,8 @@ export declare const PageBlockDefinitionSchema: z.ZodUnion<readonly [z.ZodObject
2129
2121
  description: z.ZodString;
2130
2122
  icon: z.ZodOptional<z.ZodString>;
2131
2123
  variant: z.ZodOptional<z.ZodEnum<{
2132
- destructive: "destructive";
2133
2124
  default: "default";
2125
+ destructive: "destructive";
2134
2126
  }>>;
2135
2127
  }, z.core.$strip>;
2136
2128
  }, z.core.$strip>], "component">>;
@@ -2373,12 +2365,12 @@ export declare const PageDefinitionSchema: z.ZodObject<{
2373
2365
  helpText: z.ZodOptional<z.ZodString>;
2374
2366
  type: z.ZodOptional<z.ZodEnum<{
2375
2367
  number: "number";
2368
+ hidden: "hidden";
2376
2369
  text: "text";
2377
2370
  email: "email";
2378
2371
  password: "password";
2379
2372
  tel: "tel";
2380
2373
  url: "url";
2381
- hidden: "hidden";
2382
2374
  }>>;
2383
2375
  required: z.ZodOptional<z.ZodBoolean>;
2384
2376
  disabled: z.ZodOptional<z.ZodBoolean>;
@@ -2505,18 +2497,18 @@ export declare const PageDefinitionSchema: z.ZodObject<{
2505
2497
  button: z.ZodObject<{
2506
2498
  label: z.ZodString;
2507
2499
  variant: z.ZodOptional<z.ZodEnum<{
2500
+ default: "default";
2508
2501
  link: "link";
2509
2502
  secondary: "secondary";
2510
2503
  destructive: "destructive";
2511
- default: "default";
2512
2504
  outline: "outline";
2513
2505
  ghost: "ghost";
2514
2506
  }>>;
2515
2507
  size: z.ZodOptional<z.ZodEnum<{
2516
2508
  default: "default";
2509
+ icon: "icon";
2517
2510
  sm: "sm";
2518
2511
  lg: "lg";
2519
- icon: "icon";
2520
2512
  }>>;
2521
2513
  isLoading: z.ZodOptional<z.ZodBoolean>;
2522
2514
  isDisabled: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodString]>>;
@@ -2569,8 +2561,8 @@ export declare const PageDefinitionSchema: z.ZodObject<{
2569
2561
  button: z.ZodOptional<z.ZodObject<{
2570
2562
  label: z.ZodOptional<z.ZodString>;
2571
2563
  variant: z.ZodOptional<z.ZodEnum<{
2572
- link: "link";
2573
2564
  default: "default";
2565
+ link: "link";
2574
2566
  outline: "outline";
2575
2567
  ghost: "ghost";
2576
2568
  }>>;
@@ -2633,8 +2625,8 @@ export declare const PageDefinitionSchema: z.ZodObject<{
2633
2625
  description: z.ZodString;
2634
2626
  icon: z.ZodOptional<z.ZodString>;
2635
2627
  variant: z.ZodOptional<z.ZodEnum<{
2636
- destructive: "destructive";
2637
2628
  default: "default";
2629
+ destructive: "destructive";
2638
2630
  }>>;
2639
2631
  }, z.core.$strip>;
2640
2632
  }, z.core.$strip>], "component">>;
@@ -2806,6 +2798,119 @@ export declare const AgentDefinitionSchema: z.ZodObject<{
2806
2798
  parentAgent: z.ZodOptional<z.ZodString>;
2807
2799
  }, z.core.$strip>;
2808
2800
  export type AgentDefinition = z.infer<typeof AgentDefinitionSchema>;
2801
+ export declare const InstallConfigSchema: z.ZodObject<{
2802
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
2803
+ label: z.ZodString;
2804
+ required: z.ZodOptional<z.ZodBoolean>;
2805
+ visibility: z.ZodOptional<z.ZodEnum<{
2806
+ visible: "visible";
2807
+ encrypted: "encrypted";
2808
+ }>>;
2809
+ default: z.ZodOptional<z.ZodString>;
2810
+ description: z.ZodOptional<z.ZodString>;
2811
+ placeholder: z.ZodOptional<z.ZodString>;
2812
+ }, z.core.$strip>>>;
2813
+ models: z.ZodOptional<z.ZodArray<z.ZodObject<{
2814
+ handle: z.ZodString;
2815
+ name: z.ZodString;
2816
+ namePlural: z.ZodOptional<z.ZodString>;
2817
+ labelTemplate: z.ZodOptional<z.ZodString>;
2818
+ description: z.ZodOptional<z.ZodString>;
2819
+ fields: z.ZodArray<z.ZodObject<{
2820
+ handle: z.ZodString;
2821
+ label: z.ZodString;
2822
+ type: z.ZodOptional<z.ZodEnum<{
2823
+ LONG_STRING: "LONG_STRING";
2824
+ STRING: "STRING";
2825
+ NUMBER: "NUMBER";
2826
+ BOOLEAN: "BOOLEAN";
2827
+ DATE: "DATE";
2828
+ DATE_TIME: "DATE_TIME";
2829
+ TIME: "TIME";
2830
+ FILE: "FILE";
2831
+ IMAGE: "IMAGE";
2832
+ RELATION: "RELATION";
2833
+ OBJECT: "OBJECT";
2834
+ }>>;
2835
+ definitionHandle: z.ZodOptional<z.ZodString>;
2836
+ definition: z.ZodOptional<z.ZodObject<{
2837
+ limitChoices: z.ZodOptional<z.ZodNumber>;
2838
+ options: z.ZodOptional<z.ZodArray<z.ZodObject<{
2839
+ label: z.ZodString;
2840
+ value: z.ZodString;
2841
+ color: z.ZodOptional<z.ZodString>;
2842
+ }, z.core.$strip>>>;
2843
+ minLength: z.ZodOptional<z.ZodNumber>;
2844
+ maxLength: z.ZodOptional<z.ZodNumber>;
2845
+ min: z.ZodOptional<z.ZodNumber>;
2846
+ max: z.ZodOptional<z.ZodNumber>;
2847
+ relatedModel: z.ZodOptional<z.ZodString>;
2848
+ pattern: z.ZodOptional<z.ZodString>;
2849
+ }, z.core.$strip>>;
2850
+ required: z.ZodOptional<z.ZodBoolean>;
2851
+ unique: z.ZodOptional<z.ZodBoolean>;
2852
+ system: z.ZodOptional<z.ZodBoolean>;
2853
+ isList: z.ZodOptional<z.ZodBoolean>;
2854
+ defaultValue: z.ZodOptional<z.ZodObject<{
2855
+ value: z.ZodUnknown;
2856
+ }, z.core.$strip>>;
2857
+ description: z.ZodOptional<z.ZodString>;
2858
+ visibility: z.ZodOptional<z.ZodObject<{
2859
+ data: z.ZodOptional<z.ZodBoolean>;
2860
+ list: z.ZodOptional<z.ZodBoolean>;
2861
+ filters: z.ZodOptional<z.ZodBoolean>;
2862
+ }, z.core.$strip>>;
2863
+ owner: z.ZodOptional<z.ZodEnum<{
2864
+ APP: "APP";
2865
+ WORKPLACE: "WORKPLACE";
2866
+ BOTH: "BOTH";
2867
+ }>>;
2868
+ }, z.core.$strip>>;
2869
+ requires: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
2870
+ model: z.ZodString;
2871
+ fields: z.ZodOptional<z.ZodArray<z.ZodString>>;
2872
+ where: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>]>>>>;
2873
+ }, z.core.$strip>, z.ZodObject<{
2874
+ channel: z.ZodString;
2875
+ }, z.core.$strip>, z.ZodObject<{
2876
+ workflow: z.ZodString;
2877
+ }, z.core.$strip>]>>>;
2878
+ }, z.core.$strip>>>;
2879
+ relationships: z.ZodOptional<z.ZodArray<z.ZodObject<{
2880
+ source: z.ZodObject<{
2881
+ model: z.ZodString;
2882
+ field: z.ZodString;
2883
+ label: z.ZodString;
2884
+ cardinality: z.ZodEnum<{
2885
+ ONE_TO_ONE: "ONE_TO_ONE";
2886
+ ONE_TO_MANY: "ONE_TO_MANY";
2887
+ MANY_TO_ONE: "MANY_TO_ONE";
2888
+ MANY_TO_MANY: "MANY_TO_MANY";
2889
+ }>;
2890
+ onDelete: z.ZodDefault<z.ZodEnum<{
2891
+ NONE: "NONE";
2892
+ CASCADE: "CASCADE";
2893
+ RESTRICT: "RESTRICT";
2894
+ }>>;
2895
+ }, z.core.$strip>;
2896
+ target: z.ZodObject<{
2897
+ model: z.ZodString;
2898
+ field: z.ZodString;
2899
+ label: z.ZodString;
2900
+ cardinality: z.ZodEnum<{
2901
+ ONE_TO_ONE: "ONE_TO_ONE";
2902
+ ONE_TO_MANY: "ONE_TO_MANY";
2903
+ MANY_TO_ONE: "MANY_TO_ONE";
2904
+ MANY_TO_MANY: "MANY_TO_MANY";
2905
+ }>;
2906
+ onDelete: z.ZodDefault<z.ZodEnum<{
2907
+ NONE: "NONE";
2908
+ CASCADE: "CASCADE";
2909
+ RESTRICT: "RESTRICT";
2910
+ }>>;
2911
+ }, z.core.$strip>;
2912
+ }, z.core.$strip>>>;
2913
+ }, z.core.$strip>;
2809
2914
  export declare const ProvisionConfigSchema: z.ZodObject<{
2810
2915
  env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
2811
2916
  label: z.ZodString;
@@ -2822,10 +2927,6 @@ export declare const ProvisionConfigSchema: z.ZodObject<{
2822
2927
  handle: z.ZodString;
2823
2928
  name: z.ZodString;
2824
2929
  namePlural: z.ZodOptional<z.ZodString>;
2825
- scope: z.ZodEnum<{
2826
- INTERNAL: "INTERNAL";
2827
- SHARED: "SHARED";
2828
- }>;
2829
2930
  labelTemplate: z.ZodOptional<z.ZodString>;
2830
2931
  description: z.ZodOptional<z.ZodString>;
2831
2932
  fields: z.ZodArray<z.ZodObject<{
@@ -3055,12 +3156,12 @@ export declare const ProvisionConfigSchema: z.ZodObject<{
3055
3156
  helpText: z.ZodOptional<z.ZodString>;
3056
3157
  type: z.ZodOptional<z.ZodEnum<{
3057
3158
  number: "number";
3159
+ hidden: "hidden";
3058
3160
  text: "text";
3059
3161
  email: "email";
3060
3162
  password: "password";
3061
3163
  tel: "tel";
3062
3164
  url: "url";
3063
- hidden: "hidden";
3064
3165
  }>>;
3065
3166
  required: z.ZodOptional<z.ZodBoolean>;
3066
3167
  disabled: z.ZodOptional<z.ZodBoolean>;
@@ -3187,18 +3288,18 @@ export declare const ProvisionConfigSchema: z.ZodObject<{
3187
3288
  button: z.ZodObject<{
3188
3289
  label: z.ZodString;
3189
3290
  variant: z.ZodOptional<z.ZodEnum<{
3291
+ default: "default";
3190
3292
  link: "link";
3191
3293
  secondary: "secondary";
3192
3294
  destructive: "destructive";
3193
- default: "default";
3194
3295
  outline: "outline";
3195
3296
  ghost: "ghost";
3196
3297
  }>>;
3197
3298
  size: z.ZodOptional<z.ZodEnum<{
3198
3299
  default: "default";
3300
+ icon: "icon";
3199
3301
  sm: "sm";
3200
3302
  lg: "lg";
3201
- icon: "icon";
3202
3303
  }>>;
3203
3304
  isLoading: z.ZodOptional<z.ZodBoolean>;
3204
3305
  isDisabled: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodString]>>;
@@ -3251,8 +3352,8 @@ export declare const ProvisionConfigSchema: z.ZodObject<{
3251
3352
  button: z.ZodOptional<z.ZodObject<{
3252
3353
  label: z.ZodOptional<z.ZodString>;
3253
3354
  variant: z.ZodOptional<z.ZodEnum<{
3254
- link: "link";
3255
3355
  default: "default";
3356
+ link: "link";
3256
3357
  outline: "outline";
3257
3358
  ghost: "ghost";
3258
3359
  }>>;
@@ -3315,8 +3416,8 @@ export declare const ProvisionConfigSchema: z.ZodObject<{
3315
3416
  description: z.ZodString;
3316
3417
  icon: z.ZodOptional<z.ZodString>;
3317
3418
  variant: z.ZodOptional<z.ZodEnum<{
3318
- destructive: "destructive";
3319
3419
  default: "default";
3420
+ destructive: "destructive";
3320
3421
  }>>;
3321
3422
  }, z.core.$strip>;
3322
3423
  }, z.core.$strip>], "component">>;
@@ -3464,10 +3565,6 @@ export declare const SkedyulConfigSchema: z.ZodObject<{
3464
3565
  handle: z.ZodString;
3465
3566
  name: z.ZodString;
3466
3567
  namePlural: z.ZodOptional<z.ZodString>;
3467
- scope: z.ZodEnum<{
3468
- INTERNAL: "INTERNAL";
3469
- SHARED: "SHARED";
3470
- }>;
3471
3568
  labelTemplate: z.ZodOptional<z.ZodString>;
3472
3569
  description: z.ZodOptional<z.ZodString>;
3473
3570
  fields: z.ZodArray<z.ZodObject<{
@@ -3697,12 +3794,12 @@ export declare const SkedyulConfigSchema: z.ZodObject<{
3697
3794
  helpText: z.ZodOptional<z.ZodString>;
3698
3795
  type: z.ZodOptional<z.ZodEnum<{
3699
3796
  number: "number";
3797
+ hidden: "hidden";
3700
3798
  text: "text";
3701
3799
  email: "email";
3702
3800
  password: "password";
3703
3801
  tel: "tel";
3704
3802
  url: "url";
3705
- hidden: "hidden";
3706
3803
  }>>;
3707
3804
  required: z.ZodOptional<z.ZodBoolean>;
3708
3805
  disabled: z.ZodOptional<z.ZodBoolean>;
@@ -3829,18 +3926,18 @@ export declare const SkedyulConfigSchema: z.ZodObject<{
3829
3926
  button: z.ZodObject<{
3830
3927
  label: z.ZodString;
3831
3928
  variant: z.ZodOptional<z.ZodEnum<{
3929
+ default: "default";
3832
3930
  link: "link";
3833
3931
  secondary: "secondary";
3834
3932
  destructive: "destructive";
3835
- default: "default";
3836
3933
  outline: "outline";
3837
3934
  ghost: "ghost";
3838
3935
  }>>;
3839
3936
  size: z.ZodOptional<z.ZodEnum<{
3840
3937
  default: "default";
3938
+ icon: "icon";
3841
3939
  sm: "sm";
3842
3940
  lg: "lg";
3843
- icon: "icon";
3844
3941
  }>>;
3845
3942
  isLoading: z.ZodOptional<z.ZodBoolean>;
3846
3943
  isDisabled: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodString]>>;
@@ -3893,8 +3990,8 @@ export declare const SkedyulConfigSchema: z.ZodObject<{
3893
3990
  button: z.ZodOptional<z.ZodObject<{
3894
3991
  label: z.ZodOptional<z.ZodString>;
3895
3992
  variant: z.ZodOptional<z.ZodEnum<{
3896
- link: "link";
3897
3993
  default: "default";
3994
+ link: "link";
3898
3995
  outline: "outline";
3899
3996
  ghost: "ghost";
3900
3997
  }>>;
@@ -3957,8 +4054,8 @@ export declare const SkedyulConfigSchema: z.ZodObject<{
3957
4054
  description: z.ZodString;
3958
4055
  icon: z.ZodOptional<z.ZodString>;
3959
4056
  variant: z.ZodOptional<z.ZodEnum<{
3960
- destructive: "destructive";
3961
4057
  default: "default";
4058
+ destructive: "destructive";
3962
4059
  }>>;
3963
4060
  }, z.core.$strip>;
3964
4061
  }, z.core.$strip>], "component">>;
@@ -4092,7 +4189,6 @@ export declare const SkedyulConfigSchema: z.ZodObject<{
4092
4189
  }, z.core.$strip>;
4093
4190
  export type ParsedSkedyulConfig = z.infer<typeof SkedyulConfigSchema>;
4094
4191
  export declare function safeParseConfig(data: unknown): ParsedSkedyulConfig | null;
4095
- export type ResourceScope = z.infer<typeof ResourceScopeSchema>;
4096
4192
  export type FieldOwner = z.infer<typeof FieldOwnerSchema>;
4097
4193
  export type StructuredFilter = z.infer<typeof StructuredFilterSchema>;
4098
4194
  export type FieldOption = z.infer<typeof FieldOptionSchema>;
@@ -4135,6 +4231,7 @@ export type WorkflowDefinition = z.infer<typeof WorkflowDefinitionSchema>;
4135
4231
  export type WebhookHttpMethod = z.infer<typeof WebhookHttpMethodSchema>;
4136
4232
  export type WebhookHandlerDefinition = z.infer<typeof WebhookHandlerDefinitionSchema>;
4137
4233
  export type Webhooks = z.infer<typeof WebhooksSchema>;
4234
+ export type InstallConfig = z.infer<typeof InstallConfigSchema>;
4138
4235
  export type ProvisionConfig = z.infer<typeof ProvisionConfigSchema>;
4139
4236
  export type FormV2StyleProps = z.infer<typeof FormV2StylePropsSchema>;
4140
4237
  export type FieldSettingButtonProps = z.infer<typeof FieldSettingButtonPropsSchema>;
package/dist/schemas.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ListItemTemplateSchema = exports.FileSettingComponentDefinitionSchema = exports.ImageSettingComponentDefinitionSchema = exports.TimePickerComponentDefinitionSchema = exports.DatePickerComponentDefinitionSchema = exports.CheckboxComponentDefinitionSchema = exports.ComboboxComponentDefinitionSchema = exports.SelectComponentDefinitionSchema = exports.TextareaComponentDefinitionSchema = exports.InputComponentDefinitionSchema = exports.FormLayoutConfigDefinitionSchema = exports.FormLayoutRowDefinitionSchema = exports.FormLayoutColumnDefinitionSchema = exports.RelationshipExtensionSchema = exports.FieldSettingButtonPropsSchema = exports.FormV2StylePropsSchema = exports.PageActionDefinitionSchema = exports.PageFormHeaderSchema = exports.PageFieldSourceSchema = exports.PageFieldTypeSchema = exports.PageBlockTypeSchema = exports.PageTypeSchema = exports.WorkflowDefinitionSchema = exports.WorkflowActionSchema = exports.WorkflowActionInputSchema = exports.ChannelDefinitionSchema = exports.ChannelFieldDefinitionSchema = exports.ChannelCapabilitySchema = exports.ChannelCapabilityTypeSchema = exports.RelationshipDefinitionSchema = exports.RelationshipLinkSchema = exports.OnDeleteBehaviorSchema = exports.RelationshipCardinalitySchema = exports.ModelDefinitionSchema = exports.ModelFieldDefinitionSchema = exports.AppFieldVisibilitySchema = exports.InlineFieldDefinitionSchema = exports.FieldOptionSchema = exports.FieldDataTypeSchema = exports.ResourceDependencySchema = exports.WorkflowDependencySchema = exports.ChannelDependencySchema = exports.ModelDependencySchema = exports.StructuredFilterSchema = exports.FieldOwnerSchema = exports.ResourceScopeSchema = exports.ComputeLayerTypeSchema = exports.EnvSchemaSchema = exports.EnvVariableDefinitionSchema = exports.EnvVisibilitySchema = void 0;
4
- exports.MessageSendOutputSchema = exports.MessageSendInputSchema = exports.MessageSendMessageSchema = exports.MessageSendContactSchema = exports.MessageSendSubscriptionSchema = exports.MessageSendChannelSchema = exports.SkedyulConfigSchema = exports.ProvisionConfigSchema = exports.AgentDefinitionSchema = exports.WebhooksSchema = exports.WebhookHandlerDefinitionSchema = exports.WebhookTypeSchema = exports.WebhookHttpMethodSchema = exports.PageDefinitionSchema = exports.NavigationConfigSchema = exports.NavigationBreadcrumbSchema = exports.BreadcrumbItemSchema = exports.NavigationSidebarSchema = exports.NavigationSectionSchema = exports.NavigationItemSchema = exports.PageInstanceFilterSchema = exports.PageContextDefinitionSchema = exports.PageContextToolItemDefinitionSchema = exports.PageContextItemDefinitionSchema = exports.PageContextFiltersSchema = exports.PageContextModeSchema = exports.PageBlockDefinitionSchema = exports.ModelMapperBlockDefinitionSchema = exports.ListBlockDefinitionSchema = exports.LegacyFormBlockDefinitionSchema = exports.PageFieldDefinitionSchema = exports.CardBlockDefinitionSchema = exports.CardBlockHeaderSchema = exports.FormV2PropsDefinitionSchema = exports.FormV2ComponentDefinitionSchema = exports.FieldSettingComponentDefinitionSchema = exports.ModalFormDefinitionSchema = exports.AlertComponentDefinitionSchema = exports.EmptyFormComponentDefinitionSchema = exports.ListComponentDefinitionSchema = void 0;
3
+ exports.ListComponentDefinitionSchema = exports.ListItemTemplateSchema = exports.FileSettingComponentDefinitionSchema = exports.ImageSettingComponentDefinitionSchema = exports.TimePickerComponentDefinitionSchema = exports.DatePickerComponentDefinitionSchema = exports.CheckboxComponentDefinitionSchema = exports.ComboboxComponentDefinitionSchema = exports.SelectComponentDefinitionSchema = exports.TextareaComponentDefinitionSchema = exports.InputComponentDefinitionSchema = exports.FormLayoutConfigDefinitionSchema = exports.FormLayoutRowDefinitionSchema = exports.FormLayoutColumnDefinitionSchema = exports.RelationshipExtensionSchema = exports.FieldSettingButtonPropsSchema = exports.FormV2StylePropsSchema = exports.PageActionDefinitionSchema = exports.PageFormHeaderSchema = exports.PageFieldSourceSchema = exports.PageFieldTypeSchema = exports.PageBlockTypeSchema = exports.PageTypeSchema = exports.WorkflowDefinitionSchema = exports.WorkflowActionSchema = exports.WorkflowActionInputSchema = exports.ChannelDefinitionSchema = exports.ChannelFieldDefinitionSchema = exports.ChannelCapabilitySchema = exports.ChannelCapabilityTypeSchema = exports.RelationshipDefinitionSchema = exports.RelationshipLinkSchema = exports.OnDeleteBehaviorSchema = exports.RelationshipCardinalitySchema = exports.ModelDefinitionSchema = exports.ModelFieldDefinitionSchema = exports.AppFieldVisibilitySchema = exports.InlineFieldDefinitionSchema = exports.FieldOptionSchema = exports.FieldDataTypeSchema = exports.ResourceDependencySchema = exports.WorkflowDependencySchema = exports.ChannelDependencySchema = exports.ModelDependencySchema = exports.StructuredFilterSchema = exports.FieldOwnerSchema = exports.ComputeLayerTypeSchema = exports.EnvSchemaSchema = exports.EnvVariableDefinitionSchema = exports.EnvVisibilitySchema = void 0;
4
+ exports.MessageSendOutputSchema = exports.MessageSendInputSchema = exports.MessageSendMessageSchema = exports.MessageSendContactSchema = exports.MessageSendSubscriptionSchema = exports.MessageSendChannelSchema = exports.SkedyulConfigSchema = exports.ProvisionConfigSchema = exports.InstallConfigSchema = exports.AgentDefinitionSchema = exports.WebhooksSchema = exports.WebhookHandlerDefinitionSchema = exports.WebhookTypeSchema = exports.WebhookHttpMethodSchema = exports.PageDefinitionSchema = exports.NavigationConfigSchema = exports.NavigationBreadcrumbSchema = exports.BreadcrumbItemSchema = exports.NavigationSidebarSchema = exports.NavigationSectionSchema = exports.NavigationItemSchema = exports.PageInstanceFilterSchema = exports.PageContextDefinitionSchema = exports.PageContextToolItemDefinitionSchema = exports.PageContextItemDefinitionSchema = exports.PageContextFiltersSchema = exports.PageContextModeSchema = exports.PageBlockDefinitionSchema = exports.ModelMapperBlockDefinitionSchema = exports.ListBlockDefinitionSchema = exports.LegacyFormBlockDefinitionSchema = exports.PageFieldDefinitionSchema = exports.CardBlockDefinitionSchema = exports.CardBlockHeaderSchema = exports.FormV2PropsDefinitionSchema = exports.FormV2ComponentDefinitionSchema = exports.FieldSettingComponentDefinitionSchema = exports.ModalFormDefinitionSchema = exports.AlertComponentDefinitionSchema = exports.EmptyFormComponentDefinitionSchema = void 0;
5
5
  exports.safeParseConfig = safeParseConfig;
6
6
  exports.isModelDependency = isModelDependency;
7
7
  exports.isChannelDependency = isChannelDependency;
@@ -25,9 +25,8 @@ exports.EnvSchemaSchema = v4_1.z.record(v4_1.z.string(), exports.EnvVariableDefi
25
25
  // ─────────────────────────────────────────────────────────────────────────────
26
26
  exports.ComputeLayerTypeSchema = v4_1.z.enum(['serverless', 'dedicated']);
27
27
  // ─────────────────────────────────────────────────────────────────────────────
28
- // Resource Scope and Dependencies
28
+ // Resource Dependencies
29
29
  // ─────────────────────────────────────────────────────────────────────────────
30
- exports.ResourceScopeSchema = v4_1.z.enum(['INTERNAL', 'SHARED']);
31
30
  exports.FieldOwnerSchema = v4_1.z.enum(['APP', 'WORKPLACE', 'BOTH']);
32
31
  const PrimitiveSchema = v4_1.z.union([v4_1.z.string(), v4_1.z.number(), v4_1.z.boolean()]);
33
32
  exports.StructuredFilterSchema = v4_1.z.record(v4_1.z.string(), v4_1.z.record(v4_1.z.string(), v4_1.z.union([PrimitiveSchema, v4_1.z.array(PrimitiveSchema)])));
@@ -102,7 +101,6 @@ exports.ModelDefinitionSchema = v4_1.z.object({
102
101
  handle: v4_1.z.string(),
103
102
  name: v4_1.z.string(),
104
103
  namePlural: v4_1.z.string().optional(),
105
- scope: exports.ResourceScopeSchema,
106
104
  labelTemplate: v4_1.z.string().optional(),
107
105
  description: v4_1.z.string().optional(),
108
106
  fields: v4_1.z.array(exports.ModelFieldDefinitionSchema),
@@ -548,7 +546,7 @@ exports.ListBlockDefinitionSchema = v4_1.z.object({
548
546
  /** Model mapper block definition - for mapping SHARED models to workspace models */
549
547
  exports.ModelMapperBlockDefinitionSchema = v4_1.z.object({
550
548
  type: v4_1.z.literal('model-mapper'),
551
- /** The SHARED model handle from provision config (e.g., "client", "patient") */
549
+ /** The SHARED model handle from install config (e.g., "client", "patient") */
552
550
  model: v4_1.z.string(),
553
551
  });
554
552
  /** Union of all block types */
@@ -692,9 +690,23 @@ exports.AgentDefinitionSchema = v4_1.z.object({
692
690
  parentAgent: v4_1.z.string().optional(),
693
691
  });
694
692
  // ─────────────────────────────────────────────────────────────────────────────
693
+ // Install Config Schema
694
+ // ─────────────────────────────────────────────────────────────────────────────
695
+ exports.InstallConfigSchema = v4_1.z.object({
696
+ env: exports.EnvSchemaSchema.optional(),
697
+ /** SHARED model definitions (mapped to user's existing data during installation) */
698
+ models: v4_1.z.array(exports.ModelDefinitionSchema).optional(),
699
+ /** Relationship definitions between SHARED models */
700
+ relationships: v4_1.z.array(exports.RelationshipDefinitionSchema).optional(),
701
+ });
702
+ // ─────────────────────────────────────────────────────────────────────────────
703
+ // Provision Config Schema
704
+ // ─────────────────────────────────────────────────────────────────────────────
695
705
  exports.ProvisionConfigSchema = v4_1.z.object({
696
706
  env: exports.EnvSchemaSchema.optional(),
707
+ /** INTERNAL model definitions (app-owned, not visible to users) */
697
708
  models: v4_1.z.array(exports.ModelDefinitionSchema).optional(),
709
+ /** Relationship definitions between INTERNAL models */
698
710
  relationships: v4_1.z.array(exports.RelationshipDefinitionSchema).optional(),
699
711
  channels: v4_1.z.array(exports.ChannelDefinitionSchema).optional(),
700
712
  workflows: v4_1.z.array(exports.WorkflowDefinitionSchema).optional(),
@@ -585,13 +585,14 @@ function createServerlessInstance(config, tools, callTool, state, mcpServer, reg
585
585
  else if (rpcMethod === 'tools/call') {
586
586
  const toolName = params?.name;
587
587
  // Support both formats:
588
- // 1. Skedyul format: { inputs: {...}, context: {...}, env: {...} }
588
+ // 1. Skedyul format: { inputs: {...}, context: {...}, env: {...}, invocation: {...} }
589
589
  // 2. Standard MCP format: { ...directArgs }
590
590
  const rawArgs = (params?.arguments ?? {});
591
- const hasSkedyulFormat = 'inputs' in rawArgs || 'env' in rawArgs || 'context' in rawArgs;
591
+ const hasSkedyulFormat = 'inputs' in rawArgs || 'env' in rawArgs || 'context' in rawArgs || 'invocation' in rawArgs;
592
592
  const toolInputs = hasSkedyulFormat ? (rawArgs.inputs ?? {}) : rawArgs;
593
593
  const toolContext = hasSkedyulFormat ? rawArgs.context : undefined;
594
594
  const toolEnv = hasSkedyulFormat ? rawArgs.env : undefined;
595
+ const toolInvocation = hasSkedyulFormat ? rawArgs.invocation : undefined;
595
596
  // Find tool by name (check both registry key and tool.name)
596
597
  let toolKey = null;
597
598
  let tool = null;
@@ -623,6 +624,7 @@ function createServerlessInstance(config, tools, callTool, state, mcpServer, reg
623
624
  inputs: validatedInputs,
624
625
  context: toolContext,
625
626
  env: toolEnv,
627
+ invocation: toolInvocation,
626
628
  });
627
629
  // Transform internal format to MCP protocol format
628
630
  // Note: effect is embedded in structuredContent as __effect
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skedyul",
3
- "version": "0.3.14",
3
+ "version": "0.3.16",
4
4
  "description": "The Skedyul SDK for Node.js",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",