@ocxp/client 0.2.3 → 0.2.5

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.js CHANGED
@@ -845,6 +845,64 @@ var bulkDeleteContent = (options) => (options.client ?? client).post({
845
845
  ...options.headers
846
846
  }
847
847
  });
848
+ var listPrototypeChats = (options) => (options?.client ?? client).get({
849
+ security: [{ scheme: "bearer", type: "http" }],
850
+ url: "/ocxp/prototype/chat/list",
851
+ ...options
852
+ });
853
+ var previewPrototypeChat = (options) => (options.client ?? client).post({
854
+ security: [{ scheme: "bearer", type: "http" }],
855
+ url: "/ocxp/prototype/chat/preview",
856
+ ...options,
857
+ headers: {
858
+ "Content-Type": "application/json",
859
+ ...options.headers
860
+ }
861
+ });
862
+ var linkPrototypeChat = (options) => (options.client ?? client).post({
863
+ security: [{ scheme: "bearer", type: "http" }],
864
+ url: "/ocxp/prototype/chat/link",
865
+ ...options,
866
+ headers: {
867
+ "Content-Type": "application/json",
868
+ ...options.headers
869
+ }
870
+ });
871
+ var syncPrototypeChat = (options) => (options.client ?? client).post({
872
+ security: [{ scheme: "bearer", type: "http" }],
873
+ url: "/ocxp/prototype/chat/sync",
874
+ ...options,
875
+ headers: {
876
+ "Content-Type": "application/json",
877
+ ...options.headers
878
+ }
879
+ });
880
+ var getStoredVersions = (options) => (options.client ?? client).get(
881
+ {
882
+ security: [{ scheme: "bearer", type: "http" }],
883
+ url: "/ocxp/prototype/chat/{provider}/{chat_id}/stored-versions",
884
+ ...options
885
+ }
886
+ );
887
+ var getPrototypeChat = (options) => (options.client ?? client).get({
888
+ security: [{ scheme: "bearer", type: "http" }],
889
+ url: "/ocxp/prototype/chat/{provider}/{chat_id}",
890
+ ...options
891
+ });
892
+ var syncPrototypeChatAsync = (options) => (options.client ?? client).post({
893
+ security: [{ scheme: "bearer", type: "http" }],
894
+ url: "/ocxp/prototype/chat/sync-async",
895
+ ...options,
896
+ headers: {
897
+ "Content-Type": "application/json",
898
+ ...options.headers
899
+ }
900
+ });
901
+ var getSyncStatus = (options) => (options.client ?? client).get({
902
+ security: [{ scheme: "bearer", type: "http" }],
903
+ url: "/ocxp/prototype/chat/sync-status/{job_id}",
904
+ ...options
905
+ });
848
906
  var listSessions = (options) => (options?.client ?? client).get({
849
907
  security: [{ scheme: "bearer", type: "http" }],
850
908
  url: "/ocxp/session",
@@ -2262,6 +2320,120 @@ var OCXPClient = class {
2262
2320
  headers
2263
2321
  });
2264
2322
  }
