@fork-api/chat-sdk 0.1.174 → 0.1.176

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.cts CHANGED
@@ -185,50 +185,24 @@ interface ForkSlotProps {
185
185
  }
186
186
  type ForkState = "idle" | "prompting" | "running" | "complete" | "error";
187
187
 
188
- type PreviewTargetKind = "slot" | "module";
189
-
190
- /**
191
- * Phase 4 — preview-session client state, persistence, and pub/sub.
192
- *
193
- * One module owns:
194
- * 1. sessionStorage I/O (namespaced by apiKey so multiple tenants can
195
- * coexist on the same origin without trampling each other).
196
- * 2. A tiny subscribe/notify model so React components — banner, provider
197
- * hooks, sidebar — all share one source of truth and stay in lockstep
198
- * across mount/unmount cycles.
199
- *
200
- * Why sessionStorage (not localStorage): a preview session is bound to a
201
- * single tab. Closing the tab cancels the session; opening a second tab
202
- * should NOT inherit somebody else's authoring state. sessionStorage
203
- * mirrors that lifetime exactly.
204
- *
205
- * Why pub/sub over React context alone: the banner is mounted into a
206
- * detached Shadow DOM root (separate render tree). It can't read context
207
- * from the ForkProvider tree, so it subscribes to this module directly.
208
- */
209
-
210
- interface PreviewSessionPayload {
211
- preview_session_id: string;
212
- tenant_id: string;
213
- app_id: string;
214
- target: {
215
- kind: PreviewTargetKind;
216
- id: string;
217
- };
218
- operator_id: number;
219
- container_id?: string | null;
220
- /** Human-readable container label for preview UI. Defaults to "Fork". */
221
- container_name?: string | null;
222
- /** Seeded from activate(); the SDK updates it when authoring creates a
223
- * new fork. Null when the operator just landed and hasn't authored. */
224
- fork_id: string | null;
225
- /** ISO-8601 expiration. The banner ticks against this; once past, the
226
- * module clears storage on next access. */
227
- expires_at: string;
188
+ interface AdminContainer {
189
+ id: string;
190
+ name: string;
191
+ isPrimary: boolean;
192
+ forkCount: number;
193
+ }
194
+ interface AdminContext {
195
+ /** True when the verified caller is an operator (or a mapped end-user) on
196
+ * this tenant resolved server-side via GET /admin/containers. */
197
+ isAdmin: boolean;
198
+ /** The tenant end-user the operator acts as (their mapped End-user). */
199
+ actingUserId: string | null;
200
+ /** Container currently being viewed/authored; null before one resolves. */
201
+ containerId: string | null;
202
+ containerName: string | null;
203
+ /** Containers the acting end-user can access (for the panel switcher). */
204
+ containers: AdminContainer[];
228
205
  }
229
-
230
- declare function usePreviewSession(): PreviewSessionPayload | null;
231
-
232
206
  interface ForkRuntimeGlobal {
233
207
  dataFetch: (path: string, body?: unknown, method?: string) => Promise<any>;
234
208
  }
@@ -819,4 +793,4 @@ declare function clearCachedManifest(tenantId: string, appId: string, userId: st
819
793
  */
820
794
  declare function manifestDiffers(a: Manifest | null, b: Manifest | null): boolean;
821
795
 
822
- export { type EnsureFeatureInput, type EnsureLlmJobsInput, type Fork, type ForkActivity, type ForkActivitySummary, type ForkActivityTargetKind, type ForkBoundaryDefinition, ForkBoundaryUI, ForkButton, ForkChatInterface, type ForkChatInterfaceProps, type ForkChatPanelOptions, type ForkChatTarget, type ForkDataClient, type ForkDataClientConfig, type ForkDataSource, type ForkDataStatus, type ForkEntityRef, type ForkEvent, type ForkFeature, type ForkFeatureKind, type ForkFeatureOption, type ForkFeatureValue, type ForkLlmJob, type ForkLlmJobStatus, ForkPanel, ForkProvider, type ForkProviderProps, type ForkSharedRegistry, ForkSlot, type ForkSlotProps, type ForkState, ForkUI, type LoadManifestInput, type Manifest, type ManifestEntry, type ManifestModuleEntry, type PreviewSessionPayload, type QueryLlmJobsInput, type QueryValuesInput, type SetOptionsInput, type SetValuesInput, type UseForkFeatureValuesInput, type UseForkLlmJobsInput, clearCachedManifest, createForkDataClient, forkEntityValueKey, forkable, loadManifest, manifestDiffers, readCachedManifest, registerForkShared, useBoundaryFork, useFork, useForkChatPanel, useForkDataClient, useForkDataMutation, useForkFeatureValues, useForkLlmJobs, usePreviewSession, writeCachedManifest };
796
+ export { type AdminContainer, type AdminContext, type EnsureFeatureInput, type EnsureLlmJobsInput, type Fork, type ForkActivity, type ForkActivitySummary, type ForkActivityTargetKind, type ForkBoundaryDefinition, ForkBoundaryUI, ForkButton, ForkChatInterface, type ForkChatInterfaceProps, type ForkChatPanelOptions, type ForkChatTarget, type ForkDataClient, type ForkDataClientConfig, type ForkDataSource, type ForkDataStatus, type ForkEntityRef, type ForkEvent, type ForkFeature, type ForkFeatureKind, type ForkFeatureOption, type ForkFeatureValue, type ForkLlmJob, type ForkLlmJobStatus, ForkPanel, ForkProvider, type ForkProviderProps, type ForkSharedRegistry, ForkSlot, type ForkSlotProps, type ForkState, ForkUI, type LoadManifestInput, type Manifest, type ManifestEntry, type ManifestModuleEntry, type QueryLlmJobsInput, type QueryValuesInput, type SetOptionsInput, type SetValuesInput, type UseForkFeatureValuesInput, type UseForkLlmJobsInput, clearCachedManifest, createForkDataClient, forkEntityValueKey, forkable, loadManifest, manifestDiffers, readCachedManifest, registerForkShared, useBoundaryFork, useFork, useForkChatPanel, useForkDataClient, useForkDataMutation, useForkFeatureValues, useForkLlmJobs, writeCachedManifest };
package/dist/index.d.ts CHANGED
@@ -185,50 +185,24 @@ interface ForkSlotProps {
185
185
  }
186
186
  type ForkState = "idle" | "prompting" | "running" | "complete" | "error";
187
187
 
188
- type PreviewTargetKind = "slot" | "module";
189
-
190
- /**
191
- * Phase 4 — preview-session client state, persistence, and pub/sub.
192
- *
193
- * One module owns:
194
- * 1. sessionStorage I/O (namespaced by apiKey so multiple tenants can
195
- * coexist on the same origin without trampling each other).
196
- * 2. A tiny subscribe/notify model so React components — banner, provider
197
- * hooks, sidebar — all share one source of truth and stay in lockstep
198
- * across mount/unmount cycles.
199
- *
200
- * Why sessionStorage (not localStorage): a preview session is bound to a
201
- * single tab. Closing the tab cancels the session; opening a second tab
202
- * should NOT inherit somebody else's authoring state. sessionStorage
203
- * mirrors that lifetime exactly.
204
- *
205
- * Why pub/sub over React context alone: the banner is mounted into a
206
- * detached Shadow DOM root (separate render tree). It can't read context
207
- * from the ForkProvider tree, so it subscribes to this module directly.
208
- */
209
-
210
- interface PreviewSessionPayload {
211
- preview_session_id: string;
212
- tenant_id: string;
213
- app_id: string;
214
- target: {
215
- kind: PreviewTargetKind;
216
- id: string;
217
- };
218
- operator_id: number;
219
- container_id?: string | null;
220
- /** Human-readable container label for preview UI. Defaults to "Fork". */
221
- container_name?: string | null;
222
- /** Seeded from activate(); the SDK updates it when authoring creates a
223
- * new fork. Null when the operator just landed and hasn't authored. */
224
- fork_id: string | null;
225
- /** ISO-8601 expiration. The banner ticks against this; once past, the
226
- * module clears storage on next access. */
227
- expires_at: string;
188
+ interface AdminContainer {
189
+ id: string;
190
+ name: string;
191
+ isPrimary: boolean;
192
+ forkCount: number;
193
+ }
194
+ interface AdminContext {
195
+ /** True when the verified caller is an operator (or a mapped end-user) on
196
+ * this tenant resolved server-side via GET /admin/containers. */
197
+ isAdmin: boolean;
198
+ /** The tenant end-user the operator acts as (their mapped End-user). */
199
+ actingUserId: string | null;
200
+ /** Container currently being viewed/authored; null before one resolves. */
201
+ containerId: string | null;
202
+ containerName: string | null;
203
+ /** Containers the acting end-user can access (for the panel switcher). */
204
+ containers: AdminContainer[];
228
205
  }
229
-
230
- declare function usePreviewSession(): PreviewSessionPayload | null;
231
-
232
206
  interface ForkRuntimeGlobal {
233
207
  dataFetch: (path: string, body?: unknown, method?: string) => Promise<any>;
234
208
  }
@@ -819,4 +793,4 @@ declare function clearCachedManifest(tenantId: string, appId: string, userId: st
819
793
  */
820
794
  declare function manifestDiffers(a: Manifest | null, b: Manifest | null): boolean;
821
795
 
822
- export { type EnsureFeatureInput, type EnsureLlmJobsInput, type Fork, type ForkActivity, type ForkActivitySummary, type ForkActivityTargetKind, type ForkBoundaryDefinition, ForkBoundaryUI, ForkButton, ForkChatInterface, type ForkChatInterfaceProps, type ForkChatPanelOptions, type ForkChatTarget, type ForkDataClient, type ForkDataClientConfig, type ForkDataSource, type ForkDataStatus, type ForkEntityRef, type ForkEvent, type ForkFeature, type ForkFeatureKind, type ForkFeatureOption, type ForkFeatureValue, type ForkLlmJob, type ForkLlmJobStatus, ForkPanel, ForkProvider, type ForkProviderProps, type ForkSharedRegistry, ForkSlot, type ForkSlotProps, type ForkState, ForkUI, type LoadManifestInput, type Manifest, type ManifestEntry, type ManifestModuleEntry, type PreviewSessionPayload, type QueryLlmJobsInput, type QueryValuesInput, type SetOptionsInput, type SetValuesInput, type UseForkFeatureValuesInput, type UseForkLlmJobsInput, clearCachedManifest, createForkDataClient, forkEntityValueKey, forkable, loadManifest, manifestDiffers, readCachedManifest, registerForkShared, useBoundaryFork, useFork, useForkChatPanel, useForkDataClient, useForkDataMutation, useForkFeatureValues, useForkLlmJobs, usePreviewSession, writeCachedManifest };
796
+ export { type AdminContainer, type AdminContext, type EnsureFeatureInput, type EnsureLlmJobsInput, type Fork, type ForkActivity, type ForkActivitySummary, type ForkActivityTargetKind, type ForkBoundaryDefinition, ForkBoundaryUI, ForkButton, ForkChatInterface, type ForkChatInterfaceProps, type ForkChatPanelOptions, type ForkChatTarget, type ForkDataClient, type ForkDataClientConfig, type ForkDataSource, type ForkDataStatus, type ForkEntityRef, type ForkEvent, type ForkFeature, type ForkFeatureKind, type ForkFeatureOption, type ForkFeatureValue, type ForkLlmJob, type ForkLlmJobStatus, ForkPanel, ForkProvider, type ForkProviderProps, type ForkSharedRegistry, ForkSlot, type ForkSlotProps, type ForkState, ForkUI, type LoadManifestInput, type Manifest, type ManifestEntry, type ManifestModuleEntry, type QueryLlmJobsInput, type QueryValuesInput, type SetOptionsInput, type SetValuesInput, type UseForkFeatureValuesInput, type UseForkLlmJobsInput, clearCachedManifest, createForkDataClient, forkEntityValueKey, forkable, loadManifest, manifestDiffers, readCachedManifest, registerForkShared, useBoundaryFork, useFork, useForkChatPanel, useForkDataClient, useForkDataMutation, useForkFeatureValues, useForkLlmJobs, writeCachedManifest };