New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@guiiai/shared

Package Overview
Dependencies
Maintainers
0
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@guiiai/shared - npm Package Compare versions

Comparing version 0.7.7 to 0.8.0

448

dist/index.d.ts

@@ -0,1 +1,5 @@

import { z } from 'zod';
import OpenAI from 'openai';
import { Stream } from 'openai/streaming.mjs';
declare const EL_ID_DEVTOOLS_HOLDER = "guii-devtools";

@@ -14,11 +18,292 @@ declare const EL_ID_DEVTOOLS_SHADOW_DOM_HOST = "guii-devtools-host";

declare const CLIENT_DEVTOOLS_GENERATE_URL_PREFIX = "https://api.guii.ai/api/v1/devtools/generate";
declare const SUPPORTED_MODELS: string[];
declare const target: any;
interface UserProfileData {
userProfile: {
/**
* Defines the structure of a project's authentication profile
* Used to identify and authenticate project-level operations
*/
declare const ProjectAuthenticationSchema: z.ZodObject<{
id: z.ZodString;
token: z.ZodString;
}, "strip", z.ZodTypeAny, {
id: string;
token: string;
}, {
id: string;
token: string;
}>;
type ProjectAuthentication = z.infer<typeof ProjectAuthenticationSchema>;
/**
* Defines the initial configuration options that can be provided by users
* Currently supports optional authentication profile settings
*/
declare const UserConfigurationSchema: z.ZodObject<{
profile: z.ZodOptional<z.ZodObject<{
token: z.ZodString;
}, "strip", z.ZodTypeAny, {
token: string;
}, {
token: string;
}>>;
}, "strip", z.ZodTypeAny, {
profile?: {
token: string;
} | undefined;
}, {
profile?: {
token: string;
} | undefined;
}>;
type UserConfiguration = z.infer<typeof UserConfigurationSchema>;
/**
* Defines where code generation will be executed
* Local: Generation happens on user's machine
* Remote: Generation is performed on cloud infrastructure
*/
declare const ExecutionLocationSchema: z.ZodEnum<["local", "remote"]>;
type ExecutionLocation = z.infer<typeof ExecutionLocationSchema>;
/**
* Defines the complete project configuration structure
* Includes authentication state, project metadata, and API configurations
*/
declare const ProjectSettingsSchema: z.ZodObject<{
isSignedIn: z.ZodBoolean;
profile: z.ZodOptional<z.ZodObject<{
id: z.ZodString;
token: z.ZodString;
}, "strip", z.ZodTypeAny, {
id: string;
token: string;
}, {
id: string;
token: string;
}>>;
project: z.ZodObject<{
title: z.ZodString;
}, "strip", z.ZodTypeAny, {
title: string;
}, {
title: string;
}>;
openAI: z.ZodObject<{
apiBaseUrl: z.ZodString;
apiKey: z.ZodString;
}, "strip", z.ZodTypeAny, {
apiBaseUrl: string;
apiKey: string;
}, {
apiBaseUrl: string;
apiKey: string;
}>;
}, "strip", z.ZodTypeAny, {
isSignedIn: boolean;
project: {
title: string;
};
openAI: {
apiBaseUrl: string;
apiKey: string;
};
profile?: {
id: string;
token: string;
} | undefined;
}, {
isSignedIn: boolean;
project: {
title: string;
};
openAI: {
apiBaseUrl: string;
apiKey: string;
};
profile?: {
id: string;
token: string;
} | undefined;
}>;
type ProjectSettings = z.infer<typeof ProjectSettingsSchema>;
/**
* Defines supported Node.js package managers
* Used to identify which package manager is being used in the project
*/
declare const NodePackageManagerSchema: z.ZodEnum<["npm", "yarn", "pnpm"]>;
/**
* Defines the project's dependency environment
* Used to track both runtime and development dependencies along with package manager choice
*/
declare const ProjectDependencyEnvSchema: z.ZodObject<{
dependencies: z.ZodRecord<z.ZodString, z.ZodString>;
devDependencies: z.ZodRecord<z.ZodString, z.ZodString>;
packageManager: z.ZodOptional<z.ZodEnum<["npm", "yarn", "pnpm"]>>;
}, "strip", z.ZodTypeAny, {
dependencies: Record<string, string>;
devDependencies: Record<string, string>;
packageManager?: "npm" | "yarn" | "pnpm" | undefined;
}, {
dependencies: Record<string, string>;
devDependencies: Record<string, string>;
packageManager?: "npm" | "yarn" | "pnpm" | undefined;
}>;
/**
* Defines the structure of a package.json file
* Contains essential metadata and dependency information for Node.js projects
*/
declare const PackageManifestSchema: z.ZodObject<{
name: z.ZodOptional<z.ZodString>;
version: z.ZodOptional<z.ZodString>;
packageManager: z.ZodOptional<z.ZodString>;
dependencies: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
devDependencies: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
}, "strip", z.ZodTypeAny, {
dependencies?: Record<string, string> | undefined;
devDependencies?: Record<string, string> | undefined;
packageManager?: string | undefined;
name?: string | undefined;
version?: string | undefined;
}, {
dependencies?: Record<string, string> | undefined;
devDependencies?: Record<string, string> | undefined;
packageManager?: string | undefined;
name?: string | undefined;
version?: string | undefined;
}>;
type NodePackageManager = z.infer<typeof NodePackageManagerSchema>;
type ProjectDependencyEnv = z.infer<typeof ProjectDependencyEnvSchema>;
type PackageManifest = z.infer<typeof PackageManifestSchema>;
/**
* Represents a message parameter in a chat completion request
* Contains the role and content of a message
*/
type AIChatMessage = OpenAI.Chat.Completions.ChatCompletionMessageParam;
/**
* Represents a user message parameter in a chat completion request
* Specifically for messages from the user role
*/
type AIChatUserMessage = OpenAI.Chat.Completions.ChatCompletionUserMessageParam;
/**
* Represents a content part in a chat message
* Can be either text or image content
*/
type AIChatMessageContent = OpenAI.Chat.Completions.ChatCompletionContentPart;
/**
* Represents a text content part in a chat message
* Contains plain text content
*/
type AIChatMessageTextContent = OpenAI.Chat.Completions.ChatCompletionContentPartText;
/**
* Represents an image content part in a chat message
* Contains image data in supported formats
*/
type AIChatMessageImageContent = OpenAI.Chat.Completions.ChatCompletionContentPartImage;
/**
* Represents a streaming response from the chat completion API
* Provides chunks of the completion response as they become available
*/
type AIChatCompletionStream = Stream<OpenAI.Chat.Completions.ChatCompletionChunk>;
/**
* Represents a single chunk of a chat completion response
* Contains a message and completion information
*/
type AIChatCompletionChunk = OpenAI.Chat.Completions.ChatCompletionChunk;
/**
* Represents a complete message parameter for chat completion
* Includes role and content information
*/
type AIChatCompletionMessage = OpenAI.Chat.Completions.ChatCompletionMessageParam;
/**
* Defines user authorization schema for secure client-server communication
* Used to validate and enforce authentication state and credentials
*/
declare const UserAuthorizationSchema: z.ZodObject<{
id: z.ZodString;
token: z.ZodString;
}, "strip", z.ZodTypeAny, {
id: string;
token: string;
}, {
id: string;
token: string;
}>;
/**
* Defines the basic user identity information displayed in the UI
* Contains user's unique identifier, display name and avatar
*/
declare const UserIdentitySchema: z.ZodObject<{
id: z.ZodString;
displayName: z.ZodString;
avatarUrl: z.ZodString;
joinedAt: z.ZodOptional<z.ZodNumber>;
}, "strip", z.ZodTypeAny, {
id: string;
displayName: string;
avatarUrl: string;
joinedAt?: number | undefined;
}, {
id: string;
displayName: string;
avatarUrl: string;
joinedAt?: number | undefined;
}>;
/**
* Tracks the usage metrics of API credits for the user
* Used to monitor and control access to paid features
*/
declare const CreditsStatsSchema: z.ZodObject<{
total: z.ZodNumber;
remaining: z.ZodNumber;
used: z.ZodNumber;
}, "strip", z.ZodTypeAny, {
total: number;
remaining: number;
used: number;
}, {
total: number;
remaining: number;
used: number;
}>;
/**
* Combines user identity with credit balance information
* Provides complete user profile data needed for the application
*/
declare const UserMetadataSchema: z.ZodObject<{
userIdentity: z.ZodObject<{
id: z.ZodString;
displayName: z.ZodString;
avatarUrl: z.ZodString;
joinedAt: z.ZodOptional<z.ZodNumber>;
}, "strip", z.ZodTypeAny, {
id: string;
displayName: string;
avatarUrl: string;
joinedAt?: number | undefined;
}, {
id: string;
displayName: string;
avatarUrl: string;
joinedAt?: number | undefined;
}>;
creditsStats: z.ZodObject<{
total: z.ZodNumber;
remaining: z.ZodNumber;
used: z.ZodNumber;
}, "strip", z.ZodTypeAny, {
total: number;
remaining: number;
used: number;
}, {
total: number;
remaining: number;
used: number;
}>;
}, "strip", z.ZodTypeAny, {
userIdentity: {
id: string;
displayName: string;
avatarUrl: string;
joinedAt?: number | undefined;
};

@@ -30,3 +315,156 @@ creditsStats: {

};
}
}, {
userIdentity: {
id: string;
displayName: string;
avatarUrl: string;
joinedAt?: number | undefined;
};
creditsStats: {
total: number;
remaining: number;
used: number;
};
}>;
/**
* Defines the generation type for the user
* Used to determine the generation provider to use
*/
declare const GenerationTypeSchema: z.ZodEnum<["remote", "local"]>;
/**
* Represents the complete user profile state including authentication,
* profile data and OpenAI API configuration
*/
declare const UserProfileSchema: z.ZodObject<{
isSignedIn: z.ZodBoolean;
accessToken: z.ZodString;
metadata: z.ZodObject<{
userIdentity: z.ZodObject<{
id: z.ZodString;
displayName: z.ZodString;
avatarUrl: z.ZodString;
joinedAt: z.ZodOptional<z.ZodNumber>;
}, "strip", z.ZodTypeAny, {
id: string;
displayName: string;
avatarUrl: string;
joinedAt?: number | undefined;
}, {
id: string;
displayName: string;
avatarUrl: string;
joinedAt?: number | undefined;
}>;
creditsStats: z.ZodObject<{
total: z.ZodNumber;
remaining: z.ZodNumber;
used: z.ZodNumber;
}, "strip", z.ZodTypeAny, {
total: number;
remaining: number;
used: number;
}, {
total: number;
remaining: number;
used: number;
}>;
}, "strip", z.ZodTypeAny, {
userIdentity: {
id: string;
displayName: string;
avatarUrl: string;
joinedAt?: number | undefined;
};
creditsStats: {
total: number;
remaining: number;
used: number;
};
}, {
userIdentity: {
id: string;
displayName: string;
avatarUrl: string;
joinedAt?: number | undefined;
};
creditsStats: {
total: number;
remaining: number;
used: number;
};
}>;
isLoading: z.ZodOptional<z.ZodBoolean>;
isReady: z.ZodOptional<z.ZodBoolean>;
projectTitle: z.ZodOptional<z.ZodString>;
generationType: z.ZodOptional<z.ZodEnum<["remote", "local"]>>;
openAI: z.ZodOptional<z.ZodObject<{
apiKey: z.ZodString;
baseUrl: z.ZodString;
modelName: z.ZodString;
}, "strip", z.ZodTypeAny, {
apiKey: string;
baseUrl: string;
modelName: string;
}, {
apiKey: string;
baseUrl: string;
modelName: string;
}>>;
}, "strip", z.ZodTypeAny, {
isSignedIn: boolean;
accessToken: string;
metadata: {
userIdentity: {
id: string;
displayName: string;
avatarUrl: string;
joinedAt?: number | undefined;
};
creditsStats: {
total: number;
remaining: number;
used: number;
};
};
openAI?: {
apiKey: string;
baseUrl: string;
modelName: string;
} | undefined;
isLoading?: boolean | undefined;
isReady?: boolean | undefined;
projectTitle?: string | undefined;
generationType?: "local" | "remote" | undefined;
}, {
isSignedIn: boolean;
accessToken: string;
metadata: {
userIdentity: {
id: string;
displayName: string;
avatarUrl: string;
joinedAt?: number | undefined;
};
creditsStats: {
total: number;
remaining: number;
used: number;
};
};
openAI?: {
apiKey: string;
baseUrl: string;
modelName: string;
} | undefined;
isLoading?: boolean | undefined;
isReady?: boolean | undefined;
projectTitle?: string | undefined;
generationType?: "local" | "remote" | undefined;
}>;
type GenerationType = z.infer<typeof GenerationTypeSchema>;
type UserAuthorization = z.infer<typeof UserAuthorizationSchema>;
type UserIdentity = z.infer<typeof UserIdentitySchema>;
type CreditsStats = z.infer<typeof CreditsStatsSchema>;
type UserProfile = z.infer<typeof UserProfileSchema>;
type UserMetadata = z.infer<typeof UserMetadataSchema>;

@@ -55,2 +493,2 @@ /**

export { CLIENT_API_BASE_URL_PREFIX, CLIENT_AUTHORIZE_FROM_URL, CLIENT_CALLBACK_TO_URL, CLIENT_DEVTOOLS_GENERATE_URL_PREFIX, CLIENT_URL, CLIENT_VERSION, DEVTOOLS_RESOURCE_SYMBOL, EL_DATA_KEY_CODEMAP, EL_DATA_KEY_IGNORE, EL_ID_DEVTOOLS_HOLDER, EL_ID_DEVTOOLS_SHADOW_DOM_HOST, EL_PROPS_KEY_CODEMAP, SUPPORTED_MODELS, type UserProfileData, VIRTUAL_MODULE_ID_PATH, isFunction, isObject, isPromise, target };
export { type AIChatCompletionChunk, type AIChatCompletionMessage, type AIChatCompletionStream, type AIChatMessage, type AIChatMessageContent, type AIChatMessageImageContent, type AIChatMessageTextContent, type AIChatUserMessage, CLIENT_API_BASE_URL_PREFIX, CLIENT_AUTHORIZE_FROM_URL, CLIENT_CALLBACK_TO_URL, CLIENT_DEVTOOLS_GENERATE_URL_PREFIX, CLIENT_URL, CLIENT_VERSION, type CreditsStats, CreditsStatsSchema, DEVTOOLS_RESOURCE_SYMBOL, EL_DATA_KEY_CODEMAP, EL_DATA_KEY_IGNORE, EL_ID_DEVTOOLS_HOLDER, EL_ID_DEVTOOLS_SHADOW_DOM_HOST, EL_PROPS_KEY_CODEMAP, type ExecutionLocation, ExecutionLocationSchema, type GenerationType, GenerationTypeSchema, type NodePackageManager, NodePackageManagerSchema, type PackageManifest, PackageManifestSchema, type ProjectAuthentication, ProjectAuthenticationSchema, type ProjectDependencyEnv, ProjectDependencyEnvSchema, type ProjectSettings, ProjectSettingsSchema, type UserAuthorization, UserAuthorizationSchema, type UserConfiguration, UserConfigurationSchema, type UserIdentity, UserIdentitySchema, type UserMetadata, UserMetadataSchema, type UserProfile, UserProfileSchema, VIRTUAL_MODULE_ID_PATH, isFunction, isObject, isPromise, target };
{
"name": "@guiiai/shared",
"version": "0.7.7",
"version": "0.8.0",
"description": "",

@@ -30,2 +30,6 @@ "author": {

],
"dependencies": {
"openai": "^4.71.1",
"zod": "^3.23.8"
},
"scripts": {

@@ -32,0 +36,0 @@ "stub": "unbuild --stub",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc