skedyul 1.7.25 → 1.7.27

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/README.md CHANGED
@@ -120,6 +120,7 @@ See [Local development](./docs/cli.md#local-development) for the full workflow.
120
120
  | `skedyul/schemas/agent-schema` | Legacy multi-stage agent schema |
121
121
  | `skedyul/skills/types` | Skill YAML types |
122
122
  | `skedyul/scheduling` | Workflow-safe time windows and wait calculations |
123
+ | `skedyul/cli` | Programmatic CLI API (CRM, workflows, apps, workplaces) |
123
124
  | `skedyul/cli/utils/auth` | CLI auth helpers (for monorepo tooling) |
124
125
 
125
126
  ## Server modes
package/dist/.build-stamp CHANGED
@@ -1 +1 @@
1
- 1786337245045
1
+ 1787542758884
@@ -0,0 +1,123 @@
1
+ import { type CliContext } from './context';
2
+ export interface LinkAppInput {
3
+ appHandle: string;
4
+ workplaceSubdomain: string;
5
+ }
6
+ export interface LinkAppResult {
7
+ appId: string;
8
+ appHandle: string;
9
+ appVersionId: string;
10
+ appVersionHandle: string;
11
+ appInstallationId: string;
12
+ workplaceId: string;
13
+ workplaceSubdomain: string;
14
+ isNewVersion: boolean;
15
+ isNewInstallation: boolean;
16
+ }
17
+ export interface InvokeToolInput {
18
+ appInstallationId: string;
19
+ toolName: string;
20
+ args?: Record<string, unknown>;
21
+ timeout?: number;
22
+ }
23
+ export interface InvokeToolResult {
24
+ success: boolean;
25
+ result: unknown;
26
+ error?: string;
27
+ availableTools?: string[];
28
+ }
29
+ export interface InstallationStatusResult {
30
+ status?: string;
31
+ appInstallationId?: string;
32
+ [key: string]: unknown;
33
+ }
34
+ export interface SyncResourcesResult {
35
+ tools?: {
36
+ synced: number;
37
+ disabled: number;
38
+ };
39
+ webhooks?: {
40
+ synced: number;
41
+ disabled: number;
42
+ };
43
+ internalModels?: {
44
+ modelsCreated: number;
45
+ modelsUpdated: number;
46
+ fieldsCreated: number;
47
+ relationshipsCreated: number;
48
+ };
49
+ pendingMigration?: {
50
+ migrationId: string;
51
+ impacts: Array<{
52
+ operationType: string;
53
+ resourceType: string;
54
+ resourceHandle: string;
55
+ affectedRecords?: number;
56
+ message?: string;
57
+ isDestructive?: boolean;
58
+ }>;
59
+ timeoutMinutes: number;
60
+ createdAt: string;
61
+ };
62
+ error?: string;
63
+ }
64
+ export interface PlatformTool {
65
+ id: string;
66
+ name: string;
67
+ displayName?: string;
68
+ description?: string;
69
+ kind?: string;
70
+ [key: string]: unknown;
71
+ }
72
+ export declare function linkApp(ctx: CliContext, input: LinkAppInput): Promise<LinkAppResult>;
73
+ export declare function registerEndpoint(ctx: CliContext, input: {
74
+ appVersionId: string;
75
+ invokeEndpoint: string;
76
+ config?: Record<string, unknown>;
77
+ }): Promise<unknown>;
78
+ export declare function unregisterEndpoint(ctx: CliContext, input: {
79
+ appVersionId: string;
80
+ }): Promise<unknown>;
81
+ export declare function heartbeat(ctx: CliContext, input: {
82
+ appVersionId: string;
83
+ config?: Record<string, unknown>;
84
+ }): Promise<unknown>;
85
+ export declare function installApp(ctx: CliContext, input: {
86
+ appVersionId: string;
87
+ env?: Record<string, string>;
88
+ }): Promise<unknown>;
89
+ export declare function uninstallApp(ctx: CliContext, input: {
90
+ appInstallationId: string;
91
+ deleteFields?: boolean;
92
+ }): Promise<unknown>;
93
+ export declare function getInstallation(ctx: CliContext, input: {
94
+ appVersionId: string;
95
+ }): Promise<InstallationStatusResult>;
96
+ export declare function syncResources(ctx: CliContext, input: {
97
+ appVersionId: string;
98
+ workplaceSubdomain: string;
99
+ config: Record<string, unknown>;
100
+ }): Promise<SyncResourcesResult>;
101
+ export declare function listTools(ctx: CliContext, input: {
102
+ workplaceId: string;
103
+ name?: string;
104
+ toolId?: string;
105
+ kind?: string;
106
+ }): Promise<{
107
+ success: boolean;
108
+ tools?: PlatformTool[];
109
+ tool?: PlatformTool;
110
+ }>;
111
+ export declare function invokeTool(ctx: CliContext, input: InvokeToolInput): Promise<InvokeToolResult>;
112
+ export declare const apps: {
113
+ link: typeof linkApp;
114
+ registerEndpoint: typeof registerEndpoint;
115
+ unregisterEndpoint: typeof unregisterEndpoint;
116
+ heartbeat: typeof heartbeat;
117
+ install: typeof installApp;
118
+ uninstall: typeof uninstallApp;
119
+ installation: typeof getInstallation;
120
+ syncResources: typeof syncResources;
121
+ listTools: typeof listTools;
122
+ invokeTool: typeof invokeTool;
123
+ };
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Explicit CLI credentials. Callers (CLI, MCP stdio, hosted MCP) build this
3
+ * themselves — these APIs never read `~/.skedyul`.
4
+ */
5
+ export interface CliContext {
6
+ token: string;
7
+ serverUrl: string;
8
+ }
9
+ export interface WorkplaceToken {
10
+ token: string;
11
+ expiresAt: string;
12
+ workplaceId: string;
13
+ workplaceName: string;
14
+ workplaceSubdomain: string;
15
+ }
16
+ export interface WorkplaceSummary {
17
+ id: string;
18
+ name: string;
19
+ subdomain: string;
20
+ }
21
+ export declare function cliApi(ctx: CliContext): {
22
+ serverUrl: string;
23
+ token: string;
24
+ };
25
+ export declare function getWorkplaceToken(ctx: CliContext, workplaceSubdomain: string): Promise<WorkplaceToken>;
26
+ export declare function listWorkplaces(ctx: CliContext): Promise<WorkplaceSummary[]>;
27
+ export declare const workplaces: {
28
+ list: typeof listWorkplaces;
29
+ getWorkplaceToken: typeof getWorkplaceToken;
30
+ };
@@ -0,0 +1,56 @@
1
+ import type { CRMSchema } from '../../schemas/crm-schema';
2
+ import { type CliContext } from './context';
3
+ export interface SchemaImpact {
4
+ operationType: string;
5
+ resourceType: string;
6
+ resourceHandle: string;
7
+ affectedRecords?: number;
8
+ message?: string;
9
+ isDestructive: boolean;
10
+ }
11
+ export interface SchemaPushResult {
12
+ success: boolean;
13
+ migrationId?: string;
14
+ requiresApproval: boolean;
15
+ hasChanges?: boolean;
16
+ impacts: SchemaImpact[];
17
+ error?: string;
18
+ }
19
+ export interface SchemaPullResult {
20
+ success: boolean;
21
+ schema: CRMSchema;
22
+ workplaceName: string;
23
+ error?: string;
24
+ }
25
+ export interface CrmModelSummary {
26
+ id: string;
27
+ handle: string;
28
+ name: string;
29
+ namePlural?: string;
30
+ fieldCount: number;
31
+ instanceCount: number;
32
+ }
33
+ export interface ModelsListResult {
34
+ success: boolean;
35
+ models: CrmModelSummary[];
36
+ error?: string;
37
+ }
38
+ export declare function listModels(ctx: CliContext, workplace: string): Promise<CrmModelSummary[]>;
39
+ export declare function pullSchema(ctx: CliContext, workplace: string): Promise<{
40
+ schema: CRMSchema;
41
+ workplaceName: string;
42
+ }>;
43
+ export interface PushSchemaOptions {
44
+ dryRun?: boolean;
45
+ autoApprove?: boolean;
46
+ }
47
+ export declare function diffSchema(ctx: CliContext, workplace: string, schema: CRMSchema): Promise<SchemaPushResult>;
48
+ export declare function approveMigration(ctx: CliContext, migrationId: string): Promise<void>;
49
+ export declare function pushSchema(ctx: CliContext, workplace: string, schema: CRMSchema, options?: PushSchemaOptions): Promise<SchemaPushResult>;
50
+ export declare const crm: {
51
+ listModels: typeof listModels;
52
+ pullSchema: typeof pullSchema;
53
+ diffSchema: typeof diffSchema;
54
+ pushSchema: typeof pushSchema;
55
+ approveMigration: typeof approveMigration;
56
+ };
@@ -0,0 +1,11 @@
1
+ export type { CliContext, WorkplaceToken, WorkplaceSummary } from './context';
2
+ export { getWorkplaceToken, listWorkplaces, workplaces } from './context';
3
+ export { crm } from './crm';
4
+ export type { SchemaImpact, SchemaPushResult, SchemaPullResult, CrmModelSummary, PushSchemaOptions, } from './crm';
5
+ export { listModels, pullSchema, diffSchema, pushSchema, approveMigration, } from './crm';
6
+ export { workflows } from './workflows';
7
+ export type { WorkflowRecord, WorkflowVersion, DeployWorkflowResult, ValidateWorkflowResult, RunWorkflowResult, WorkflowRunStatus, WorkflowSchema, PublishWorkflowResult, PullWorkflowResult, DeployWorkflowOptions, } from './workflows';
8
+ export { listWorkflows, getWorkflow, listWorkflowVersions, validateWorkflow, validateWorkflowContent, deployWorkflow, publishWorkflow, pullWorkflow, getWorkflowSchema, runWorkflow, getWorkflowRun, } from './workflows';
9
+ export { apps } from './apps';
10
+ export type { LinkAppInput, LinkAppResult, InvokeToolInput, InvokeToolResult, SyncResourcesResult, PlatformTool, } from './apps';
11
+ export { linkApp, registerEndpoint, unregisterEndpoint, heartbeat, installApp, uninstallApp, getInstallation, syncResources, listTools, invokeTool, } from './apps';