skedyul 1.7.29 → 1.7.31

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
@@ -10,7 +10,7 @@ The official Node.js SDK for building [Skedyul](https://skedyul.com) integration
10
10
  |------------|-------------|
11
11
  | **MCP tools** | Functions AI agents invoke via the Model Context Protocol |
12
12
  | **Webhooks** | HTTP handlers for SMS, email, OAuth callbacks, and third-party events |
13
- | **Lifecycle hooks** | Install, provision, uninstall, and OAuth flows |
13
+ | **Lifecycle hooks** | Install, provision, uninstall, OAuth, and token refresh |
14
14
  | **CRM models** | App-owned (internal) and user-mapped (shared) data models |
15
15
  | **Agents (v3)** | Skills-based autonomous agents deployed per workplace |
16
16
  | **Skills & workflows** | YAML-defined capabilities and event-driven automation |
@@ -174,7 +174,7 @@ Full documentation lives in [`docs/`](./docs/README.md).
174
174
  | [Configuration](./docs/configuration.md) | `skedyul.config.ts` reference — models, channels, pages, env, queues |
175
175
  | [Tools](./docs/tools.md) | Building MCP tools with Zod schemas and handlers |
176
176
  | [Webhooks](./docs/webhooks.md) | Receiving external events and lifecycle hooks on channels |
177
- | [Lifecycle hooks](./docs/lifecycle-hooks.md) | Install, provision, uninstall, OAuth |
177
+ | [Lifecycle hooks](./docs/lifecycle-hooks.md) | Install, provision, uninstall, OAuth, token refresh |
178
178
  | [Authentication](./docs/authentication.md) | Token types, scopes, and SDK configuration |
179
179
  | [Core API](./docs/core-api.md) | Platform resource client reference |
180
180
  | [Errors](./docs/errors.md) | Install and runtime error types |
package/dist/.build-stamp CHANGED
@@ -1 +1 @@
1
- 1788412919726
1
+ 1791350257292
@@ -6,6 +6,9 @@ export { listModels, pullSchema, diffSchema, pushSchema, approveMigration, } fro
6
6
  export { workflows } from './workflows';
7
7
  export type { WorkflowRecord, WorkflowVersion, DeployWorkflowResult, ValidateWorkflowResult, RunWorkflowResult, WorkflowRunStatus, WorkflowSchema, PublishWorkflowResult, PullWorkflowResult, DeployWorkflowOptions, } from './workflows';
8
8
  export { listWorkflows, getWorkflow, listWorkflowVersions, validateWorkflow, validateWorkflowContent, deployWorkflow, publishWorkflow, pullWorkflow, getWorkflowSchema, runWorkflow, getWorkflowRun, } from './workflows';
9
+ export { playground } from './playground';
10
+ export type { PlaygroundSendResult, PlaygroundInspectResult, PlaygroundCreateResult, PlaygroundTurnInput, PlaygroundScheduledMessage, PlaygroundSchedulingCheck, } from './playground';
11
+ export { sendPlaygroundTurn, inspectPlaygroundSession, createPlaygroundSession, } from './playground';
9
12
  export { apps } from './apps';
10
13
  export type { LinkAppInput, LinkAppResult, InvokeToolInput, InvokeToolResult, SyncResourcesResult, PlatformTool, GetDeploymentInput, GetDeploymentResult, DeploymentLogEntry, } from './apps';
11
14
  export { linkApp, registerEndpoint, unregisterEndpoint, heartbeat, installApp, uninstallApp, getInstallation, syncResources, listTools, invokeTool, getDeployment, } from './apps';
@@ -32,6 +32,7 @@ var api_exports = {};
32
32
  __export(api_exports, {
33
33
  approveMigration: () => approveMigration,
34
34
  apps: () => apps,
35
+ createPlaygroundSession: () => createPlaygroundSession,
35
36
  crm: () => crm,
36
37
  deployWorkflow: () => deployWorkflow,
37
38
  diffSchema: () => diffSchema,
@@ -42,6 +43,7 @@ __export(api_exports, {
42
43
  getWorkflowSchema: () => getWorkflowSchema,
43
44
  getWorkplaceToken: () => getWorkplaceToken,
44
45
  heartbeat: () => heartbeat,
46
+ inspectPlaygroundSession: () => inspectPlaygroundSession,
45
47
  installApp: () => installApp,
46
48
  invokeTool: () => invokeTool,
47
49
  linkApp: () => linkApp,
@@ -50,12 +52,14 @@ __export(api_exports, {
50
52
  listWorkflowVersions: () => listWorkflowVersions,
51
53
  listWorkflows: () => listWorkflows,
52
54
  listWorkplaces: () => listWorkplaces,
55
+ playground: () => playground,
53
56
  publishWorkflow: () => publishWorkflow,
54
57
  pullSchema: () => pullSchema,
55
58
  pullWorkflow: () => pullWorkflow,
56
59
  pushSchema: () => pushSchema,
57
60
  registerEndpoint: () => registerEndpoint,
58
61
  runWorkflow: () => runWorkflow,
62
+ sendPlaygroundTurn: () => sendPlaygroundTurn,
59
63
  syncResources: () => syncResources,
60
64
  uninstallApp: () => uninstallApp,
61
65
  unregisterEndpoint: () => unregisterEndpoint,
@@ -686,6 +690,47 @@ var workflows = {
686
690
  getRun: getWorkflowRun
687
691
  };
688
692
 
693
+ // src/cli/api/playground.ts
694
+ async function sendPlaygroundTurn(ctx, workplace, input) {
695
+ const workplaceToken = await getWorkplaceToken(ctx, workplace);
696
+ return callCliApi(cliApi(ctx), "/playground", {
697
+ workplaceId: workplaceToken.workplaceId,
698
+ action: "send",
699
+ handle: input.handle,
700
+ agentId: input.agentId,
701
+ threadId: input.threadId,
702
+ content: input.message,
703
+ currentTime: input.currentTime,
704
+ contactId: input.contactId,
705
+ appInstallationId: input.appInstallationId,
706
+ title: input.title,
707
+ sandbox: input.sandbox
708
+ });
709
+ }
710
+ async function inspectPlaygroundSession(ctx, workplace, threadId) {
711
+ const workplaceToken = await getWorkplaceToken(ctx, workplace);
712
+ return callCliApi(cliApi(ctx), "/playground", void 0, {
713
+ method: "GET",
714
+ query: {
715
+ workplaceId: workplaceToken.workplaceId,
716
+ threadId
717
+ }
718
+ });
719
+ }
720
+ async function createPlaygroundSession(ctx, workplace, input) {
721
+ const workplaceToken = await getWorkplaceToken(ctx, workplace);
722
+ return callCliApi(cliApi(ctx), "/playground", {
723
+ workplaceId: workplaceToken.workplaceId,
724
+ action: "create",
725
+ ...input
726
+ });
727
+ }
728
+ var playground = {
729
+ send: sendPlaygroundTurn,
730
+ get: inspectPlaygroundSession,
731
+ create: createPlaygroundSession
732
+ };
733
+
689
734
  // src/cli/api/apps.ts
690
735
  async function linkApp(ctx, input) {
691
736
  return callCliApi(cliApi(ctx), "/link", {
@@ -782,6 +827,7 @@ var apps = {
782
827
  0 && (module.exports = {
783
828
  approveMigration,
784
829
  apps,
830
+ createPlaygroundSession,
785
831
  crm,
786
832
  deployWorkflow,
787
833
  diffSchema,
@@ -792,6 +838,7 @@ var apps = {
792
838
  getWorkflowSchema,
793
839
  getWorkplaceToken,
794
840
  heartbeat,
841
+ inspectPlaygroundSession,
795
842
  installApp,
796
843
  invokeTool,
797
844
  linkApp,
@@ -800,12 +847,14 @@ var apps = {
800
847
  listWorkflowVersions,
801
848
  listWorkflows,
802
849
  listWorkplaces,
850
+ playground,
803
851
  publishWorkflow,
804
852
  pullSchema,
805
853
  pullWorkflow,
806
854
  pushSchema,
807
855
  registerEndpoint,
808
856
  runWorkflow,
857
+ sendPlaygroundTurn,
809
858
  syncResources,
810
859
  uninstallApp,
811
860
  unregisterEndpoint,
@@ -0,0 +1,92 @@
1
+ import { type CliContext } from './context';
2
+ export interface PlaygroundScheduledMessage {
3
+ id: string;
4
+ status: string;
5
+ scheduledAt: string;
6
+ content: string;
7
+ requiresApproval?: boolean;
8
+ cancelOnActivity?: boolean;
9
+ }
10
+ export interface PlaygroundSchedulingCheck {
11
+ applicable: boolean;
12
+ passed: boolean;
13
+ reason: string;
14
+ namedDelay: boolean;
15
+ verbalFollowUp: boolean;
16
+ scheduledSend: boolean;
17
+ }
18
+ export interface PlaygroundSendResult {
19
+ success: boolean;
20
+ threadId: string;
21
+ userMessageId?: string;
22
+ agentMessageId?: string;
23
+ agentResponse: string;
24
+ agentRunId?: string;
25
+ status: string;
26
+ currentTime?: string;
27
+ scheduledMessageIds?: string[];
28
+ scheduledMessages: PlaygroundScheduledMessage[];
29
+ schedulingCheck?: PlaygroundSchedulingCheck;
30
+ session?: {
31
+ threadId: string;
32
+ agentId: string;
33
+ agentHandle: string | null;
34
+ agentName: string;
35
+ } | null;
36
+ error?: string;
37
+ }
38
+ export interface PlaygroundInspectResult {
39
+ success: boolean;
40
+ threadId: string;
41
+ title: string | null;
42
+ agentId?: string;
43
+ agentHandle?: string | null;
44
+ agentName?: string;
45
+ messages: Array<{
46
+ id: string;
47
+ role: 'user' | 'assistant';
48
+ content: string;
49
+ createdAt: string;
50
+ }>;
51
+ scheduledMessages: PlaygroundScheduledMessage[];
52
+ sendCalls: Array<{
53
+ toolName: string;
54
+ content: string | null;
55
+ sendAt: unknown;
56
+ }>;
57
+ schedulingCheck?: PlaygroundSchedulingCheck;
58
+ error?: string;
59
+ }
60
+ export interface PlaygroundCreateResult {
61
+ success: boolean;
62
+ threadId: string;
63
+ agentId: string;
64
+ agentHandle: string | null;
65
+ agentName: string;
66
+ error?: string;
67
+ }
68
+ export interface PlaygroundTurnInput {
69
+ handle?: string;
70
+ agentId?: string;
71
+ threadId?: string;
72
+ message: string;
73
+ currentTime?: string;
74
+ contactId?: string;
75
+ appInstallationId?: string;
76
+ title?: string;
77
+ sandbox?: boolean;
78
+ }
79
+ export declare function sendPlaygroundTurn(ctx: CliContext, workplace: string, input: PlaygroundTurnInput): Promise<PlaygroundSendResult>;
80
+ export declare function inspectPlaygroundSession(ctx: CliContext, workplace: string, threadId: string): Promise<PlaygroundInspectResult>;
81
+ export declare function createPlaygroundSession(ctx: CliContext, workplace: string, input: {
82
+ handle?: string;
83
+ agentId?: string;
84
+ title?: string;
85
+ contactId?: string;
86
+ appInstallationId?: string;
87
+ }): Promise<PlaygroundCreateResult>;
88
+ export declare const playground: {
89
+ send: typeof sendPlaygroundTurn;
90
+ get: typeof inspectPlaygroundSession;
91
+ create: typeof createPlaygroundSession;
92
+ };