2323
+ // ============== Prototype Operations ==============
2324
+ /**
2325
+ * List all accessible prototype chats from a provider
2326
+ * @param provider - Filter by provider (v0, lovable, bolt)
2327
+ */
2328
+ async listPrototypeChats(provider) {
2329
+ const headers = await this.getHeaders();
2330
+ const response = await listPrototypeChats({
2331
+ client: this.client,
2332
+ query: { provider },
2333
+ headers
2334
+ });
2335
+ return extractData(response);
2336
+ }
2337
+ /**
2338
+ * Preview a prototype chat (fetch metadata without linking)
2339
+ * @param chatUrl - Chat URL to preview
2340
+ * @param provider - Prototype provider (optional, auto-detected from URL)
2341
+ */
2342
+ async previewPrototypeChat(chatUrl, provider) {
2343
+ const headers = await this.getHeaders();
2344
+ const response = await previewPrototypeChat({
2345
+ client: this.client,
2346
+ body: { chat_url: chatUrl, provider },
2347
+ headers
2348
+ });
2349
+ return extractData(response);
2350
+ }
2351
+ /**
2352
+ * Link a prototype chat to a mission
2353
+ * @param data - Link request data
2354
+ */
2355
+ async linkPrototypeChat(data) {
2356
+ const headers = await this.getHeaders();
2357
+ const response = await linkPrototypeChat({
2358
+ client: this.client,
2359
+ body: data,
2360
+ headers
2361
+ });
2362
+ return extractData(response);
2363
+ }
2364
+ /**
2365
+ * Sync/refresh a linked prototype chat
2366
+ * @param data - Sync request data
2367
+ */
2368
+ async syncPrototypeChat(data) {
2369
+ const headers = await this.getHeaders();
2370
+ const response = await syncPrototypeChat({
2371
+ client: this.client,
2372
+ body: data,
2373
+ headers
2374
+ });
2375
+ return extractData(response);
2376
+ }
2377
+ /**
2378
+ * Get stored prototype chat data
2379
+ * @param provider - Provider name (v0, lovable, bolt)
2380
+ * @param chatId - Chat ID
2381
+ * @param options - Optional query parameters
2382
+ */
2383
+ async getPrototypeChat(provider, chatId, options) {
2384
+ const headers = await this.getHeaders();
2385
+ const response = await getPrototypeChat({
2386
+ client: this.client,
2387
+ path: { provider, chat_id: chatId },
2388
+ query: { project_id: options?.projectId, version_id: options?.versionId },
2389
+ headers
2390
+ });
2391
+ return extractData(response);
2392
+ }
2393
+ /**
2394
+ * Start async prototype chat sync job
2395
+ * @param data - Async sync request data
2396
+ */
2397
+ async syncPrototypeChatAsync(data) {
2398
+ const headers = await this.getHeaders();
2399
+ const response = await syncPrototypeChatAsync({
2400
+ client: this.client,
2401
+ body: data,
2402
+ headers
2403
+ });
2404
+ return extractData(response);
2405
+ }
2406
+ /**
2407
+ * Get sync job status
2408
+ * @param jobId - Job ID from async sync response
2409
+ */
2410
+ async getPrototypeSyncStatus(jobId) {
2411
+ const headers = await this.getHeaders();
2412
+ const response = await getSyncStatus({
2413
+ client: this.client,
2414
+ path: { job_id: jobId },
2415
+ headers
2416
+ });
2417
+ return extractData(response);
2418
+ }
2419
+ /**
2420
+ * Get stored versions for a prototype chat (fast DynamoDB query)
2421
+ * Use this for UI button states instead of full sync
2422
+ * @param provider - Provider name (v0, lovable, bolt)
2423
+ * @param chatId - Chat ID
2424
+ * @param options - Optional settings
2425
+ * @param options.includeDetails - If true, returns full version metadata (files, pages, screenshots)
2426
+ */
2427
+ async getStoredVersions(provider, chatId, options) {
2428
+ const headers = await this.getHeaders();
2429
+ const response = await getStoredVersions({
2430
+ client: this.client,
2431
+ path: { provider, chat_id: chatId },
2432
+ query: options?.includeDetails ? { include_details: true } : void 0,
2433
+ headers
2434
+ });
2435
+ return extractData(response);
2436
+ }
2265
2437
  // ============== Auth Operations ==============
2266
2438
  /**
2267
2439
  * Get auth configuration (public endpoint)
@@ -2385,6 +2557,7 @@ var OCXPClient = class {
2385
2557
  _project;
2386
2558
  _session;
2387
2559
  _kb;
2560
+ _prototype;
2388
2561
  /**
2389
2562
  * Mission namespace for convenient mission operations
2390
2563
  * @example ocxp.mission.list({ status: 'pending' })
@@ -2425,6 +2598,16 @@ var OCXPClient = class {
2425
2598
  }
2426
2599
  return this._kb;
2427
2600
  }
2601
+ /**
2602
+ * Prototype namespace for convenient prototype chat operations
2603
+ * @example ocxp.prototype.list('v0')
2604
+ */
2605
+ get prototype() {
2606
+ if (!this._prototype) {
2607
+ this._prototype = new PrototypeNamespace(this);
2608
+ }
2609
+ return this._prototype;
2610
+ }
2428
2611
  };
