@taskforcehq/taskforce 0.3.303 → 0.3.304
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/Taskforce.module.css +102 -5
- package/dist/TaskforceCore.js +514 -212
- package/dist/TaskforceCore.test.js +1172 -133
- package/dist/annotatedAttachments/service.d.ts +1 -1
- package/dist/annotatedAttachments/types.d.ts +1 -1
- package/dist/components/features/AgentsModule.js +1 -1
- package/dist/components/features/AgentsModule.test.js +1 -1
- package/dist/components/features/TaskSettings.js +58 -38
- package/dist/components/features/TaskSettings.test.js +139 -40
- package/dist/components/task/TaskActionHeader.d.ts +2 -1
- package/dist/components/task/TaskActionHeader.js +3 -3
- package/dist/components/task/TaskActionHeader.test.js +8 -0
- package/dist/components/task/TaskCard.js +16 -1
- package/dist/components/task/TaskCard.test.js +31 -0
- package/dist/components/task/TaskForm.d.ts +2 -1
- package/dist/components/task/TaskForm.js +22 -4
- package/dist/components/task/TaskForm.test.js +46 -0
- package/dist/components/task/TaskKanban.d.ts +1 -1
- package/dist/components/task/TaskKanban.js +31 -160
- package/dist/components/task/TaskStatusActions.d.ts +6 -1
- package/dist/components/task/TaskStatusActions.js +8 -3
- package/dist/components/task/TaskStatusActions.test.js +9 -0
- package/dist/components/task/taskKanbanDropRules.d.ts +58 -0
- package/dist/components/task/taskKanbanDropRules.js +187 -0
- package/dist/components/task/taskKanbanDropRules.test.d.ts +1 -0
- package/dist/components/task/taskKanbanDropRules.test.js +114 -0
- package/dist/components/ui/Modal.d.ts +1 -1
- package/dist/components/ui/Modal.js +1 -0
- package/dist/components/views/AppShellHeader.js +5 -1
- package/dist/components/views/AppShellHeader.test.js +4 -0
- package/dist/components/views/PlanComparisonPage.d.ts +3 -2
- package/dist/components/views/PlanComparisonPage.js +4 -2
- package/dist/components/views/PlanComparisonPage.test.js +4 -0
- package/dist/components/views/PlansPage.d.ts +5 -1
- package/dist/components/views/PlansPage.js +39 -12
- package/dist/components/views/PlansPage.test.js +59 -2
- package/dist/components/views/StandaloneLayout.js +113 -38
- package/dist/components/views/WidgetView.js +11 -2
- package/dist/components/views/standalone/modals/SyncStatusModal.js +1 -1
- package/dist/core/DeletedTaskLifecycleService.d.ts +2 -1
- package/dist/core/PlanEntitlementService.d.ts +3 -1
- package/dist/core/PlanEntitlementService.js +61 -11
- package/dist/core/SignupMonetizationSettings.test.js +37 -2
- package/dist/core/TaskActivityService.d.ts +4 -1
- package/dist/core/TaskActivityService.js +45 -0
- package/dist/core/TaskAuditTimeline.test.js +52 -1
- package/dist/core/Taskforce.d.ts +15 -11
- package/dist/core/Taskforce.js +43 -2
- package/dist/core/WorkspacePlanMode.test.js +65 -0
- package/dist/documentReviews/service.d.ts +1 -1
- package/dist/documentReviews/types.d.ts +1 -1
- package/dist/hooks/auth/useTaskforceAuthBootstrap.d.ts +48 -0
- package/dist/hooks/auth/useTaskforceAuthBootstrap.js +219 -0
- package/dist/hooks/sync/auth.d.ts +37 -0
- package/dist/hooks/sync/auth.js +61 -0
- package/dist/hooks/sync/bootstrap.d.ts +34 -0
- package/dist/hooks/sync/bootstrap.js +52 -0
- package/dist/hooks/sync/orchestratorShared.d.ts +36 -0
- package/dist/hooks/sync/orchestratorShared.js +209 -0
- package/dist/hooks/sync/orchestratorShared.test.d.ts +1 -0
- package/dist/hooks/sync/orchestratorShared.test.js +49 -0
- package/dist/hooks/sync/realtime.d.ts +25 -0
- package/dist/hooks/sync/realtime.js +60 -0
- package/dist/hooks/sync/recovery.d.ts +69 -0
- package/dist/hooks/sync/recovery.js +118 -0
- package/dist/hooks/sync/transfers.d.ts +122 -0
- package/dist/hooks/sync/transfers.js +431 -0
- package/dist/hooks/sync/useDataVersionRefresh.d.ts +16 -0
- package/dist/hooks/sync/useDataVersionRefresh.js +73 -0
- package/dist/hooks/ui/useResourceExport.d.ts +3 -1
- package/dist/hooks/ui/useResourceExport.js +5 -2
- package/dist/hooks/ui/useWorkflowTemplates.js +11 -6
- package/dist/hooks/useRealtimeSync.js +2 -1
- package/dist/hooks/useSyncOrchestrator.aiProfiles.test.js +8 -0
- package/dist/hooks/useSyncOrchestrator.context-assets.test.d.ts +1 -0
- package/dist/hooks/useSyncOrchestrator.context-assets.test.js +228 -0
- package/dist/hooks/useSyncOrchestrator.d.ts +5 -4
- package/dist/hooks/useSyncOrchestrator.js +314 -873
- package/dist/hooks/useSyncOrchestrator.retry-closure.test.js +568 -3
- package/dist/hooks/useTaskMutations.js +45 -6
- package/dist/hooks/useTaskMutations.test.js +147 -0
- package/dist/hooks/useTaskforce.d.ts +8 -2
- package/dist/hooks/useTaskforce.js +285 -812
- package/dist/hooks/useWorkspaceSyncController.d.ts +1 -0
- package/dist/hooks/useWorkspaceSyncController.js +22 -10
- package/dist/hooks/workspace/useTaskforceApiRouting.test.js +17 -0
- package/dist/hooks/workspace/useTaskforceWorkspaceBootstrap.d.ts +166 -0
- package/dist/hooks/workspace/useTaskforceWorkspaceBootstrap.js +434 -0
- package/dist/hooks/workspace/workspaceLocalState.d.ts +19 -0
- package/dist/hooks/workspace/workspaceLocalState.js +100 -0
- package/dist/hooks/workspace/workspaceLocalState.test.d.ts +1 -0
- package/dist/hooks/workspace/workspaceLocalState.test.js +59 -0
- package/dist/localization/locales/en-US.js +2 -2
- package/dist/mcp/canonicalAssetHelpers.d.ts +70 -0
- package/dist/mcp/canonicalAssetHelpers.js +259 -0
- package/dist/mcp/clientIntegrations.d.ts +12 -1
- package/dist/mcp/clientIntegrations.js +161 -6
- package/dist/mcp/clientIntegrations.test.js +76 -4
- package/dist/mcp/documentHelpers.d.ts +100 -0
- package/dist/mcp/documentHelpers.js +161 -0
- package/dist/mcp/runtime.js +174 -476
- package/dist/mcp/runtime.test.js +81 -8
- package/dist/mcp/taskAttachmentHelpers.d.ts +41 -0
- package/dist/mcp/taskAttachmentHelpers.js +60 -0
- package/dist/mcp/taskAttachmentTypes.d.ts +37 -0
- package/dist/mcp/taskAttachmentTypes.js +1 -0
- package/dist/plugins/vite.js +1 -1
- package/dist/runtime/appGateDefinitions.d.ts +1 -1
- package/dist/runtime/appGateDefinitions.js +1 -1
- package/dist/server/index.d.ts +1 -0
- package/dist/server/index.js +46 -3
- package/dist/server/index.test.js +12 -1
- package/dist/server/routes/admin.js +13 -19
- package/dist/server/routes/auth.js +37 -2
- package/dist/server/routes/billing.js +18 -67
- package/dist/server/routes/billing.test.js +43 -0
- package/dist/server/routes/shared.d.ts +30 -0
- package/dist/server/routes/shared.js +26 -0
- package/dist/server/routes/sync.integration.test.js +20 -0
- package/dist/server/routes/sync.js +110 -237
- package/dist/server/routes/tasks.js +49 -7
- package/dist/server/routes.js +8 -19
- package/dist/server/routes.test.js +243 -5
- package/dist/shared/taskActor.d.ts +10 -0
- package/dist/shared/taskActor.js +1 -0
- package/dist/sync/collaborationSyncPayload.js +4 -0
- package/dist/sync/collaborationSyncPayload.test.js +8 -0
- package/dist/sync/collaborationSyncState.d.ts +3 -1
- package/dist/sync/collaborationSyncState.js +19 -0
- package/dist/sync/contentSyncState.js +12 -10
- package/dist/sync/syncApplyHandlers.d.ts +87 -1
- package/dist/sync/syncApplyHandlers.js +370 -8
- package/dist/sync/syncApplyHandlers.test.d.ts +1 -0
- package/dist/sync/syncApplyHandlers.test.js +377 -0
- package/dist/sync/syncService.d.ts +8 -1
- package/dist/sync/syncService.js +36 -2
- package/dist/sync/syncService.test.js +48 -0
- package/dist/sync/workspacePullFeed.d.ts +1 -0
- package/dist/sync/workspacePullFeed.js +66 -59
- package/dist/sync/workspacePullFeed.test.js +72 -4
- package/dist/sync/workspaceSyncModel.d.ts +22 -1
- package/dist/sync/workspaceSyncModel.js +65 -0
- package/dist/sync/workspaceSyncModel.test.js +119 -0
- package/dist/types.d.ts +2 -10
- package/dist/ui/assets/AgentsModule-BLWVbuKP.js +1 -0
- package/dist/ui/assets/{AnnotatedAttachmentWorkspace-C_TmXZwA.js → AnnotatedAttachmentWorkspace-BlS-cqnl.js} +1 -1
- package/dist/ui/assets/{DocumentWorkspace-C3GyzrWm.js → DocumentWorkspace-BH_6DF6x.js} +1 -1
- package/dist/ui/assets/{InitiativesModule-4-Rh2K2n.js → InitiativesModule-BjR6iBf9.js} +1 -1
- package/dist/ui/assets/{PlansPage-BlVC_lRq.css → PlansPage-C2dd2n1X.css} +1 -1
- package/dist/ui/assets/PlansPage-CSDQ4sLa.js +1 -0
- package/dist/ui/assets/TaskSettings-CEDy34Jo.js +9 -0
- package/dist/ui/assets/{WorkflowsModule-CGk9s3NJ.js → WorkflowsModule-DnFqdUME.js} +1 -1
- package/dist/ui/assets/index-DXUdtH1B.js +6 -0
- package/dist/ui/assets/index-Ii0B0rTO.css +1 -0
- package/dist/ui/assets/{vendor-icons-pWocEipT.js → vendor-icons-I7ZwG1z_.js} +1 -1
- package/dist/ui/index.html +4 -4
- package/dist/utils/taskActivity.js +4 -0
- package/dist/utils/taskActivity.test.js +25 -1
- package/package.json +3 -1
- package/scripts/playwright-auth.sh +4 -0
- package/dist/ui/assets/AgentsModule-CpsTmrIW.js +0 -1
- package/dist/ui/assets/PlansPage-BP7AYOqr.js +0 -1
- package/dist/ui/assets/TaskSettings-BOC5F6Ag.js +0 -8
- package/dist/ui/assets/index-CLIMgR6g.js +0 -6
- package/dist/ui/assets/index-DneETxcu.css +0 -1
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { resolveRepairPhase } from './bootstrap';
|
|
2
|
+
import { savePersistedSyncWatermarks } from './orchestratorShared';
|
|
3
|
+
export function createSyncRecoveryCoordinator({ currentWorkspaceId, taxonomyStateFingerprint, workspaceCloudSyncEnabled, workspaceSyncPhase, workspaceLastPullAt, lastBootstrapPhaseRef, workspaceRepairModeRef, workspaceForceFullAiProfilePushRef, workspaceStartupRepairRanRef, workspaceStartupFullReconcileRanRef, workspaceFullReconcileInFlightRef, workspacePullCursorRef, workspaceAttachBootstrapBaselineSignatureRef, workspaceCaptureAttachBootstrapBaselineRef, workspacePendingSignatureRef, workspaceLastPushedSignatureRef, workspaceLastPushedWatermarksRef, workspaceLastPushedInitiativeIdsRef, workspaceLastPushedInitiativeWatermarksRef, workspaceLastPushedWorkstreamIdsRef, workspaceLastPushedWorkstreamWatermarksRef, workspaceLastPushedAiProfileIdsRef, workspaceLastPushedAiProfileWatermarksRef, workspaceLastPushedDocumentPathsRef, workspaceLastPushedDocumentWatermarksRef, workspaceLastPushedAssetPathsRef, workspaceLastPushedAssetWatermarksRef, workspaceLastPushedDocumentReviewSessionIdsRef, workspaceLastPushedDocumentReviewSessionWatermarksRef, workspaceLastPushedDocumentReviewCommentIdsRef, workspaceLastPushedDocumentReviewCommentWatermarksRef, workspaceLastPushedAnnotatedAttachmentSessionIdsRef, workspaceLastPushedAnnotatedAttachmentSessionWatermarksRef, workspaceLastPushedTaskEventWatermarksRef, bootstrapPhaseStartedAtRef, bootstrapLastProgressAtRef, acquireWorkspaceSyncLease, releaseWorkspaceSyncLease, forceClearWorkspaceSyncLease, clearWorkspaceRetry, clearWorkspaceIssue, reportWorkspaceWindowContention, persistWorkspaceSyncPatch, buildWorkspaceSyncSignature, pullWorkspaceChangesFromCloud, pushWorkspaceChangesToCloud, cloudAuthConfigured, runtimeMode, isAuthenticated, checkAuthSession }) {
|
|
4
|
+
const retryWorkspaceCloudSync = async () => {
|
|
5
|
+
clearWorkspaceRetry();
|
|
6
|
+
if (!cloudAuthConfigured || runtimeMode !== 'local' || !workspaceCloudSyncEnabled)
|
|
7
|
+
return false;
|
|
8
|
+
if (!isAuthenticated) {
|
|
9
|
+
const authed = await checkAuthSession();
|
|
10
|
+
if (!authed)
|
|
11
|
+
return false;
|
|
12
|
+
}
|
|
13
|
+
workspaceForceFullAiProfilePushRef.current = true;
|
|
14
|
+
if (workspaceSyncPhase === 'provision-local') {
|
|
15
|
+
const signature = buildWorkspaceSyncSignature();
|
|
16
|
+
if (!signature)
|
|
17
|
+
return false;
|
|
18
|
+
return pushWorkspaceChangesToCloud(signature, { forceAllAiProfiles: true });
|
|
19
|
+
}
|
|
20
|
+
const pulled = await pullWorkspaceChangesFromCloud();
|
|
21
|
+
if (workspaceSyncPhase === 'attach-cloud')
|
|
22
|
+
return pulled;
|
|
23
|
+
const signature = buildWorkspaceSyncSignature();
|
|
24
|
+
if (signature) {
|
|
25
|
+
workspacePendingSignatureRef.current = signature;
|
|
26
|
+
const pushed = await pushWorkspaceChangesToCloud(signature, {
|
|
27
|
+
forceAllAiProfiles: workspaceForceFullAiProfilePushRef.current === true
|
|
28
|
+
});
|
|
29
|
+
return pulled || pushed;
|
|
30
|
+
}
|
|
31
|
+
return pulled;
|
|
32
|
+
};
|
|
33
|
+
const resetWorkspaceSyncCursorAndPull = async () => {
|
|
34
|
+
const leaseAcquired = await acquireWorkspaceSyncLease(currentWorkspaceId, 'repair');
|
|
35
|
+
if (!leaseAcquired) {
|
|
36
|
+
forceClearWorkspaceSyncLease(currentWorkspaceId);
|
|
37
|
+
const reclaimed = await acquireWorkspaceSyncLease(currentWorkspaceId, 'repair');
|
|
38
|
+
if (!reclaimed) {
|
|
39
|
+
reportWorkspaceWindowContention('repair');
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
clearWorkspaceRetry();
|
|
44
|
+
clearWorkspaceIssue();
|
|
45
|
+
bootstrapPhaseStartedAtRef.current = null;
|
|
46
|
+
bootstrapLastProgressAtRef.current = null;
|
|
47
|
+
workspacePullCursorRef.current = null;
|
|
48
|
+
workspaceAttachBootstrapBaselineSignatureRef.current = '';
|
|
49
|
+
workspaceCaptureAttachBootstrapBaselineRef.current = false;
|
|
50
|
+
workspacePendingSignatureRef.current = '';
|
|
51
|
+
workspaceLastPushedSignatureRef.current = '';
|
|
52
|
+
workspaceLastPushedWatermarksRef.current = new Map();
|
|
53
|
+
workspaceLastPushedInitiativeIdsRef.current = new Set();
|
|
54
|
+
workspaceLastPushedInitiativeWatermarksRef.current = new Map();
|
|
55
|
+
workspaceLastPushedWorkstreamIdsRef.current = new Set();
|
|
56
|
+
workspaceLastPushedWorkstreamWatermarksRef.current = new Map();
|
|
57
|
+
workspaceLastPushedAiProfileIdsRef.current = new Set();
|
|
58
|
+
workspaceLastPushedAiProfileWatermarksRef.current = new Map();
|
|
59
|
+
workspaceLastPushedDocumentPathsRef.current = new Set();
|
|
60
|
+
workspaceLastPushedDocumentWatermarksRef.current = new Map();
|
|
61
|
+
workspaceLastPushedAssetPathsRef.current = new Set();
|
|
62
|
+
workspaceLastPushedAssetWatermarksRef.current = new Map();
|
|
63
|
+
workspaceLastPushedDocumentReviewSessionIdsRef.current = new Set();
|
|
64
|
+
workspaceLastPushedDocumentReviewSessionWatermarksRef.current = new Map();
|
|
65
|
+
workspaceLastPushedDocumentReviewCommentIdsRef.current = new Set();
|
|
66
|
+
workspaceLastPushedDocumentReviewCommentWatermarksRef.current = new Map();
|
|
67
|
+
workspaceLastPushedAnnotatedAttachmentSessionIdsRef.current = new Set();
|
|
68
|
+
workspaceLastPushedAnnotatedAttachmentSessionWatermarksRef.current = new Map();
|
|
69
|
+
workspaceLastPushedTaskEventWatermarksRef.current = new Map();
|
|
70
|
+
workspaceForceFullAiProfilePushRef.current = false;
|
|
71
|
+
workspaceStartupRepairRanRef.current = false;
|
|
72
|
+
workspaceStartupFullReconcileRanRef.current = false;
|
|
73
|
+
workspaceFullReconcileInFlightRef.current = false;
|
|
74
|
+
savePersistedSyncWatermarks(currentWorkspaceId, {
|
|
75
|
+
taskWatermarks: new Map(),
|
|
76
|
+
initiativeWatermarks: new Map(),
|
|
77
|
+
workstreamWatermarks: new Map(),
|
|
78
|
+
documentWatermarks: new Map(),
|
|
79
|
+
assetWatermarks: new Map(),
|
|
80
|
+
documentReviewSessionWatermarks: new Map(),
|
|
81
|
+
documentReviewCommentWatermarks: new Map(),
|
|
82
|
+
annotatedAttachmentSessionWatermarks: new Map(),
|
|
83
|
+
taskEventWatermarks: new Map(),
|
|
84
|
+
taxonomyStateFingerprint
|
|
85
|
+
});
|
|
86
|
+
try {
|
|
87
|
+
if (!workspaceCloudSyncEnabled)
|
|
88
|
+
return;
|
|
89
|
+
workspaceRepairModeRef.current = true;
|
|
90
|
+
const repairPhase = resolveRepairPhase({
|
|
91
|
+
workspaceSyncPhase,
|
|
92
|
+
lastBootstrapPhase: lastBootstrapPhaseRef.current,
|
|
93
|
+
workspaceLastPullAt
|
|
94
|
+
});
|
|
95
|
+
await persistWorkspaceSyncPatch({
|
|
96
|
+
phase: repairPhase,
|
|
97
|
+
pullCursor: null,
|
|
98
|
+
lastErrorMessage: null
|
|
99
|
+
});
|
|
100
|
+
if (repairPhase === 'provision-local') {
|
|
101
|
+
const signature = buildWorkspaceSyncSignature();
|
|
102
|
+
if (!signature)
|
|
103
|
+
return;
|
|
104
|
+
await pushWorkspaceChangesToCloud(signature, { forceAllAiProfiles: true, repairMode: true });
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
await pullWorkspaceChangesFromCloud({ repairMode: true });
|
|
108
|
+
}
|
|
109
|
+
finally {
|
|
110
|
+
workspaceRepairModeRef.current = false;
|
|
111
|
+
releaseWorkspaceSyncLease(currentWorkspaceId);
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
return {
|
|
115
|
+
retryWorkspaceCloudSync,
|
|
116
|
+
resetWorkspaceSyncCursorAndPull
|
|
117
|
+
};
|
|
118
|
+
}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import type { Dispatch, MutableRefObject, SetStateAction } from 'react';
|
|
2
|
+
import { type EnsureWorkspaceReadyResult } from '../../sync/syncService';
|
|
3
|
+
import type { WorkspaceSyncPayload } from '../../sync/workspaceSyncModel';
|
|
4
|
+
import type { WorkspaceSyncPhase } from '../../sync/workspaceSyncState';
|
|
5
|
+
interface CreateWorkspaceTransferCoordinatorArgs {
|
|
6
|
+
cloudAuthConfigured: boolean;
|
|
7
|
+
runtimeMode: 'local' | 'cloud';
|
|
8
|
+
workspaceCloudSyncEnabled: boolean;
|
|
9
|
+
currentWorkspaceId: string;
|
|
10
|
+
workspaceSyncPhase: WorkspaceSyncPhase;
|
|
11
|
+
taxonomyStateFingerprint: string;
|
|
12
|
+
isAuthenticated: boolean;
|
|
13
|
+
checkAuthSession: () => Promise<boolean>;
|
|
14
|
+
resolveCloudAuthUrl: (path: string) => string;
|
|
15
|
+
ensureCloudWorkspaceReadyForSync: () => Promise<EnsureWorkspaceReadyResult>;
|
|
16
|
+
ensureWorkspaceSyncReady: () => Promise<boolean>;
|
|
17
|
+
handleSyncAuthFailure: (source: 'push' | 'pull' | 'apply' | 'handshake', statusCode: number) => Promise<void>;
|
|
18
|
+
clearWorkspaceRetry: () => void;
|
|
19
|
+
clearWorkspaceIssue: () => void;
|
|
20
|
+
isWorkspaceRetryPending: () => boolean;
|
|
21
|
+
scheduleWorkspaceSyncRetry: (minDelayMs?: number) => void;
|
|
22
|
+
persistWorkspaceSyncPatchSafely: (patch: {
|
|
23
|
+
phase: 'error';
|
|
24
|
+
lastErrorMessage: string;
|
|
25
|
+
} | {
|
|
26
|
+
phase: 'active';
|
|
27
|
+
lastPushAt?: string;
|
|
28
|
+
lastPullAt?: string;
|
|
29
|
+
lastSyncedAt: string;
|
|
30
|
+
pullCursor?: string | null;
|
|
31
|
+
lastErrorMessage: null;
|
|
32
|
+
}) => void;
|
|
33
|
+
persistWorkspaceSyncPatchBestEffort: (patch: {
|
|
34
|
+
phase: 'active';
|
|
35
|
+
pullCursor: string | null;
|
|
36
|
+
lastPullAt: string;
|
|
37
|
+
lastSyncedAt: string;
|
|
38
|
+
lastErrorMessage: null;
|
|
39
|
+
}) => Promise<unknown>;
|
|
40
|
+
reportSyncEvent: (workspaceId: string, event: {
|
|
41
|
+
eventType: 'pull' | 'handshake' | 'bootstrap' | 'apply' | 'push';
|
|
42
|
+
status: 'success' | 'error';
|
|
43
|
+
statusCode?: number;
|
|
44
|
+
errorMessage?: string;
|
|
45
|
+
changeCount?: number;
|
|
46
|
+
requestMs?: number;
|
|
47
|
+
details?: Record<string, unknown>;
|
|
48
|
+
}) => void;
|
|
49
|
+
acquireWorkspaceSyncLease: (workspaceId: string, owner: 'pull' | 'push' | 'repair') => Promise<boolean>;
|
|
50
|
+
releaseWorkspaceSyncLease: (workspaceId: string) => void;
|
|
51
|
+
reportWorkspaceWindowContention: (operation: 'pull' | 'push' | 'repair') => void;
|
|
52
|
+
refreshWorkspaceSyncMarkdownDocumentsSnapshot: () => Promise<void>;
|
|
53
|
+
refreshWorkspaceSyncAiProfilesSnapshot: () => Promise<void>;
|
|
54
|
+
refreshWorkspaceSyncAssetsSnapshot: () => Promise<void>;
|
|
55
|
+
refreshWorkspaceSyncDocumentReviewSessionsSnapshot: () => Promise<void>;
|
|
56
|
+
refreshWorkspaceSyncAnnotatedAttachmentSessionsSnapshot: () => Promise<void>;
|
|
57
|
+
refreshLocalWorkspaceTaskCollections: () => Promise<void>;
|
|
58
|
+
buildWorkspaceSyncPayload: (options?: {
|
|
59
|
+
forceAllAiProfiles?: boolean;
|
|
60
|
+
}) => WorkspaceSyncPayload;
|
|
61
|
+
buildWorkspaceSyncSignature: () => string;
|
|
62
|
+
seedWorkspaceSnapshotPushBaseline: () => void;
|
|
63
|
+
shouldSuppressAttachBootstrapPush: (signature: string) => boolean;
|
|
64
|
+
recordSuppressedEventIds: (eventIds: Iterable<string>, options?: {
|
|
65
|
+
queueRef?: MutableRefObject<string[]>;
|
|
66
|
+
maxQueueSize?: number;
|
|
67
|
+
ttlMs?: number;
|
|
68
|
+
}) => void;
|
|
69
|
+
workspaceRepairModeRef: MutableRefObject<boolean>;
|
|
70
|
+
workspaceForceFullAiProfilePushRef: MutableRefObject<boolean>;
|
|
71
|
+
workspacePushInFlightRef: MutableRefObject<boolean>;
|
|
72
|
+
workspacePullInFlightRef: MutableRefObject<boolean>;
|
|
73
|
+
workspaceLastPushedSignatureRef: MutableRefObject<string>;
|
|
74
|
+
workspacePendingSignatureRef: MutableRefObject<string>;
|
|
75
|
+
workspaceLastPushedTaskIdsRef: MutableRefObject<Set<string>>;
|
|
76
|
+
workspaceDeletedTaskIdsRef: MutableRefObject<Set<string>>;
|
|
77
|
+
workspacePullCursorRef: MutableRefObject<string | null>;
|
|
78
|
+
workspaceLastPushedWatermarksRef: MutableRefObject<Map<string, string>>;
|
|
79
|
+
workspaceLastPushedInitiativeIdsRef: MutableRefObject<Set<string>>;
|
|
80
|
+
workspaceLastPushedInitiativeWatermarksRef: MutableRefObject<Map<string, string>>;
|
|
81
|
+
workspaceLastPushedWorkstreamIdsRef: MutableRefObject<Set<string>>;
|
|
82
|
+
workspaceLastPushedWorkstreamWatermarksRef: MutableRefObject<Map<string, string>>;
|
|
83
|
+
workspaceLastPushedAiProfileIdsRef: MutableRefObject<Set<string>>;
|
|
84
|
+
workspaceLastPushedAiProfileWatermarksRef: MutableRefObject<Map<string, string>>;
|
|
85
|
+
workspaceLastPushedDocumentPathsRef: MutableRefObject<Set<string>>;
|
|
86
|
+
workspaceLastPushedDocumentWatermarksRef: MutableRefObject<Map<string, string>>;
|
|
87
|
+
workspaceLastPushedAssetPathsRef: MutableRefObject<Set<string>>;
|
|
88
|
+
workspaceLastPushedAssetWatermarksRef: MutableRefObject<Map<string, string>>;
|
|
89
|
+
workspaceLastPushedDocumentReviewSessionIdsRef: MutableRefObject<Set<string>>;
|
|
90
|
+
workspaceLastPushedDocumentReviewSessionWatermarksRef: MutableRefObject<Map<string, string>>;
|
|
91
|
+
workspaceLastPushedDocumentReviewCommentIdsRef: MutableRefObject<Set<string>>;
|
|
92
|
+
workspaceLastPushedDocumentReviewCommentWatermarksRef: MutableRefObject<Map<string, string>>;
|
|
93
|
+
workspaceLastPushedAnnotatedAttachmentSessionIdsRef: MutableRefObject<Set<string>>;
|
|
94
|
+
workspaceLastPushedAnnotatedAttachmentSessionWatermarksRef: MutableRefObject<Map<string, string>>;
|
|
95
|
+
workspaceLastPushedTaskEventWatermarksRef: MutableRefObject<Map<string, string>>;
|
|
96
|
+
workspaceCaptureAttachBootstrapBaselineRef: MutableRefObject<boolean>;
|
|
97
|
+
workspaceStartupFullReconcileRanRef: MutableRefObject<boolean>;
|
|
98
|
+
workspaceFullReconcileInFlightRef: MutableRefObject<boolean>;
|
|
99
|
+
bootstrapLastProgressAtRef: MutableRefObject<number | null>;
|
|
100
|
+
realtimeSuppressedEventQueueRef: MutableRefObject<string[]>;
|
|
101
|
+
setWorkspaceSyncBusy: Dispatch<SetStateAction<boolean>>;
|
|
102
|
+
setUserGlobalSyncStatus: Dispatch<SetStateAction<'disconnected' | 'idle' | 'syncing' | 'error'>>;
|
|
103
|
+
setUserGlobalSyncError: Dispatch<SetStateAction<string | null>>;
|
|
104
|
+
setWorkspaceLastErrorMessage: Dispatch<SetStateAction<string | null>>;
|
|
105
|
+
setWorkspaceLastErrorAt: Dispatch<SetStateAction<string | null>>;
|
|
106
|
+
setWorkspaceLastPullAt: Dispatch<SetStateAction<string | null>>;
|
|
107
|
+
setWorkspaceLastPushAt: Dispatch<SetStateAction<string | null>>;
|
|
108
|
+
setWorkspaceSyncPendingChanges: Dispatch<SetStateAction<number>>;
|
|
109
|
+
setTasks: Dispatch<SetStateAction<any[]>>;
|
|
110
|
+
setArchivedTasks: Dispatch<SetStateAction<any[]>>;
|
|
111
|
+
}
|
|
112
|
+
export declare function createWorkspaceTransferCoordinator({ cloudAuthConfigured, runtimeMode, workspaceCloudSyncEnabled, currentWorkspaceId, workspaceSyncPhase, taxonomyStateFingerprint, isAuthenticated, checkAuthSession, resolveCloudAuthUrl, ensureCloudWorkspaceReadyForSync, ensureWorkspaceSyncReady, handleSyncAuthFailure, clearWorkspaceRetry, clearWorkspaceIssue, isWorkspaceRetryPending, scheduleWorkspaceSyncRetry, persistWorkspaceSyncPatchSafely, persistWorkspaceSyncPatchBestEffort, reportSyncEvent, acquireWorkspaceSyncLease, releaseWorkspaceSyncLease, reportWorkspaceWindowContention, refreshWorkspaceSyncMarkdownDocumentsSnapshot, refreshWorkspaceSyncAiProfilesSnapshot, refreshWorkspaceSyncAssetsSnapshot, refreshWorkspaceSyncDocumentReviewSessionsSnapshot, refreshWorkspaceSyncAnnotatedAttachmentSessionsSnapshot, refreshLocalWorkspaceTaskCollections, buildWorkspaceSyncPayload, buildWorkspaceSyncSignature, seedWorkspaceSnapshotPushBaseline, shouldSuppressAttachBootstrapPush, recordSuppressedEventIds, workspaceRepairModeRef, workspaceForceFullAiProfilePushRef, workspacePushInFlightRef, workspacePullInFlightRef, workspaceLastPushedSignatureRef, workspacePendingSignatureRef, workspaceLastPushedTaskIdsRef, workspaceDeletedTaskIdsRef, workspacePullCursorRef, workspaceLastPushedWatermarksRef, workspaceLastPushedInitiativeIdsRef, workspaceLastPushedInitiativeWatermarksRef, workspaceLastPushedWorkstreamIdsRef, workspaceLastPushedWorkstreamWatermarksRef, workspaceLastPushedAiProfileIdsRef, workspaceLastPushedAiProfileWatermarksRef, workspaceLastPushedDocumentPathsRef, workspaceLastPushedDocumentWatermarksRef, workspaceLastPushedAssetPathsRef, workspaceLastPushedAssetWatermarksRef, workspaceLastPushedDocumentReviewSessionIdsRef, workspaceLastPushedDocumentReviewSessionWatermarksRef, workspaceLastPushedDocumentReviewCommentIdsRef, workspaceLastPushedDocumentReviewCommentWatermarksRef, workspaceLastPushedAnnotatedAttachmentSessionIdsRef, workspaceLastPushedAnnotatedAttachmentSessionWatermarksRef, workspaceLastPushedTaskEventWatermarksRef, workspaceCaptureAttachBootstrapBaselineRef, workspaceStartupFullReconcileRanRef, workspaceFullReconcileInFlightRef, bootstrapLastProgressAtRef, realtimeSuppressedEventQueueRef, setWorkspaceSyncBusy, setUserGlobalSyncStatus, setUserGlobalSyncError, setWorkspaceLastErrorMessage, setWorkspaceLastErrorAt, setWorkspaceLastPullAt, setWorkspaceLastPushAt, setWorkspaceSyncPendingChanges, setTasks, setArchivedTasks }: CreateWorkspaceTransferCoordinatorArgs): {
|
|
113
|
+
pushWorkspaceChangesToCloud: (signature: string, options?: {
|
|
114
|
+
forceAllAiProfiles?: boolean;
|
|
115
|
+
repairMode?: boolean;
|
|
116
|
+
}) => Promise<boolean>;
|
|
117
|
+
pullWorkspaceChangesFromCloud: (options?: {
|
|
118
|
+
repairMode?: boolean;
|
|
119
|
+
forceCursorNull?: boolean;
|
|
120
|
+
}) => Promise<boolean>;
|
|
121
|
+
};
|
|
122
|
+
export {};
|