@redplanethq/sdk 0.1.16 → 0.1.18
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.d.mts +57 -1
- package/dist/index.d.ts +57 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -394,6 +394,8 @@ interface WidgetRenderContext {
|
|
|
394
394
|
name?: string;
|
|
395
395
|
}>;
|
|
396
396
|
baseUrl: string;
|
|
397
|
+
/** Call to trigger a TUI re-render after updating internal state (TUI only) */
|
|
398
|
+
requestRender?: () => void;
|
|
397
399
|
}
|
|
398
400
|
/** Metadata only — used in integration Spec (no render function) */
|
|
399
401
|
interface WidgetMeta {
|
|
@@ -419,6 +421,58 @@ type WidgetComponent = WebWidgetComponent | TuiWidgetComponent;
|
|
|
419
421
|
interface WidgetSpec extends WidgetMeta {
|
|
420
422
|
render(context: WidgetRenderContext): Promise<WidgetComponent>;
|
|
421
423
|
}
|
|
424
|
+
/** Recursive JSON value type — covers all valid tool input shapes */
|
|
425
|
+
type ToolInputPrimitive = string | number | boolean | null;
|
|
426
|
+
type ToolInputValue = ToolInputPrimitive | ToolInputValue[] | {
|
|
427
|
+
[key: string]: ToolInputValue;
|
|
428
|
+
};
|
|
429
|
+
type ToolInput = Record<string, ToolInputValue>;
|
|
430
|
+
/** A single content block in a tool result */
|
|
431
|
+
interface ToolContent {
|
|
432
|
+
type: string;
|
|
433
|
+
text: string;
|
|
434
|
+
}
|
|
435
|
+
/** The result returned by a tool call */
|
|
436
|
+
interface ToolResult {
|
|
437
|
+
content: ToolContent[];
|
|
438
|
+
isError?: boolean;
|
|
439
|
+
}
|
|
440
|
+
/** A pi-tui component rendering a tool result (tui placement) */
|
|
441
|
+
interface TuiToolUIComponent {
|
|
442
|
+
render: (width: number) => string[];
|
|
443
|
+
}
|
|
444
|
+
/** A React component rendering a tool result (webapp placement) */
|
|
445
|
+
type WebToolUIComponent = () => object;
|
|
446
|
+
type ToolUIComponent = WebToolUIComponent | TuiToolUIComponent;
|
|
447
|
+
/** Context passed to a ToolUI renderer */
|
|
448
|
+
interface ToolUIRenderContext {
|
|
449
|
+
placement: 'tui' | 'webapp';
|
|
450
|
+
pat: string;
|
|
451
|
+
accounts: Array<{
|
|
452
|
+
id: string;
|
|
453
|
+
slug: string;
|
|
454
|
+
name?: string;
|
|
455
|
+
}>;
|
|
456
|
+
baseUrl: string;
|
|
457
|
+
}
|
|
458
|
+
/**
|
|
459
|
+
* Integration-defined UI for tool calls.
|
|
460
|
+
* render() is called in two phases:
|
|
461
|
+
* Phase 1 — result is null: tool input is known, user can modify and call submitInput()
|
|
462
|
+
* Phase 2 — result is present: tool has run, show rich result UI
|
|
463
|
+
*/
|
|
464
|
+
interface ToolUI {
|
|
465
|
+
supported_tools: string[];
|
|
466
|
+
render(toolName: string, input: ToolInput, result: ToolResult | null, context: ToolUIRenderContext, submitInput: (input: ToolInput) => void): Promise<ToolUIComponent>;
|
|
467
|
+
}
|
|
468
|
+
/**
|
|
469
|
+
* Shape exported by an integration's frontend.js bundle.
|
|
470
|
+
* Combines widgets (standalone) and toolUI (per-tool result renderer).
|
|
471
|
+
*/
|
|
472
|
+
interface FrontendExport {
|
|
473
|
+
widgets?: WidgetSpec[];
|
|
474
|
+
toolUI?: ToolUI;
|
|
475
|
+
}
|
|
422
476
|
declare enum IntegrationEventType {
|
|
423
477
|
/**
|
|
424
478
|
* Processes authentication data and returns tokens/credentials to be saved
|
|
@@ -479,6 +533,8 @@ declare class Spec {
|
|
|
479
533
|
mcp?: McpAuthParams;
|
|
480
534
|
};
|
|
481
535
|
widgets?: WidgetMeta[];
|
|
536
|
+
/** Set to true when the integration's frontend bundle exports a ToolUI */
|
|
537
|
+
toolUISupported?: boolean;
|
|
482
538
|
}
|
|
483
539
|
interface Config {
|
|
484
540
|
access_token: string;
|
|
@@ -1240,4 +1296,4 @@ declare class CoreClient {
|
|
|
1240
1296
|
checkAuth(): Promise<MeResponse>;
|
|
1241
1297
|
}
|
|
1242
1298
|
|
|
1243
|
-
export { APIKeyParams, ActionStatus, ActionStatusEnum, type AddEpisodeParams, type AddEpisodeResult, type AdjacentChunks, type AuthType, type AuthorizationCodeResponse, AuthorizationCodeResponseSchema, COMPACTED_SESSION_NODE_PROPERTIES, ClaudeModels, type CompactedSessionNode, type Config, CoreClient, CoreClientError, type CoreClientOptions, type CreatePatternParams, type DocumentNode, DocumentSchema, ENTITY_NODE_PROPERTIES, EPISODIC_NODE_PROPERTIES, EXPLICIT_PATTERN_TYPES, type EntityNode, type EntityType, EntityTypes, type EpisodeSearchResult, EpisodeType, EpisodeTypeEnum, type EpisodeWithProvenance, type EpisodicNode, type EpisodicNodeWithoutEmbeddings, type ExecuteGatewayInput, ExecuteGatewayInputSchema, type ExecuteGatewayResponse, ExecuteGatewayResponseSchema, type ExecuteGatewayToolInput, ExecuteGatewayToolInputSchema, type ExecuteIntegrationActionInput, ExecuteIntegrationActionInputSchema, type ExecuteIntegrationActionResponse, ExecuteIntegrationActionResponseSchema, type ExplicitPatternType, type ExtractedTripleData, GRAPH_ASPECTS, type GatewayAgentInfo, GatewayAgentInfoSchema, GeminiModels, type GetDocumentInput, GetDocumentInputSchema, type GetDocumentResponse, GetDocumentResponseSchema, type GetDocumentsInput, GetDocumentsInputSchema, type GetDocumentsResponse, GetDocumentsResponseSchema, type GetGatewaysResponse, GetGatewaysResponseSchema, type GetIntegrationActionsInput, GetIntegrationActionsInputSchema, type GetIntegrationActionsResponse, GetIntegrationActionsResponseSchema, type GetIntegrationsConnectedResponse, GetIntegrationsConnectedResponseSchema, type GraphAspect, IMPLICIT_PATTERN_TYPES, type Identifier, type ImplicitPatternType, type IngestInput, IngestInputSchema, type IngestResponse, IngestResponseSchema, IntegrationAccountSchema, IntegrationCLI, type IntegrationEventPayload, IntegrationEventType, LLMMappings, LLMModelEnum, LLMModelType, McpAuthParams, type MeResponse, MeResponseSchema, type Message, type MessageType, OAuth2Params, OpenAIModels, PATTERN_TYPES, type Param, type PatternConfirmationParams, type PatternDetectionResult, type PatternType, QUALITY_THRESHOLDS, type QualityFilterResult, type RerankConfig, STATEMENT_NODE_PROPERTIES, type SearchInput, SearchInputSchema, type SearchOptions, type SearchResponse, SearchResponseSchema, type SpaceAssignmentResult, type SpaceDeletionResult, type SpaceNode, type SpacePattern, Spec, type StatementAspect, StatementAspects, type StatementNode, type StatementWithSource, type TokenExchangeInput, TokenExchangeInputSchema, type TokenExchangeResponse, TokenExchangeResponseSchema, type Triple, type TuiWidgetComponent, type UserConfirmationStatus, UserTypeEnum, VOICE_ASPECTS, type VoiceAspect, type VoiceAspectNode, type WebWidgetComponent, type WidgetComponent, type WidgetMeta, type WidgetRenderContext, type WidgetSpec };
|
|
1299
|
+
export { APIKeyParams, ActionStatus, ActionStatusEnum, type AddEpisodeParams, type AddEpisodeResult, type AdjacentChunks, type AuthType, type AuthorizationCodeResponse, AuthorizationCodeResponseSchema, COMPACTED_SESSION_NODE_PROPERTIES, ClaudeModels, type CompactedSessionNode, type Config, CoreClient, CoreClientError, type CoreClientOptions, type CreatePatternParams, type DocumentNode, DocumentSchema, ENTITY_NODE_PROPERTIES, EPISODIC_NODE_PROPERTIES, EXPLICIT_PATTERN_TYPES, type EntityNode, type EntityType, EntityTypes, type EpisodeSearchResult, EpisodeType, EpisodeTypeEnum, type EpisodeWithProvenance, type EpisodicNode, type EpisodicNodeWithoutEmbeddings, type ExecuteGatewayInput, ExecuteGatewayInputSchema, type ExecuteGatewayResponse, ExecuteGatewayResponseSchema, type ExecuteGatewayToolInput, ExecuteGatewayToolInputSchema, type ExecuteIntegrationActionInput, ExecuteIntegrationActionInputSchema, type ExecuteIntegrationActionResponse, ExecuteIntegrationActionResponseSchema, type ExplicitPatternType, type ExtractedTripleData, type FrontendExport, GRAPH_ASPECTS, type GatewayAgentInfo, GatewayAgentInfoSchema, GeminiModels, type GetDocumentInput, GetDocumentInputSchema, type GetDocumentResponse, GetDocumentResponseSchema, type GetDocumentsInput, GetDocumentsInputSchema, type GetDocumentsResponse, GetDocumentsResponseSchema, type GetGatewaysResponse, GetGatewaysResponseSchema, type GetIntegrationActionsInput, GetIntegrationActionsInputSchema, type GetIntegrationActionsResponse, GetIntegrationActionsResponseSchema, type GetIntegrationsConnectedResponse, GetIntegrationsConnectedResponseSchema, type GraphAspect, IMPLICIT_PATTERN_TYPES, type Identifier, type ImplicitPatternType, type IngestInput, IngestInputSchema, type IngestResponse, IngestResponseSchema, IntegrationAccountSchema, IntegrationCLI, type IntegrationEventPayload, IntegrationEventType, LLMMappings, LLMModelEnum, LLMModelType, McpAuthParams, type MeResponse, MeResponseSchema, type Message, type MessageType, OAuth2Params, OpenAIModels, PATTERN_TYPES, type Param, type PatternConfirmationParams, type PatternDetectionResult, type PatternType, QUALITY_THRESHOLDS, type QualityFilterResult, type RerankConfig, STATEMENT_NODE_PROPERTIES, type SearchInput, SearchInputSchema, type SearchOptions, type SearchResponse, SearchResponseSchema, type SpaceAssignmentResult, type SpaceDeletionResult, type SpaceNode, type SpacePattern, Spec, type StatementAspect, StatementAspects, type StatementNode, type StatementWithSource, type TokenExchangeInput, TokenExchangeInputSchema, type TokenExchangeResponse, TokenExchangeResponseSchema, type ToolContent, type ToolInput, type ToolInputPrimitive, type ToolInputValue, type ToolResult, type ToolUI, type ToolUIComponent, type ToolUIRenderContext, type Triple, type TuiToolUIComponent, type TuiWidgetComponent, type UserConfirmationStatus, UserTypeEnum, VOICE_ASPECTS, type VoiceAspect, type VoiceAspectNode, type WebToolUIComponent, type WebWidgetComponent, type WidgetComponent, type WidgetMeta, type WidgetRenderContext, type WidgetSpec };
|
package/dist/index.d.ts
CHANGED
|
@@ -394,6 +394,8 @@ interface WidgetRenderContext {
|
|
|
394
394
|
name?: string;
|
|
395
395
|
}>;
|
|
396
396
|
baseUrl: string;
|
|
397
|
+
/** Call to trigger a TUI re-render after updating internal state (TUI only) */
|
|
398
|
+
requestRender?: () => void;
|
|
397
399
|
}
|
|
398
400
|
/** Metadata only — used in integration Spec (no render function) */
|
|
399
401
|
interface WidgetMeta {
|
|
@@ -419,6 +421,58 @@ type WidgetComponent = WebWidgetComponent | TuiWidgetComponent;
|
|
|
419
421
|
interface WidgetSpec extends WidgetMeta {
|
|
420
422
|
render(context: WidgetRenderContext): Promise<WidgetComponent>;
|
|
421
423
|
}
|
|
424
|
+
/** Recursive JSON value type — covers all valid tool input shapes */
|
|
425
|
+
type ToolInputPrimitive = string | number | boolean | null;
|
|
426
|
+
type ToolInputValue = ToolInputPrimitive | ToolInputValue[] | {
|
|
427
|
+
[key: string]: ToolInputValue;
|
|
428
|
+
};
|
|
429
|
+
type ToolInput = Record<string, ToolInputValue>;
|
|
430
|
+
/** A single content block in a tool result */
|
|
431
|
+
interface ToolContent {
|
|
432
|
+
type: string;
|
|
433
|
+
text: string;
|
|
434
|
+
}
|
|
435
|
+
/** The result returned by a tool call */
|
|
436
|
+
interface ToolResult {
|
|
437
|
+
content: ToolContent[];
|
|
438
|
+
isError?: boolean;
|
|
439
|
+
}
|
|
440
|
+
/** A pi-tui component rendering a tool result (tui placement) */
|
|
441
|
+
interface TuiToolUIComponent {
|
|
442
|
+
render: (width: number) => string[];
|
|
443
|
+
}
|
|
444
|
+
/** A React component rendering a tool result (webapp placement) */
|
|
445
|
+
type WebToolUIComponent = () => object;
|
|
446
|
+
type ToolUIComponent = WebToolUIComponent | TuiToolUIComponent;
|
|
447
|
+
/** Context passed to a ToolUI renderer */
|
|
448
|
+
interface ToolUIRenderContext {
|
|
449
|
+
placement: 'tui' | 'webapp';
|
|
450
|
+
pat: string;
|
|
451
|
+
accounts: Array<{
|
|
452
|
+
id: string;
|
|
453
|
+
slug: string;
|
|
454
|
+
name?: string;
|
|
455
|
+
}>;
|
|
456
|
+
baseUrl: string;
|
|
457
|
+
}
|
|
458
|
+
/**
|
|
459
|
+
* Integration-defined UI for tool calls.
|
|
460
|
+
* render() is called in two phases:
|
|
461
|
+
* Phase 1 — result is null: tool input is known, user can modify and call submitInput()
|
|
462
|
+
* Phase 2 — result is present: tool has run, show rich result UI
|
|
463
|
+
*/
|
|
464
|
+
interface ToolUI {
|
|
465
|
+
supported_tools: string[];
|
|
466
|
+
render(toolName: string, input: ToolInput, result: ToolResult | null, context: ToolUIRenderContext, submitInput: (input: ToolInput) => void): Promise<ToolUIComponent>;
|
|
467
|
+
}
|
|
468
|
+
/**
|
|
469
|
+
* Shape exported by an integration's frontend.js bundle.
|
|
470
|
+
* Combines widgets (standalone) and toolUI (per-tool result renderer).
|
|
471
|
+
*/
|
|
472
|
+
interface FrontendExport {
|
|
473
|
+
widgets?: WidgetSpec[];
|
|
474
|
+
toolUI?: ToolUI;
|
|
475
|
+
}
|
|
422
476
|
declare enum IntegrationEventType {
|
|
423
477
|
/**
|
|
424
478
|
* Processes authentication data and returns tokens/credentials to be saved
|
|
@@ -479,6 +533,8 @@ declare class Spec {
|
|
|
479
533
|
mcp?: McpAuthParams;
|
|
480
534
|
};
|
|
481
535
|
widgets?: WidgetMeta[];
|
|
536
|
+
/** Set to true when the integration's frontend bundle exports a ToolUI */
|
|
537
|
+
toolUISupported?: boolean;
|
|
482
538
|
}
|
|
483
539
|
interface Config {
|
|
484
540
|
access_token: string;
|
|
@@ -1240,4 +1296,4 @@ declare class CoreClient {
|
|
|
1240
1296
|
checkAuth(): Promise<MeResponse>;
|
|
1241
1297
|
}
|
|
1242
1298
|
|
|
1243
|
-
export { APIKeyParams, ActionStatus, ActionStatusEnum, type AddEpisodeParams, type AddEpisodeResult, type AdjacentChunks, type AuthType, type AuthorizationCodeResponse, AuthorizationCodeResponseSchema, COMPACTED_SESSION_NODE_PROPERTIES, ClaudeModels, type CompactedSessionNode, type Config, CoreClient, CoreClientError, type CoreClientOptions, type CreatePatternParams, type DocumentNode, DocumentSchema, ENTITY_NODE_PROPERTIES, EPISODIC_NODE_PROPERTIES, EXPLICIT_PATTERN_TYPES, type EntityNode, type EntityType, EntityTypes, type EpisodeSearchResult, EpisodeType, EpisodeTypeEnum, type EpisodeWithProvenance, type EpisodicNode, type EpisodicNodeWithoutEmbeddings, type ExecuteGatewayInput, ExecuteGatewayInputSchema, type ExecuteGatewayResponse, ExecuteGatewayResponseSchema, type ExecuteGatewayToolInput, ExecuteGatewayToolInputSchema, type ExecuteIntegrationActionInput, ExecuteIntegrationActionInputSchema, type ExecuteIntegrationActionResponse, ExecuteIntegrationActionResponseSchema, type ExplicitPatternType, type ExtractedTripleData, GRAPH_ASPECTS, type GatewayAgentInfo, GatewayAgentInfoSchema, GeminiModels, type GetDocumentInput, GetDocumentInputSchema, type GetDocumentResponse, GetDocumentResponseSchema, type GetDocumentsInput, GetDocumentsInputSchema, type GetDocumentsResponse, GetDocumentsResponseSchema, type GetGatewaysResponse, GetGatewaysResponseSchema, type GetIntegrationActionsInput, GetIntegrationActionsInputSchema, type GetIntegrationActionsResponse, GetIntegrationActionsResponseSchema, type GetIntegrationsConnectedResponse, GetIntegrationsConnectedResponseSchema, type GraphAspect, IMPLICIT_PATTERN_TYPES, type Identifier, type ImplicitPatternType, type IngestInput, IngestInputSchema, type IngestResponse, IngestResponseSchema, IntegrationAccountSchema, IntegrationCLI, type IntegrationEventPayload, IntegrationEventType, LLMMappings, LLMModelEnum, LLMModelType, McpAuthParams, type MeResponse, MeResponseSchema, type Message, type MessageType, OAuth2Params, OpenAIModels, PATTERN_TYPES, type Param, type PatternConfirmationParams, type PatternDetectionResult, type PatternType, QUALITY_THRESHOLDS, type QualityFilterResult, type RerankConfig, STATEMENT_NODE_PROPERTIES, type SearchInput, SearchInputSchema, type SearchOptions, type SearchResponse, SearchResponseSchema, type SpaceAssignmentResult, type SpaceDeletionResult, type SpaceNode, type SpacePattern, Spec, type StatementAspect, StatementAspects, type StatementNode, type StatementWithSource, type TokenExchangeInput, TokenExchangeInputSchema, type TokenExchangeResponse, TokenExchangeResponseSchema, type Triple, type TuiWidgetComponent, type UserConfirmationStatus, UserTypeEnum, VOICE_ASPECTS, type VoiceAspect, type VoiceAspectNode, type WebWidgetComponent, type WidgetComponent, type WidgetMeta, type WidgetRenderContext, type WidgetSpec };
|
|
1299
|
+
export { APIKeyParams, ActionStatus, ActionStatusEnum, type AddEpisodeParams, type AddEpisodeResult, type AdjacentChunks, type AuthType, type AuthorizationCodeResponse, AuthorizationCodeResponseSchema, COMPACTED_SESSION_NODE_PROPERTIES, ClaudeModels, type CompactedSessionNode, type Config, CoreClient, CoreClientError, type CoreClientOptions, type CreatePatternParams, type DocumentNode, DocumentSchema, ENTITY_NODE_PROPERTIES, EPISODIC_NODE_PROPERTIES, EXPLICIT_PATTERN_TYPES, type EntityNode, type EntityType, EntityTypes, type EpisodeSearchResult, EpisodeType, EpisodeTypeEnum, type EpisodeWithProvenance, type EpisodicNode, type EpisodicNodeWithoutEmbeddings, type ExecuteGatewayInput, ExecuteGatewayInputSchema, type ExecuteGatewayResponse, ExecuteGatewayResponseSchema, type ExecuteGatewayToolInput, ExecuteGatewayToolInputSchema, type ExecuteIntegrationActionInput, ExecuteIntegrationActionInputSchema, type ExecuteIntegrationActionResponse, ExecuteIntegrationActionResponseSchema, type ExplicitPatternType, type ExtractedTripleData, type FrontendExport, GRAPH_ASPECTS, type GatewayAgentInfo, GatewayAgentInfoSchema, GeminiModels, type GetDocumentInput, GetDocumentInputSchema, type GetDocumentResponse, GetDocumentResponseSchema, type GetDocumentsInput, GetDocumentsInputSchema, type GetDocumentsResponse, GetDocumentsResponseSchema, type GetGatewaysResponse, GetGatewaysResponseSchema, type GetIntegrationActionsInput, GetIntegrationActionsInputSchema, type GetIntegrationActionsResponse, GetIntegrationActionsResponseSchema, type GetIntegrationsConnectedResponse, GetIntegrationsConnectedResponseSchema, type GraphAspect, IMPLICIT_PATTERN_TYPES, type Identifier, type ImplicitPatternType, type IngestInput, IngestInputSchema, type IngestResponse, IngestResponseSchema, IntegrationAccountSchema, IntegrationCLI, type IntegrationEventPayload, IntegrationEventType, LLMMappings, LLMModelEnum, LLMModelType, McpAuthParams, type MeResponse, MeResponseSchema, type Message, type MessageType, OAuth2Params, OpenAIModels, PATTERN_TYPES, type Param, type PatternConfirmationParams, type PatternDetectionResult, type PatternType, QUALITY_THRESHOLDS, type QualityFilterResult, type RerankConfig, STATEMENT_NODE_PROPERTIES, type SearchInput, SearchInputSchema, type SearchOptions, type SearchResponse, SearchResponseSchema, type SpaceAssignmentResult, type SpaceDeletionResult, type SpaceNode, type SpacePattern, Spec, type StatementAspect, StatementAspects, type StatementNode, type StatementWithSource, type TokenExchangeInput, TokenExchangeInputSchema, type TokenExchangeResponse, TokenExchangeResponseSchema, type ToolContent, type ToolInput, type ToolInputPrimitive, type ToolInputValue, type ToolResult, type ToolUI, type ToolUIComponent, type ToolUIRenderContext, type Triple, type TuiToolUIComponent, type TuiWidgetComponent, type UserConfirmationStatus, UserTypeEnum, VOICE_ASPECTS, type VoiceAspect, type VoiceAspectNode, type WebToolUIComponent, type WebWidgetComponent, type WidgetComponent, type WidgetMeta, type WidgetRenderContext, type WidgetSpec };
|