2429
2612
  var MissionNamespace = class {
2430
2613
  constructor(client2) {
@@ -2645,6 +2828,69 @@ var KBNamespace = class {
2645
2828
  return this.client.kbRag(query, sessionId);
2646
2829
  }
2647
2830
  };
2831
+ var PrototypeNamespace = class {
2832
+ constructor(client2) {
2833
+ this.client = client2;
2834
+ }
2835
+ /**
2836
+ * List all accessible prototype chats
2837
+ * @example ocxp.prototype.list('v0')
2838
+ */
2839
+ async list(provider) {
2840
+ return this.client.listPrototypeChats(provider);
2841
+ }
2842
+ /**
2843
+ * Preview a prototype chat (fetch metadata without linking)
2844
+ * @example ocxp.prototype.preview('https://v0.dev/chat/abc123')
2845
+ */
2846
+ async preview(chatUrl, provider) {
2847
+ return this.client.previewPrototypeChat(chatUrl, provider);
2848
+ }
2849
+ /**
2850
+ * Link a prototype chat to a mission
2851
+ * @example ocxp.prototype.link({ mission_id: 'xyz', chat_url: 'https://v0.dev/chat/abc123' })
2852
+ */
2853
+ async link(data) {
2854
+ return this.client.linkPrototypeChat(data);
2855
+ }
2856
+ /**
2857
+ * Sync/refresh a linked prototype chat
2858
+ * @example ocxp.prototype.sync({ chat_id: 'abc123', mission_id: 'xyz' })
2859
+ */
2860
+ async sync(data) {
2861
+ return this.client.syncPrototypeChat(data);
2862
+ }
2863
+ /**
2864
+ * Get stored prototype chat data
2865
+ * @example ocxp.prototype.get('v0', 'abc123')
2866
+ */
2867
+ async get(provider, chatId, options) {
2868
+ return this.client.getPrototypeChat(provider, chatId, options);
2869
+ }
2870
+ /**
2871
+ * Start async prototype chat sync job
2872
+ * @example ocxp.prototype.syncAsync({ chat_id: 'abc123', mission_id: 'xyz', download_files: true })
2873
+ */
2874
+ async syncAsync(data) {
2875
+ return this.client.syncPrototypeChatAsync(data);
2876
+ }
2877
+ /**
2878
+ * Get sync job status
2879
+ * @example ocxp.prototype.getSyncStatus('job-id')
2880
+ */
2881
+ async getSyncStatus(jobId) {
2882
+ return this.client.getPrototypeSyncStatus(jobId);
2883
+ }
2884
+ /**
2885
+ * Get stored versions for a prototype chat (fast DynamoDB query)
2886
+ * Use this for UI button states instead of full sync
2887
+ * @param options.includeDetails - If true, returns full version metadata (files, pages, screenshots)
2888
+ * @example ocxp.prototype.getStoredVersions('v0', 'abc123', { includeDetails: true })
2889
+ */
2890
+ async getStoredVersions(provider, chatId, options) {
2891
+ return this.client.getStoredVersions(provider, chatId, options);
2892
+ }
2893
+ };
2648
2894
  function createOCXPClient(options) {
2649
2895
  return new OCXPClient(options);
2650
2896
  }
@@ -3064,6 +3310,18 @@ var WebSocketService = class {
3064
3310
  onSyncEvent(handler) {
3065
3311
  return this.on("sync_event", handler);
3066
3312
  }
3313
+ /**
3314
+ * Subscribe to prototype sync progress updates
3315
+ */
3316
+ onPrototypeSyncProgress(handler) {
3317
+ return this.on("prototype_sync_progress", handler);
3318
+ }
3319
+ /**
3320
+ * Subscribe to prototype sync complete notifications
3321
+ */
3322
+ onPrototypeSyncComplete(handler) {
3323
+ return this.on("prototype_sync_complete", handler);
3324
+ }
3067
3325
  /**
3068
3326
  * Subscribe to connection state changes
3069
3327
  */
@@ -3083,6 +3341,12 @@ var WebSocketService = class {
3083
3341
  subscribeToRepo(repoId) {
3084
3342
  this.send({ action: "subscribe", type: "repo", id: repoId });
3085
3343
  }
3344
+ /**
3345
+ * Subscribe to prototype sync job updates
3346
+ */
3347
+ subscribeToPrototypeSync(jobId) {
3348
+ this.send({ action: "subscribe", topic: `prototype_sync:${jobId}` });
3349
+ }
3086
3350
  /**
3087
3351
  * Send message to server
3088
3352
  */
@@ -3912,6 +4176,6 @@ var GithubCommitsDataSchema = z.object({
3912
4176
  });
3913
4177
  var GithubCommitsResponseSchema = createResponseSchema(GithubCommitsDataSchema);
3914
4178
 
3915
- export { AddProjectRepoDataSchema, AddProjectRepoResponseSchema, AuthTokenDataSchema, AuthTokenResponseSchema, AuthUserInfoResponseSchema, AuthUserInfoSchema, AuthValidateDataSchema, AuthValidateResponseSchema, ContentTypeInfoSchema, ContentTypeSchema, ContentTypesDataSchema, ContentTypesResponseSchema, ContextReposDataSchema, ContextReposResponseSchema, CreateProjectDataSchema, CreateProjectResponseSchema, CreateSessionDataSchema, CreateSessionResponseSchema, DeleteDataSchema, DeleteProjectDataSchema, DeleteProjectResponseSchema, DeleteResponseSchema, DiscoveryDataSchema, DiscoveryEndpointSchema, DiscoveryResponseSchema, ErrorResponseSchema, ForkSessionDataSchema, ForkSessionResponseSchema, GetProjectDataSchema, GetProjectResponseSchema, GetSessionMessagesDataSchema, GetSessionMessagesResponseSchema, GithubBranchInfoSchema, GithubBranchesDataSchema, GithubBranchesResponseSchema, GithubCommitInfoSchema, GithubCommitsDataSchema, GithubCommitsResponseSchema, GithubDirectoryDataSchema, GithubDirectoryResponseSchema, GithubFileDataSchema, GithubFileInfoSchema, GithubFileResponseSchema, GithubRepoDataSchema, GithubRepoInfoSchema, GithubRepoResponseSchema, IngestionJobResponseSchema, IngestionJobSchema, KBDocumentSchema, KBIngestDataSchema, KBIngestResponseSchema, KBListDataSchema, KBListResponseSchema, KBNamespace, ListDataSchema, ListEntrySchema, ListProjectsDataSchema, ListProjectsResponseSchema, ListResponseSchema, ListSessionsDataSchema, ListSessionsResponseSchema, MetaSchema, MissionNamespace, OCXPAuthError, OCXPClient, OCXPConflictError, OCXPError, OCXPErrorCode, OCXPNetworkError, OCXPNotFoundError, OCXPPathService, OCXPRateLimitError, OCXPResponseSchema, OCXPTimeoutError, OCXPValidationError, PaginationSchema, PresignedUrlDataSchema, PresignedUrlResponseSchema, ProjectMissionSchema, ProjectNamespace, ProjectRepoSchema, ProjectSchema, QueryDataSchema, QueryFilterSchema, QueryResponseSchema, ReadDataSchema, ReadResponseSchema, RepoDeleteDataSchema, RepoDeleteResponseSchema, RepoDownloadDataSchema, RepoDownloadRequestSchema, RepoDownloadResponseSchema, RepoExistsDataSchema, RepoExistsResponseSchema, RepoListDataSchema, RepoListItemSchema, RepoListResponseSchema, RepoStatusDataSchema, RepoStatusEnum, RepoStatusResponseSchema, SearchDataSchema, SearchResponseSchema, SearchResultItemSchema, SessionMessageSchema, SessionNamespace, SessionSchema, StatsDataSchema, StatsResponseSchema, TreeDataSchema, TreeNodeSchema, TreeResponseSchema, UpdateProjectDataSchema, UpdateProjectResponseSchema, UpdateSessionMetadataDataSchema, UpdateSessionMetadataResponseSchema, VALID_CONTENT_TYPES, VectorSearchDataSchema, VectorSearchResponseSchema, WSBaseMessageSchema, WSChatMessageSchema, WSChatResponseSchema, WSConnectedSchema, WSErrorMessageSchema, WSMessageSchema, WSMessageTypeSchema, WSPingPongSchema, WSStatusSchema, WSStreamChunkSchema, WSStreamEndSchema, WSStreamStartSchema, WebSocketService, WriteDataSchema, WriteResponseSchema, acknowledgeMemo, addDatabase, addLinkedRepo, addMission, archiveSession, buildPath, bulkDeleteContent, bulkReadContent, bulkWriteContent, createClient, createConfig, createDatabase, createMemo, createOCXPClient, createPathService, createProject, createResponseSchema, createWebSocketService, deleteContent, deleteDatabase, deleteMemo, deleteProject, deleteRepo, downloadRepository, forkSession, getAuthConfig, getCanonicalType, getContentStats, getContentTree, getContentTypes, getContextRepos, getCurrentUser, getDatabase, getMemo, getMemoForSource, getMissionContext, getProject, getProjectDatabases, getRepoDownloadStatus, getSample, getSchema, getSessionMessages, githubCheckAccess, githubGetContents, githubListBranches, ignoreMemo, isOCXPAuthError, isOCXPConflictError, isOCXPError, isOCXPNetworkError, isOCXPNotFoundError, isOCXPRateLimitError, isOCXPTimeoutError, isOCXPValidationError, isValidContentType, listContent, listContextDatabases, listDatabases, listDownloadedRepos, listMemos, listProjects, listSessions, listTables, listWorkspaces, lockContent, login, loginForAccessToken, mapHttpError, moveContent, normalizePath, parsePath, parseWSMessage, queryContent, queryKnowledgeBase, ragKnowledgeBase, readContent, refreshTokens, regenerateMission, removeDatabase, removeLinkedRepo, removeMission, resolveMemo, safeParseWSMessage, searchContent, setDefaultDatabase, setDefaultRepo, testDatabaseConnection, toolCreateMission, toolUpdateMission, unlockContent, updateDatabase, updateProject, updateSessionMetadata, writeContent };
4179
+ export { AddProjectRepoDataSchema, AddProjectRepoResponseSchema, AuthTokenDataSchema, AuthTokenResponseSchema, AuthUserInfoResponseSchema, AuthUserInfoSchema, AuthValidateDataSchema, AuthValidateResponseSchema, ContentTypeInfoSchema, ContentTypeSchema, ContentTypesDataSchema, ContentTypesResponseSchema, ContextReposDataSchema, ContextReposResponseSchema, CreateProjectDataSchema, CreateProjectResponseSchema, CreateSessionDataSchema, CreateSessionResponseSchema, DeleteDataSchema, DeleteProjectDataSchema, DeleteProjectResponseSchema, DeleteResponseSchema, DiscoveryDataSchema, DiscoveryEndpointSchema, DiscoveryResponseSchema, ErrorResponseSchema, ForkSessionDataSchema, ForkSessionResponseSchema, GetProjectDataSchema, GetProjectResponseSchema, GetSessionMessagesDataSchema, GetSessionMessagesResponseSchema, GithubBranchInfoSchema, GithubBranchesDataSchema, GithubBranchesResponseSchema, GithubCommitInfoSchema, GithubCommitsDataSchema, GithubCommitsResponseSchema, GithubDirectoryDataSchema, GithubDirectoryResponseSchema, GithubFileDataSchema, GithubFileInfoSchema, GithubFileResponseSchema, GithubRepoDataSchema, GithubRepoInfoSchema, GithubRepoResponseSchema, IngestionJobResponseSchema, IngestionJobSchema, KBDocumentSchema, KBIngestDataSchema, KBIngestResponseSchema, KBListDataSchema, KBListResponseSchema, KBNamespace, ListDataSchema, ListEntrySchema, ListProjectsDataSchema, ListProjectsResponseSchema, ListResponseSchema, ListSessionsDataSchema, ListSessionsResponseSchema, MetaSchema, MissionNamespace, OCXPAuthError, OCXPClient, OCXPConflictError, OCXPError, OCXPErrorCode, OCXPNetworkError, OCXPNotFoundError, OCXPPathService, OCXPRateLimitError, OCXPResponseSchema, OCXPTimeoutError, OCXPValidationError, PaginationSchema, PresignedUrlDataSchema, PresignedUrlResponseSchema, ProjectMissionSchema, ProjectNamespace, ProjectRepoSchema, ProjectSchema, PrototypeNamespace, QueryDataSchema, QueryFilterSchema, QueryResponseSchema, ReadDataSchema, ReadResponseSchema, RepoDeleteDataSchema, RepoDeleteResponseSchema, RepoDownloadDataSchema, RepoDownloadRequestSchema, RepoDownloadResponseSchema, RepoExistsDataSchema, RepoExistsResponseSchema, RepoListDataSchema, RepoListItemSchema, RepoListResponseSchema, RepoStatusDataSchema, RepoStatusEnum, RepoStatusResponseSchema, SearchDataSchema, SearchResponseSchema, SearchResultItemSchema, SessionMessageSchema, SessionNamespace, SessionSchema, StatsDataSchema, StatsResponseSchema, TreeDataSchema, TreeNodeSchema, TreeResponseSchema, UpdateProjectDataSchema, UpdateProjectResponseSchema, UpdateSessionMetadataDataSchema, UpdateSessionMetadataResponseSchema, VALID_CONTENT_TYPES, VectorSearchDataSchema, VectorSearchResponseSchema, WSBaseMessageSchema, WSChatMessageSchema, WSChatResponseSchema, WSConnectedSchema, WSErrorMessageSchema, WSMessageSchema, WSMessageTypeSchema, WSPingPongSchema, WSStatusSchema, WSStreamChunkSchema, WSStreamEndSchema, WSStreamStartSchema, WebSocketService, WriteDataSchema, WriteResponseSchema, acknowledgeMemo, addDatabase, addLinkedRepo, addMission, archiveSession, buildPath, bulkDeleteContent, bulkReadContent, bulkWriteContent, createClient, createConfig, createDatabase, createMemo, createOCXPClient, createPathService, createProject, createResponseSchema, createWebSocketService, deleteContent, deleteDatabase, deleteMemo, deleteProject, deleteRepo, downloadRepository, forkSession, getAuthConfig, getCanonicalType, getContentStats, getContentTree, getContentTypes, getContextRepos, getCurrentUser, getDatabase, getMemo, getMemoForSource, getMissionContext, getProject, getProjectDatabases, getPrototypeChat, getRepoDownloadStatus, getSample, getSchema, getSessionMessages, getStoredVersions, getSyncStatus, githubCheckAccess, githubGetContents, githubListBranches, ignoreMemo, isOCXPAuthError, isOCXPConflictError, isOCXPError, isOCXPNetworkError, isOCXPNotFoundError, isOCXPRateLimitError, isOCXPTimeoutError, isOCXPValidationError, isValidContentType, linkPrototypeChat, listContent, listContextDatabases, listDatabases, listDownloadedRepos, listMemos, listProjects, listPrototypeChats, listSessions, listTables, listWorkspaces, lockContent, login, loginForAccessToken, mapHttpError, moveContent, normalizePath, parsePath, parseWSMessage, previewPrototypeChat, queryContent, queryKnowledgeBase, ragKnowledgeBase, readContent, refreshTokens, regenerateMission, removeDatabase, removeLinkedRepo, removeMission, resolveMemo, safeParseWSMessage, searchContent, setDefaultDatabase, setDefaultRepo, syncPrototypeChat, syncPrototypeChatAsync, testDatabaseConnection, toolCreateMission, toolUpdateMission, unlockContent, updateDatabase, updateProject, updateSessionMetadata, writeContent };
3916
4180
  //# sourceMappingURL=index.js.map
3917
4181
  //# sourceMappingURL=index.js.map