@redplanethq/sdk 0.1.19 → 0.1.21

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/index.mjs CHANGED
@@ -76,6 +76,163 @@ var GeminiModels = [
76
76
  LLMModelEnum.GEMINI20FLASHLITE
77
77
  ];
78
78
 
79
+ // ../types/dist/llm/providers.js
80
+ var PROVIDER_SPECS = {
81
+ openai: {
82
+ id: "openai",
83
+ label: "OpenAI",
84
+ serverDefault: true,
85
+ byokSupported: true,
86
+ apiKeyVar: "OPENAI_API_KEY",
87
+ apiKeyPlaceholder: "sk-...",
88
+ baseUrl: {
89
+ var: "OPENAI_BASE_URL",
90
+ required: false,
91
+ placeholder: "https://api.openai.com/v1",
92
+ hint: "Leave blank for OpenAI direct, or paste an OpenAI-compatible proxy URL"
93
+ },
94
+ defaultChatModel: "gpt-5.2-2025-12-11"
95
+ },
96
+ anthropic: {
97
+ id: "anthropic",
98
+ label: "Anthropic",
99
+ serverDefault: true,
100
+ byokSupported: true,
101
+ apiKeyVar: "ANTHROPIC_API_KEY",
102
+ apiKeyPlaceholder: "sk-ant-...",
103
+ defaultChatModel: "claude-opus-4-7"
104
+ },
105
+ google: {
106
+ id: "google",
107
+ label: "Google",
108
+ serverDefault: true,
109
+ byokSupported: true,
110
+ apiKeyVar: "GOOGLE_GENERATIVE_AI_API_KEY",
111
+ apiKeyPlaceholder: "AIza...",
112
+ defaultChatModel: "gemini-2.5-pro"
113
+ },
114
+ ollama: {
115
+ id: "ollama",
116
+ label: "Ollama (local)",
117
+ serverDefault: true,
118
+ byokSupported: true,
119
+ apiKeyVar: null,
120
+ apiKeyPlaceholder: "",
121
+ baseUrl: {
122
+ var: "OLLAMA_URL",
123
+ required: true,
124
+ placeholder: "http://localhost:11434",
125
+ hint: "URL of your local Ollama server"
126
+ },
127
+ defaultChatModel: "llama3.2",
128
+ modelHint: "Use model IDs like ollama/llama3.2"
129
+ },
130
+ azure: {
131
+ id: "azure",
132
+ label: "Azure OpenAI",
133
+ serverDefault: true,
134
+ byokSupported: true,
135
+ apiKeyVar: "AZURE_API_KEY",
136
+ apiKeyPlaceholder: "sk-...",
137
+ baseUrl: {
138
+ var: "AZURE_BASE_URL",
139
+ required: true,
140
+ placeholder: "https://<resource>.openai.azure.com/openai/v1",
141
+ hint: "Your Azure OpenAI resource endpoint"
142
+ },
143
+ isAzure: true,
144
+ defaultChatModel: "gpt-4o",
145
+ modelHint: "Use model IDs like azure/gpt-4o (deployment name after azure/)"
146
+ },
147
+ openrouter: {
148
+ id: "openrouter",
149
+ label: "OpenRouter",
150
+ serverDefault: true,
151
+ byokSupported: true,
152
+ apiKeyVar: "OPENROUTER_API_KEY",
153
+ apiKeyPlaceholder: "sk-or-...",
154
+ defaultChatModel: "openrouter/anthropic/claude-3.5-haiku",
155
+ modelHint: "Use model IDs like openrouter/anthropic/claude-3.5-haiku"
156
+ },
157
+ deepseek: {
158
+ id: "deepseek",
159
+ label: "DeepSeek",
160
+ serverDefault: true,
161
+ byokSupported: true,
162
+ apiKeyVar: "DEEPSEEK_API_KEY",
163
+ apiKeyPlaceholder: "sk-...",
164
+ defaultChatModel: "deepseek-chat"
165
+ },
166
+ vercel: {
167
+ id: "vercel",
168
+ label: "Vercel AI Gateway",
169
+ serverDefault: true,
170
+ byokSupported: true,
171
+ apiKeyVar: "VERCEL_AI_GATEWAY_API_KEY",
172
+ apiKeyPlaceholder: "aig-...",
173
+ defaultChatModel: "vercel/anthropic/claude-sonnet-4-5",
174
+ modelHint: "Use model IDs like vercel/anthropic/claude-sonnet-4-5"
175
+ },
176
+ groq: {
177
+ id: "groq",
178
+ label: "Groq",
179
+ serverDefault: true,
180
+ byokSupported: true,
181
+ apiKeyVar: "GROQ_API_KEY",
182
+ apiKeyPlaceholder: "gsk_...",
183
+ defaultChatModel: "groq/llama-3.3-70b-versatile",
184
+ modelHint: "Use model IDs like groq/llama-3.3-70b-versatile"
185
+ },
186
+ mistral: {
187
+ id: "mistral",
188
+ label: "Mistral",
189
+ serverDefault: true,
190
+ byokSupported: true,
191
+ apiKeyVar: "MISTRAL_API_KEY",
192
+ apiKeyPlaceholder: "...",
193
+ defaultChatModel: "mistral-large-latest"
194
+ },
195
+ xai: {
196
+ id: "xai",
197
+ label: "xAI (Grok)",
198
+ serverDefault: true,
199
+ byokSupported: true,
200
+ apiKeyVar: "XAI_API_KEY",
201
+ apiKeyPlaceholder: "xai-...",
202
+ defaultChatModel: "grok-3-mini",
203
+ modelHint: "Use model IDs like grok-3-mini"
204
+ }
205
+ };
206
+ var ALL_PROVIDERS = Object.keys(PROVIDER_SPECS);
207
+ var CHAT_PROVIDERS = ALL_PROVIDERS.filter((id) => PROVIDER_SPECS[id].serverDefault);
208
+ var BYOK_PROVIDERS = ALL_PROVIDERS.filter((id) => PROVIDER_SPECS[id].byokSupported);
209
+ var EMBEDDING_PROVIDERS = [
210
+ "openai",
211
+ "google",
212
+ "ollama",
213
+ "azure"
214
+ ];
215
+ function isSupportedProvider(id) {
216
+ return id in PROVIDER_SPECS;
217
+ }
218
+ __name(isSupportedProvider, "isSupportedProvider");
219
+ function isByokProvider(id) {
220
+ var _a;
221
+ return ((_a = PROVIDER_SPECS[id]) === null || _a === void 0 ? void 0 : _a.byokSupported) === true;
222
+ }
223
+ __name(isByokProvider, "isByokProvider");
224
+ function isChatProvider(id) {
225
+ var _a;
226
+ return ((_a = PROVIDER_SPECS[id]) === null || _a === void 0 ? void 0 : _a.serverDefault) === true;
227
+ }
228
+ __name(isChatProvider, "isChatProvider");
229
+ function getProviderSpec(id) {
230
+ const spec = PROVIDER_SPECS[id];
231
+ if (!spec) throw new Error(`Unknown provider id: ${id}`);
232
+ return spec;
233
+ }
234
+ __name(getProviderSpec, "getProviderSpec");
235
+
79
236
  // ../types/dist/graph/graph.entity.js
80
237
  var EPISODIC_NODE_PROPERTIES = `{
81
238
  uuid: e.uuid,
@@ -548,10 +705,17 @@ var GetDocumentInputSchema = z.object({
548
705
  var GetDocumentResponseSchema = z.object({
549
706
  document: DocumentSchema.nullable()
550
707
  });
708
+ var GetSkillInputSchema = z.object({
709
+ skillId: z.string()
710
+ });
711
+ var GetSkillResponseSchema = z.object({
712
+ skill: DocumentSchema.nullable()
713
+ });
551
714
  var GatewayAgentInfoSchema = z.object({
552
715
  id: z.string(),
553
716
  name: z.string(),
554
717
  description: z.string(),
718
+ baseUrl: z.string(),
555
719
  tools: z.array(z.string()),
556
720
  platform: z.string().nullable(),
557
721
  hostname: z.string().nullable(),
@@ -560,20 +724,18 @@ var GatewayAgentInfoSchema = z.object({
560
724
  "DISCONNECTED"
561
725
  ])
562
726
  });
563
- var GetGatewaysResponseSchema = z.object({
564
- gateways: z.array(GatewayAgentInfoSchema)
565
- });
566
- var ExecuteGatewayInputSchema = z.object({
567
- gatewayId: z.string(),
568
- intent: z.string()
727
+ var RegisterGatewayRequestSchema = z.object({
728
+ intent: z.literal("register"),
729
+ baseUrl: z.string().url(),
730
+ securityKey: z.string().min(10),
731
+ name: z.string().min(1).max(64).optional(),
732
+ description: z.string().max(500).optional()
569
733
  });
570
- var ExecuteGatewayToolInputSchema = z.object({
571
- gatewayId: z.string(),
572
- toolName: z.string(),
573
- params: z.record(z.unknown())
734
+ var RegisterGatewayResponseSchema = z.object({
735
+ gatewayId: z.string()
574
736
  });
575
- var ExecuteGatewayResponseSchema = z.object({
576
- result: z.unknown()
737
+ var GetGatewaysResponseSchema = z.object({
738
+ gateways: z.array(GatewayAgentInfoSchema)
577
739
  });
578
740
  var AuthorizationCodeResponseSchema = z.object({
579
741
  authorizationCode: z.string(),
@@ -763,6 +925,13 @@ var CoreClient = class {
763
925
  return this.request("GET", `/api/v1/documents/${params.documentId}`);
764
926
  }
765
927
  /**
928
+ * Get a single skill by ID.
929
+ * GET /api/v1/skills/:skillId
930
+ */
931
+ async getSkill(params) {
932
+ return this.request("GET", `/api/v1/skills/${params.skillId}`);
933
+ }
934
+ /**
766
935
  * List all connected gateways for the workspace.
767
936
  * GET /api/v1/gateways
768
937
  */
@@ -770,26 +939,17 @@ var CoreClient = class {
770
939
  return this.request("GET", "/api/v1/gateways");
771
940
  }
772
941
  /**
773
- * Run a gateway sub-agent with an intent and return the final text result.
774
- * POST /api/v1/gateways/:gatewayId/execute
775
- */
776
- async executeGateway(params) {
777
- return this.request("POST", `/api/v1/gateways/${params.gatewayId}/execute`, {
778
- body: {
779
- intent: params.intent
780
- }
781
- });
782
- }
783
- /**
784
- * Proxy a single tool call to a gateway via server websocket.
785
- * POST /api/v1/gateways/:gatewayId/execute (mode: "tool")
942
+ * Register a self-hosted gateway with the workspace.
943
+ * POST /api/v1/gateways (body: { intent: "register", baseUrl, securityKey, name?, description? })
944
+ *
945
+ * The webapp probes the gateway's `/verify` to confirm reachability and
946
+ * that the supplied key matches its stored hash before persisting.
786
947
  */
787
- async executeGatewayTool(params) {
788
- return this.request("POST", `/api/v1/gateways/${params.gatewayId}/execute`, {
948
+ async registerGateway(input) {
949
+ return this.request("POST", "/api/v1/gateways", {
789
950
  body: {
790
- mode: "tool",
791
- toolName: params.toolName,
792
- params: params.params
951
+ intent: "register",
952
+ ...input
793
953
  }
794
954
  });
795
955
  }
@@ -827,6 +987,6 @@ var CoreClient = class {
827
987
  }
828
988
  };
829
989
 
830
- export { ActionStatus, ActionStatusEnum, AuthorizationCodeResponseSchema, COMPACTED_SESSION_NODE_PROPERTIES, ClaudeModels, CoreClient, CoreClientError, DocumentSchema, ENTITY_NODE_PROPERTIES, EPISODIC_NODE_PROPERTIES, EXPLICIT_PATTERN_TYPES, EntityTypes, EpisodeType, EpisodeTypeEnum, ExecuteGatewayInputSchema, ExecuteGatewayResponseSchema, ExecuteGatewayToolInputSchema, ExecuteIntegrationActionInputSchema, ExecuteIntegrationActionResponseSchema, GRAPH_ASPECTS, GatewayAgentInfoSchema, GeminiModels, GetDocumentInputSchema, GetDocumentResponseSchema, GetDocumentsInputSchema, GetDocumentsResponseSchema, GetGatewaysResponseSchema, GetIntegrationActionsInputSchema, GetIntegrationActionsResponseSchema, GetIntegrationsConnectedResponseSchema, IMPLICIT_PATTERN_TYPES, IngestInputSchema, IngestResponseSchema, IntegrationAccountSchema, IntegrationCLI, IntegrationEventType, LLMMappings, LLMModelEnum, LLMModelType, MeResponseSchema, OAuth2Params, OpenAIModels, PATTERN_TYPES, QUALITY_THRESHOLDS, STATEMENT_NODE_PROPERTIES, SearchInputSchema, SearchResponseSchema, Spec, StatementAspects, TokenExchangeInputSchema, TokenExchangeResponseSchema, UserTypeEnum, VOICE_ASPECTS };
990
+ export { ALL_PROVIDERS, ActionStatus, ActionStatusEnum, AuthorizationCodeResponseSchema, BYOK_PROVIDERS, CHAT_PROVIDERS, COMPACTED_SESSION_NODE_PROPERTIES, ClaudeModels, CoreClient, CoreClientError, DocumentSchema, EMBEDDING_PROVIDERS, ENTITY_NODE_PROPERTIES, EPISODIC_NODE_PROPERTIES, EXPLICIT_PATTERN_TYPES, EntityTypes, EpisodeType, EpisodeTypeEnum, ExecuteIntegrationActionInputSchema, ExecuteIntegrationActionResponseSchema, GRAPH_ASPECTS, GatewayAgentInfoSchema, GeminiModels, GetDocumentInputSchema, GetDocumentResponseSchema, GetDocumentsInputSchema, GetDocumentsResponseSchema, GetGatewaysResponseSchema, GetIntegrationActionsInputSchema, GetIntegrationActionsResponseSchema, GetIntegrationsConnectedResponseSchema, GetSkillInputSchema, GetSkillResponseSchema, IMPLICIT_PATTERN_TYPES, IngestInputSchema, IngestResponseSchema, IntegrationAccountSchema, IntegrationCLI, IntegrationEventType, LLMMappings, LLMModelEnum, LLMModelType, MeResponseSchema, OAuth2Params, OpenAIModels, PATTERN_TYPES, PROVIDER_SPECS, QUALITY_THRESHOLDS, RegisterGatewayRequestSchema, RegisterGatewayResponseSchema, STATEMENT_NODE_PROPERTIES, SearchInputSchema, SearchResponseSchema, Spec, StatementAspects, TokenExchangeInputSchema, TokenExchangeResponseSchema, UserTypeEnum, VOICE_ASPECTS, getProviderSpec, isByokProvider, isChatProvider, isSupportedProvider };
831
991
  //# sourceMappingURL=index.mjs.map
832
992
  //# sourceMappingURL=index.mjs.map